Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ChordEngine Class Reference

#include </home/clem/local/src/opie/noncore/multimedia/powerchord/chordengine.h>

List of all members.

Public Member Functions

 ChordEngine ()
const char * name (int f)
int noteindex (int f)
void base (int b)
int base ()
void chord (int c)
int chord ()
void fret (int f)
int fret ()
void span (int s)
int span ()
void vary (int v)
int vary ()
void tune (int t)
int tune ()
void calculate ()
const char * label ()
int finger (int string)

Static Public Attributes

static const char * notes [] = {"C", "C#", "D", "Eb", "E", "F", "F#", "G", "G#", "A", "Bb", "B", 0}
static const char * keys [] = {"maj", "min", "7th", "m7", "maj7", "6th", "m6th", "aug", "dim", "sus4", "7sus4", "9th", "add9", "m9th", "maj9", "sus2", "7sus2", "11th", "m11th", "13th", "m13th", "maj13", "6|9", "flat5", "7#9", "Ø7", "5", 0}
static const char * frets [] = {"open", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", 0}
static const char * variations [] = {"V1", "V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9", "V10", "V11", "V12", "V13", "V14", "V15", "V16", "V17", "V18", "V19", "V20", "V21", "V22", "V23", 0}
static const char * tunings [] = {"EADGBE", "EBEG#BE", "EAEAC#E", "EADF#BE", "EADGCF", "DADGAD", "DGCGCD", "DADF#AD", "DADGBE", "DGDGBD", "DADACD", "CGCGAE", "FADGBE", "Gminor",0}
static const int OPEN = 0
static const int MUTED = 7

Private Member Functions

void js_tunit (int t)
void js_whatchord (int c)
void js_vboy (int v)

Private Attributes

int base_note
int chord_type
int fret_pos
int span_size
int variation
int tuning
int string [6]
const char * notename [6]
int js_MMM [6]
int note_indices [6]
int js_T [12]
int js_L
int js_Y
int js_Z
int js_VM
char label_text [20]

Static Private Attributes

static const int chordbases [][12]
static const int alt_tunings [][6]


Constructor & Destructor Documentation

ChordEngine::ChordEngine  ) 
 

Definition at line 31 of file chordengine.cpp.

References base_note, chord_type, fret_pos, js_tunit(), js_vboy(), js_whatchord(), label_text, OPEN, span_size, string, tuning, and variation.


Member Function Documentation

int ChordEngine::base  )  [inline]
 

Definition at line 91 of file chordengine.h.

References base_note.

void ChordEngine::base int  b  )  [inline]
 

Definition at line 90 of file chordengine.h.

References base_note.

Referenced by FretBoard::Base(), and FretBoard::FretBoard().

void ChordEngine::calculate  ) 
 

Definition at line 58 of file chordengine.cpp.

References base_note, BREAK, chord_type, fret_pos, frets, i, in, js_L, js_MMM, js_T, js_tunit(), js_vboy(), js_VM, js_Y, js_Z, keys, label_text, MUTED, notename, notes, OPEN, span_size, string, tuning, and variation.

Referenced by FretBoard::refresh().

int ChordEngine::chord  )  [inline]
 

Definition at line 94 of file chordengine.h.

References chord_type.

void ChordEngine::chord int  c  )  [inline]
 

Definition at line 93 of file chordengine.h.

References chord_type, and js_whatchord().

Referenced by FretBoard::Chord(), and FretBoard::FretBoard().

int ChordEngine::finger int  string  ) 
 

Definition at line 54 of file chordengine.cpp.

References string.

Referenced by FretBoard::refresh().

int ChordEngine::fret  )  [inline]
 

Definition at line 97 of file chordengine.h.

References fret_pos.

void ChordEngine::fret int  f  )  [inline]
 

Definition at line 96 of file chordengine.h.

References fret_pos.

Referenced by FretBoard::Fret(), and FretBoard::FretBoard().

void ChordEngine::js_tunit int  t  )  [private]
 

Definition at line 228 of file chordengine.cpp.

References alt_tunings, i, js_MMM, max, and note_indices.

Referenced by calculate(), ChordEngine(), and tune().

void ChordEngine::js_vboy int  v  )  [private]
 

Definition at line 277 of file chordengine.cpp.

References js_L, js_VM, js_Y, and js_Z.

Referenced by calculate(), ChordEngine(), and vary().

void ChordEngine::js_whatchord int  c  )  [private]
 

Definition at line 271 of file chordengine.cpp.

References chordbases, i, and js_T.

Referenced by chord(), and ChordEngine().

const char* ChordEngine::label  )  [inline]
 

Definition at line 111 of file chordengine.h.

References label_text.

Referenced by FretBoard::refresh().

const char* ChordEngine::name int  f  )  [inline]
 

Definition at line 81 of file chordengine.h.

References notename.

Referenced by FretBoard::refresh().

int ChordEngine::noteindex int  f  )  [inline]
 

Definition at line 82 of file chordengine.h.

References MUTED, note_indices, and string.

Referenced by PowerchordBase::audio_cb(), and PowerchordBase::play_chord_cb().

int ChordEngine::span  )  [inline]
 

Definition at line 100 of file chordengine.h.

References span_size.

void ChordEngine::span int  s  )  [inline]
 

Definition at line 99 of file chordengine.h.

References span_size.

Referenced by FretBoard::FretBoard(), and FretBoard::Span().

int ChordEngine::tune  )  [inline]
 

Definition at line 106 of file chordengine.h.

References tuning.

void ChordEngine::tune int  t  )  [inline]
 

Definition at line 105 of file chordengine.h.

References js_tunit(), and tuning.

Referenced by FretBoard::FretBoard(), and FretBoard::Tune().

int ChordEngine::vary  )  [inline]
 

Definition at line 103 of file chordengine.h.

References variation.

void ChordEngine::vary int  v  )  [inline]
 

Definition at line 102 of file chordengine.h.

References js_vboy(), and variation.

Referenced by FretBoard::FretBoard(), and FretBoard::Vary().


Member Data Documentation

const int ChordEngine::alt_tunings [static, private]
 

Initial value:

 {
  {4, 9,2,7,11,4},
  {4,11,4,8,11,4},
  {4, 9,4,9, 1,4},
  {4, 9,2,6,11,4},
  {4, 9,2,7, 0,5},
  {2, 9,2,7, 9,2},
  {2, 7,0,7, 0,2},
  {2, 9,2,6, 9,2},
  {2, 9,2,7,11,4},
  {2, 7,2,7,11,2},
  {2, 9,2,9, 0,2},
  {0, 7,0,7, 9,4},
  {5, 9,2,7,11,4},
  {7,10,2,7,10,2},
}

Definition at line 211 of file chordengine.cpp.

Referenced by js_tunit().

int ChordEngine::base_note [private]
 

Definition at line 37 of file chordengine.h.

Referenced by base(), calculate(), and ChordEngine().

int ChordEngine::chord_type [private]
 

Definition at line 38 of file chordengine.h.

Referenced by calculate(), chord(), and ChordEngine().

const int ChordEngine::chordbases [static, private]
 

Initial value:

 {
  {1,0,0,0,1,0,0,1,0,0,0,0}, 
  {1,0,0,1,0,0,0,1,0,0,0,0}, 
  {1,0,0,0,1,0,0,1,0,0,1,0}, 
  {1,0,0,1,0,0,0,1,0,0,1,0}, 
  {1,0,0,0,1,0,0,1,0,0,0,1}, 
  {1,0,0,0,1,0,0,1,0,1,0,0}, 
  {1,0,0,1,0,0,0,1,0,1,0,0}, 
  {1,0,0,0,1,0,0,0,1,0,0,0}, 
  {1,0,0,1,0,0,1,0,0,1,0,0}, 
  {1,0,0,0,0,1,0,1,0,0,0,0}, 
  {1,0,0,0,0,1,0,1,0,0,1,0}, 
  {1,0,1,0,1,0,0,1,0,0,1,0}, 
  {1,0,1,0,1,0,0,1,0,0,0,0}, 
  {1,0,1,1,0,0,0,1,0,0,1,0}, 
  {1,1,0,0,1,0,0,1,0,0,0,1}, 
  {1,0,1,0,0,0,0,1,0,0,0,0}, 
  {1,0,1,0,0,0,0,1,0,0,1,0}, 
  {1,0,1,0,0,1,0,1,0,0,1,0}, 
  {1,0,1,1,0,1,0,1,0,0,1,0}, 
  {1,0,0,0,1,0,0,1,0,1,1,0}, 
  {1,0,0,1,0,0,0,1,0,1,1,0}, 
  {1,0,0,1,0,0,0,1,0,1,0,1}, 
  {1,0,1,0,1,0,0,1,0,1,0,0}, 
  {1,0,0,0,1,0,1,0,0,0,0,0}, 
  {1,0,0,1,1,0,0,0,0,0,1,0}, 
  {1,0,0,1,0,0,1,0,0,0,1,0}, 
  {1,0,0,0,0,0,0,1,0,0,0,0}, 
}

Definition at line 241 of file chordengine.cpp.

Referenced by js_whatchord().

int ChordEngine::fret_pos [private]
 

Definition at line 39 of file chordengine.h.

Referenced by calculate(), ChordEngine(), and fret().

const char * ChordEngine::frets = {"open", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", 0} [static]
 

Definition at line 288 of file chordengine.cpp.

Referenced by calculate().

int ChordEngine::js_L [private]
 

Definition at line 58 of file chordengine.h.

Referenced by calculate(), and js_vboy().

int ChordEngine::js_MMM[6] [private]
 

Definition at line 49 of file chordengine.h.

Referenced by calculate(), and js_tunit().

int ChordEngine::js_T[12] [private]
 

Definition at line 54 of file chordengine.h.

Referenced by calculate(), and js_whatchord().

int ChordEngine::js_VM [private]
 

Definition at line 58 of file chordengine.h.

Referenced by calculate(), and js_vboy().

int ChordEngine::js_Y [private]
 

Definition at line 58 of file chordengine.h.

Referenced by calculate(), and js_vboy().

int ChordEngine::js_Z [private]
 

Definition at line 58 of file chordengine.h.

Referenced by calculate(), and js_vboy().

const char * ChordEngine::keys = {"maj", "min", "7th", "m7", "maj7", "6th", "m6th", "aug", "dim", "sus4", "7sus4", "9th", "add9", "m9th", "maj9", "sus2", "7sus2", "11th", "m11th", "13th", "m13th", "maj13", "6|9", "flat5", "7#9", "Ø7", "5", 0} [static]
 

Definition at line 286 of file chordengine.cpp.

Referenced by calculate().

char ChordEngine::label_text[20] [private]
 

Definition at line 63 of file chordengine.h.

Referenced by calculate(), ChordEngine(), and label().

const int ChordEngine::MUTED = 7 [static]
 

Definition at line 76 of file chordengine.h.

Referenced by calculate(), and noteindex().

int ChordEngine::note_indices[6] [private]
 

Definition at line 50 of file chordengine.h.

Referenced by js_tunit(), and noteindex().

const char* ChordEngine::notename[6] [private]
 

Definition at line 45 of file chordengine.h.

Referenced by calculate(), and name().

const char * ChordEngine::notes = {"C", "C#", "D", "Eb", "E", "F", "F#", "G", "G#", "A", "Bb", "B", 0} [static]
 

Definition at line 284 of file chordengine.cpp.

Referenced by calculate().

const int ChordEngine::OPEN = 0 [static]
 

Definition at line 75 of file chordengine.h.

Referenced by calculate(), and ChordEngine().

int ChordEngine::span_size [private]
 

Definition at line 40 of file chordengine.h.

Referenced by calculate(), ChordEngine(), and span().

int ChordEngine::string[6] [private]
 

Definition at line 44 of file chordengine.h.

Referenced by calculate(), ChordEngine(), finger(), and noteindex().

int ChordEngine::tuning [private]
 

Definition at line 42 of file chordengine.h.

Referenced by calculate(), ChordEngine(), and tune().

const char * ChordEngine::tunings = {"EADGBE", "EBEG#BE", "EAEAC#E", "EADF#BE", "EADGCF", "DADGAD", "DGCGCD", "DADF#AD", "DADGBE", "DGDGBD", "DADACD", "CGCGAE", "FADGBE", "Gminor",0} [static]
 

Definition at line 292 of file chordengine.cpp.

int ChordEngine::variation [private]
 

Definition at line 41 of file chordengine.h.

Referenced by calculate(), ChordEngine(), and vary().

const char * ChordEngine::variations = {"V1", "V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9", "V10", "V11", "V12", "V13", "V14", "V15", "V16", "V17", "V18", "V19", "V20", "V21", "V22", "V23", 0} [static]
 

Definition at line 290 of file chordengine.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:28:51 2005 for OPIE by  doxygen 1.4.2