SuperStrict Graphics 600,400 SetColor 255,255,255 ' the table: Global Chord:String[10] ' chord note lines definition: 0=C, 1=D, 2=E, 3=F, 4=G, 5=A, 6=H ' # means "has a sharp", b means "has a flat" Chord[0]="Cm =0 |2b|4 " Chord[1]="Bb =6b|1 |3 " Chord[2]="F#7=3#|5 |0#|2 " ' the current chord defintion: Global CurrChord:String Find("Cm") Repeat Cls If KeyHit(KEY_C) Then Find("Cm") If KeyHit(KEY_B) Then Find("Bb") If KeyHit(KEY_F) Then Find("F#7") DrawText "Press for Cm-chord, for Bb-Major-chord or for F#7-chord", 30,50 'the 5 note lines: For Local i:Int=1 To 5 DrawRect 100,200+i*20,300,1 Next DrawActChord Flip 1 Until AppTerminate() Function Find(Chordname:String) ' scans the table and return the chord definition For Local a:String=EachIn Chord Local middle:Int=Instr(a,"=") Local key:String=Trim(Left(a,middle-1)) Print "scan table..." + key If key = Chordname CurrChord=Mid(a,middle+1,-1) Print "found definition: " + CurrChord Return EndIf Next End Function Function DrawActChord() ' paints the notes depending on the current definition 'splits the defintion in the single notes: Local notes:String[]=CurrChord.Split("|") Local lastpos:Int ' cares about octave shifting For Local a:String= EachIn notes Local pos:Int= a.ToInt ' cares about octave shifting If pos