Déclarer dr%,du%,dd%
Déclarer t%[127],i%[12],pu%,pd%,iu%,id%,sk%
Var okt%=3
Var instr%=1
i%[1]=0
i%[2]=6
i%[3]=14
i%[4]=18
i%[5]=19
i%[6]=42
i%[7]=43
i%[8]=48
i%[9]=56
i%[10]=58
i%[11]=62
i%[12]=71
Proc Tasten
Paramètres x%,y%,l%,t$,c%
UseBrush 1,c%
USEP 0,1,0
WhileLoop 1,len(t $)
Si substr$(t$,&loop)>" "
Rectangle % X, y%-x%+50,y%+l%
DrawText x%+20,y%+L%-30,substr$(t$,&loop)
EndIf
x%=x%+56
Endwhile
ENDPROC
Proc TonEin
Paramètres Ton%
Si non t%[Ton%]
Si dr%
Play 0;0;0;Ton%,0,0
D'autre
Play Ton%,0,0
EndIf
t%[Ton%]=1
EndIf
ENDPROC
Proc TonAus
Paramètres Ton%
Casenote dr% : Play -Ton%,0,0
t%[Ton%]=0
ENDPROC
Proc Testkey
Paramètres k%, t%
Si isKey(k%)
TonEin(12*okt%+t%)
D'autre
TonAus(12*okt%+t%)
EndIf
ENDPROC
Proc instrument
Paramètres dans%
instr% = dans%
Display
Play i%[instr%],-1,0
ENDPROC
Proc Display
UseBrush 1,$FFFF00
USEP 0,1,0
Rectangle 320,10-620,140
Couleur du texte 0,-1
DrawText 330,15,"Oktave: " + Str$(okt%)
DrawText 330,35,"Instrument F" + str$(instr%) + ": "+ Str$(i%[instr%])
DrawText 330,55,"Drumpad-Modus: " + si(dr%=1,"EIN","AUS")
ENDPROC
Titre de la fenêtre "RGHs Mini-Keyboard V2"
Fenêtre Style 16
cls $3030
Couleur du texte $8080,-1
Tasten(0,310,140,"<YXCVBNM,.-",$FFFFFF)
Tasten(16,150,140,"QWERTZUIOPÜ",$FFFFFF)
Tasten(28,310,100,"ASD GH KLÖ",$2020)
Tasten(44,150,100,"23 567 90",$2020)
DrawText 10,10,"ESC = Ende"
DrawText 10,30,"Bild hoch / Bild runter = octave ändern"
DrawText 10,50,"F1 - F12 = instrument auswählen"
DrawText 10,70,"Pos1 / Ende = aktuelles instrument ändern"
DrawText 10,90,"Einfg = Drumpad-Modus un/aus"
Display
Play i%[instr%],-1,0
SetTimer 10
Tandis que 1
Waitinput
Si getFocus(%hWnd)
Cas isKey(27) : Pause
TestKey(226,5)
TestKey(ord("A"),6)
TestKey(ord("Y"),7)
TestKey(ord("S"),8)
TestKey(ord("X"),9)
TestKey(ord("D"),10)
TestKey(ord("C"),11)
TestKey(ord("V"),12)
TestKey(ord("G"),13)
TestKey(ord("B"),14)
TestKey(ord("H"),15)
TestKey(ord("N"),16)
TestKey(ord("M"),17)
TestKey(ord("K"),18)
TestKey(188,19)
TestKey(ord("L"),20)
TestKey(190,21)
TestKey(192,22)
TestKey(189,23)
TestKey(ord("Q"),24)
TestKey(ord("2"),25)
TestKey(ord("W"),26)
TestKey(ord("3"),27)
TestKey(ord("E"),28)
TestKey(ord("R"),29)
TestKey(ord("5"),30)
TestKey(ord("T"),31)
TestKey(ord("6"),32)
TestKey(ord("Z"),33)
TestKey(ord("7"),34)
TestKey(ord("U"),35)
TestKey(ord("I"),36)
TestKey(ord("9"),37)
TestKey(ord("O"),38)
TestKey(ord("0"),39)
TestKey(ord("P"),40)
TestKey(186,41)
Cas isKey(112) : instrument(1)
Cas isKey(113) : instrument(2)
Cas isKey(114) : instrument(3)
Cas isKey(115) : instrument(4)
Cas isKey(116) : instrument(5)
Cas isKey(117) : instrument(6)
Cas isKey(118) : instrument(7)
Cas isKey(119) : instrument(8)
Cas isKey(120) : instrument(9)
Cas isKey(121) : instrument(10)
Cas isKey(122) : instrument(11)
Cas isKey(123) : instrument(12)
Si isKey(45) and (du% = 0)
du% = 1
dr% = 1 - dr%
Display
D'autre
Casenote Iskey(45) : du% = 0
EndIf
Si isKey(33) and (pu% = 0)
pu% = 1
cas okt% < 7 : inc okt%
Display
D'autre
Casenote Iskey(33) : pu% = 0
EndIf
Si isKey(34) and (pd% = 0)
pd% = 1
Cas okt% > 0 : dec okt%
Display
D'autre
Casenote Iskey(34) : pd% = 0
EndIf
Si isKey(36) and (iu% = 0)
iu% = 1
cas i%[instr%] < 127 : i%[instr%] = i%[instr%] + 1
instrument(instr%)
D'autre
Casenote Iskey(36) : iu% = 0
EndIf
Si isKey(35) and (id% = 0)
id% = 1
cas i%[instr%] > 0 : i%[instr%] = i%[instr%] - 1
instrument(instr%)
D'autre
Casenote Iskey(35) : id% = 0
EndIf
Endif
Endwhile
Fin