11procedure NoteTuneLoop ();
22var
3- _pos,notePos,noteShift,noteVal,noteKey:byte;
3+ _pos,notePos,noteShift,noteVal,noteKey,noteOct :byte;
44
55begin
66 notePos:=0 ; _pos:=0 ;
7- noteShift :=currentOct* 12 ;
7+ noteOct :=currentOct;
88 definedNoteTune:=pointer(NOTE_TABLE_ADDR+currentNoteTableOfs);
99
1010 reset_pianoVis();
11- updateNoteTune(noteShift );
11+ updateNoteTune(noteOct );
1212 colorVLine(tuneBarsPos+notePos,0 ,5 ,3 );
1313 screen2video();
1414 repeat
@@ -18,33 +18,28 @@ begin
1818 key_ESC: break;
1919 end ;
2020
21- if controlSelectionKeys(key,key_Left,key_Right,_pos,0 ,63 ) then
22- begin
23- noteShift:=(_pos div 12 )*12 ;
24- notePos:=_pos mod 12 ;
25- end
26- else
21+ if not controlSelectionKeys(key,key_Left,key_Right,_pos,0 ,63 ) then
2722 begin
2823 noteKey:=pianoKeyScan(0 );
2924 if noteKey<>255 then
30- begin
3125 _pos:=noteKey;
32- noteShift:=(_pos div 12 )*12 ;
33- notePos:=_pos mod 12 ;
34- end ;
3526 end ;
3627
28+ noteOct:=_pos div 12 ;
29+ noteShift:=octShift[noteOct];
30+ notePos:=_pos mod 12 ;
31+
3732 noteVal:=definedNoteTune[_pos];
3833 if controlSelectionKeys(key,key_Up,key_Down,noteVal,0 ,255 ) then
3934 definedNoteTune[_pos]:=noteVal;
4035
41- updateNoteTune(noteShift );
36+ updateNoteTune(noteOct );
4237 colorVLine(tuneBarsPos+notePos,0 ,5 ,3 );
4338 screen2video();
4439 end ;
4540 updatePianoVis();
4641 until false;
47- updateNoteTune(noteShift );
42+ updateNoteTune(noteOct );
4843 SFX_Off();
4944 reset_pianoVis();
5045end ;
0 commit comments