flowerkinzy
Nombre de messages : 100 Date d'inscription : 23/09/2009
| Sujet: Piano re-remixé Dim 30 Mai 2010 - 18:38 | |
| Moi-même musicienne, j'ai le plasir de reprendre mon activité de programmation avec cette appli. J'ai pris des idées de Nicolas( Merci) Bon, j'avais prévu de me servir des gammes (c'est pas fini) et de faire plusieurs voix (mais là ça devient impossible) Euh... à mon avis vous allez rien comprendre au code (je suis assez "brouillone") mais bon, J'espère que vous apprécierez... - Code:
-
border_hide 0:full_space 0:color 0,255,255,255 dim i,db$, tps, tp$, note, a$, a2$, j label start, fin, jouergammajeur, jouergammineur, db, tps label note, jtout midi_on
button 1: left 1,(width(0)-75):caption 1,"Quitter" picture 100: top 100,20:left 100, 50: width 100, 673: height 100,100: color 100,0,0,0
For i=185 to 190 picture i: top i,16: left i, 50+((i-185)*112.5): width i, 112.5: height i,4 next i color 185,50,25,0: color 186,100,50,15: color 187,150,75,30 color 188,200,100,45 color 189,250,125,60 color 190,255,150,90
For i=210 to 215 picture i: width i,50: height i, 50 picture (i+8):width i+8,50: height i+8, 10 top i,height(0)-75 top i+8,height(0)-85: color i+8, 0,0,0 left i, 10+(75*(i-210)) left i+8, 10+(75*(i-210)) next i delete 223
tps=4: tp$="noire"
' Supprimer les 3 lignes suivantes si on a les images for i= 210 to 215 color i, 120,120,100 next i
' file_load 210, "ronde.jpg":file_load 211, "blanche.jpg": file_load 212, "noire.jpg":file_load 213, "croche.jpg":file_load 214, "dcroche.jpg" width 215,25: height 215,25: top 215, height(0)-40 ' file_load 215,"point.jpg" check 216: caption 216, "...pointée": left 216, 390: top 216, height(0)-50
Alpha 217: width 217,75: top 217, height(0)-25: left 217,160: font_name 217, "Comic Sans MS":font_size 217,12:caption 217, "Noire"
color 220, 255,0,255
' Notes blanches For i=101 to 183 step 2 picture i:top i,21:left i, 50.5+((i-101)*7.5)+((i-100)/2):width i,15:height i,98: color i,255,255,255 next i ' Notes noires For i=102 to 182 step 2 picture i: width i,8:height i,65:top i,21:left i, 62+((i-102)*8):color i,0,0,0 next i hide 106:hide 114: hide 120: hide 128: hide 134: hide 142: hide 148:hide 156: hide 162: hide 170: hide 176
' Caption note blanche For i=101 to 183 step 14 hint i, "Do" if (i+2)<=183 then hint (i+2), "Ré" if (i+4)<=183 then hint (i+4), "Mi" if (i+6)<=183 then hint (i+6), "Fa" if (i+8)<=183 then hint (i+8), "Sol" if (i+10)<=183 then hint (i+10), "La" if (i+12)<=183 then hint (i+12), "Si"
Next i picture 245: stretch_on 245:height 245,50:top 245,120: left 245, 600: hint 245, "Silences" ' file_load 245, "Pause.jpg" ' Supprimer lorsqu'on a les images color 245,120,120,120 ' Caption note noire
For i=102 to 182 step 2 hint i, "Do#/Réb" if (i+2)<=182 then hint (i+2), "Ré#/Mib" if (i+6)<=183 then hint (i+6), "Fa#/Solb" if (i+8)<=183 then hint (i+8), "Sol#/Lab" if (i+10)<=183 then hint (i+10), "La#/Sib" Next i ' Choix des Gammes container_option 200:width 200,275:height 200,50: left 200,50: top 200,150 option 201: parent 201,200 : top 201,20: caption 201, "Gamme Majeure" option 202: parent 202,200 : top 202,20:left 202,150:caption 202, "Gamme Mineure" list 203: left 203,50: top 203,210: hint 203, "Gamme Majeure" list 204: left 204,200: top 204,210: hint 204, "Gamme mineure"
item_add 203, "Do M" item_add 203, "___( Dièses)______" item_add 203, "Sol M (1#)" item_add 203, "Ré M (2#)" item_add 203, "La M (3#)" item_add 203, "Mi M (4#)" item_add 203, "Si M (5#)" item_add 204, "La m" item_add 204, "___( Dièses)______" item_add 204, "Mi m (1#)" item_add 204, "Si m (2#)" item_add 204, "Fa# m (3#)" item_add 204, "Do# m (4#)" item_add 204, "Sol# m (5#)" item_add 203, "___(Bémols)______" item_add 203, "Fa M (1b)" item_add 203, "Sib M (2b)" item_add 203, "Mib M (3b)" item_add 203, "Lab M (4b)" item_add 203, "Reb M (5b)" item_add 204, "___(Bémols)______" item_add 204, "Re m (1b)" item_add 204, "Sol m (2b)" item_add 204, "Do m (3b)" item_add 204, "Fa m (4b)" item_add 204, "Sib m (5b)" inactive 203: inactive 204 ' Partitions list 240: dlist 241: dlist 242: dlist 243: height 240, 175:top 240, 325:width 240, 150: left 240, 110 list 235:dlist 236: dlist 237: dlist 238: height 235, 175: top 235, 325:width 235, 150 :left 235, 60 list 230:dlist 231: dlist 232: dlist 233: height 230, 175:top 230, 325: width 230, 150:left 230, 10 inactive 235: inactive 240 ' 231 copie de 230:232, note: 233, temps
' Volume scroll_bar 250: left 250,5: top 250, 125 min 250,0: max 250, 127: position 250, 100: hint 250, "Volume"
' Option partition button 255: width 255,125:caption 255, "supprimer une ligne" left 255,275: top 255,390
button 256: width 256,125:caption 256, "Jouer tout" left 256,275: top 256,340 button 257: width 257,125:caption 257, "Supprimer tout" left 257,275: top 257,440 button 258: width 258,125:caption 258, "Enregistrer" left 258,425: top 258,360 button 259: width 259,125:caption 259, "Ouvrir une partition" left 259,425: top 259,410
save_dialog 260: open_dialog 261 filter 260, "Partitions|*.part" filter 261, "Partitions|*.part"
tp$="noire":tps=4 gosub tps
' start... start: wait 5 if clicked(203)=1 then gosub jouergammajeur if clicked(204)=1 then gosub jouergammineur if clicked(201)=1 then active 203: inactive 204 if clicked(202)=1 then active 204: inactive 203 if clicked(210)=1 then tp$="ronde": gosub tps if clicked(211)=1 then tp$="blanche": gosub tps if clicked(212)=1 then tp$="noire": gosub tps if clicked(213)=1 then tp$="croche": gosub tps if clicked(214)=1 then tp$="dcroche": gosub tps if clicked(216)=1 then gosub tps
note=35 for i=101 to 183 If i<>106 If i<>114 If i<>120 If i<>128 If i<>134 If i<>142 If i<>148 If i<>156 If i<>162 If i<>170 If i<>176 note=note+1 if clicked (i)=1 then goto note End_if End_if End_if End_if End_if End_if End_if End_if End_if End_if End_if next i hint 250, "Volume: "+ str$(position(250)) midi_volume position(250) If clicked(255)=1 and item_index(230)>0 item_delete 233, item_index(230) item_delete 232, item_index(230) item_delete 231, item_index(230) item_delete 230, item_index(230) End_if
If clicked(257)=1 If message_confirmation_yes_no ("Supprimer tout?")=1 clear 233: clear 232: clear 231: clear 230 End_if end_if
if clicked(256)=1 then gosub jtout
if clicked(258)=1 i=Message_information_ok ("Tapez un nom supérieur à 1 lettre") a$=file_name$(260) a2$=a$+".part" If a$<>"_" and len(a$)>1 then file_save 230, a2$ a2$=a$+"note.txt" file_save 232, a2$ a2$=a$+"tps.txt" file_save 233, a2$ End_if
if clicked(259)=1 i=Message_information_yes_no ("Cette action supprimera la partition existante. Continuer?") a$=file_name$(261) : message a$ clear 233: clear 232: clear 231: clear 230 if a$<>"_" file_load 230, a$ file_load 231, a$ i=len(a$)-5 a2$=left$(a$,i)+"note.txt" file_load 232, a2$ a2$=left$(a$,i)+"tps.txt" file_load 233, a2$ end_if
End_if ' Sortie if clicked(1)=1 goto fin end_if goto start end
'Début labels
jouergammajeur: If item_index(203)= 1 db$="" gosub db midi_play 60,8: midi_play 62,8: midi_play 64,8: midi_play 65,8 midi_play 67,8: midi_play 69,8: midi_play 71,8: midi_play 72,8 end_if If item_index(203)= 3 db$="d" gosub db midi_play 55,8: midi_play 57,8: midi_play 59,8: midi_play 60,8 midi_play 62,8: midi_play 64,8: midi_play 66,8: midi_play 67,8 end_if If item_index(203)= 4 db$="d" gosub db midi_play 62,8: midi_play 64,8: midi_play 66,8: midi_play 67,8 midi_play 69,8: midi_play 71,8: midi_play 73,8: midi_play 74,8 end_if If item_index(203)= 5 db$="d" gosub db midi_play 57,8: midi_play 59,8: midi_play 61,8: midi_play 62,8 midi_play 64,8: midi_play 66,8: midi_play 68,8: midi_play 69,8 end_if If item_index(203)= 6 db$="d" gosub db midi_play 64,8: midi_play 66,8: midi_play 68,8: midi_play 69,8 midi_play 71,8: midi_play 73,8: midi_play 75,8: midi_play 76,8 end_if If item_index(203)= 7 db$="d" gosub db midi_play 59,8: midi_play 61,8: midi_play 63,8: midi_play 64,8 midi_play 66,8: midi_play 68,8: midi_play 70,8: midi_play 71,8 end_if If item_index(203)= 9 db$="b" gosub db midi_play 65,8: midi_play 67,8: midi_play 69,8: midi_play 70,8 midi_play 72,8: midi_play 74,8: midi_play 76,8: midi_play 77,8 end_if If item_index(203)= 10 db$="b" gosub db midi_play 58,8: midi_play 60,8: midi_play 62,8: midi_play 63,8 midi_play 65,8: midi_play 67,8: midi_play 69,8: midi_play 70,8 end_if If item_index(203)= 11 db$="b" gosub db midi_play 63,8: midi_play 65,8: midi_play 67,8: midi_play 68,8 midi_play 70,8: midi_play 72,8: midi_play 74,8: midi_play 75,8 end_if If item_index(203)= 12 db$="b" gosub db midi_play 56,8: midi_play 58,8: midi_play 60,8: midi_play 61,8 midi_play 63,8: midi_play 65,8: midi_play 67,8: midi_play 68,8 end_if If item_index(203)= 13 db$="b" gosub db midi_play 61,8: midi_play 63,8: midi_play 65,8: midi_play 66,8 midi_play 68,8: midi_play 70,8: midi_play 72,8: midi_play 73,8 end_if
return
jouergammineur: If item_index(204)= 1 db$="d" gosub db midi_play 57,8: midi_play 59,8: midi_play 60,8: midi_play 62,8 midi_play 64,8: midi_play 65,8: midi_play 68,8: midi_play 69,8 end_if If item_index(204)= 3 db$="d" gosub db midi_play 64,8: midi_play 66,8: midi_play 67,8: midi_play 69,8 midi_play 71,8: midi_play 72,8: midi_play 75,8: midi_play 76,8 end_if If item_index(204)= 4 db$="d" gosub db midi_play 59,8: midi_play 61,8: midi_play 62,8: midi_play 64,8 midi_play 66,8: midi_play 67,8: midi_play 70,8: midi_play 71,8 end_if If item_index(204)= 5 db$="d" gosub db midi_play 66,8: midi_play 68,8: midi_play 69,8: midi_play 71,8 midi_play 73,8: midi_play 74,8: midi_play 77,8: midi_play 78,8 end_if If item_index(204)= 6 db$="d" gosub db midi_play 61,8: midi_play 63,8: midi_play 64,8: midi_play 66,8 midi_play 68,8: midi_play 69,8: midi_play 72,8: midi_play 73,8 end_if If item_index(204)= 7 db$="d" gosub db midi_play 56,8: midi_play 58,8: midi_play 59,8: midi_play 61,8 midi_play 63,8: midi_play 64,8: midi_play 67,8: midi_play 68,8 end_if
return
db: For i=102 to 182 step 2 hint i, "Do#/Réb" if (i+2)<=182 then hint (i+2), "Ré#/Mib" if (i+6)<=183 then hint (i+6), "Fa#/Solb" if (i+8)<=183 then hint (i+8), "Sol#/Lab" if (i+10)<=183 then hint (i+10), "La#/Sib" Next i
If db$="d" For i=102 to 182 step 14 hint i, "Do#" if (i+2)<=182 then hint (i+2), "Ré#" if (i+6)<=183 then hint (i+6), "Fa#" if (i+8)<=183 then hint (i+8), "Sol#" if (i+10)<=183 then hint (i+10), "La#" Next i end_if If db$="b" For i=102 to 182 step 14 hint i, "Réb" if (i+2)<=182 then hint (i+2), "Mib" if (i+6)<=183 then hint (i+6), "Solb" if (i+8)<=183 then hint (i+8), "Lab" if (i+10)<=183 then hint (i+10), "Sib" Next i end_if return
tps: For i=218 to 222 color i, 0,0,0 next i If tp$="ronde" then tps=2 : color 218, 255,0,255: left 217, 10 If tp$="blanche" then tps=4: color 219, 255,0,255: left 217, 85 If tp$="noire" then tps=6 : color 220, 255,0,255: left 217, 160
If tp$="croche" then tps=8 : color 221, 255,0,255: left 217, 235 If tp$="dcroche" then tps=10 : color 222, 255,0,255: left 217, 310 caption 217, tp$ If checked (216)= 1 then tps=tps+1: caption 217, tp$ +" pointée" return
note: inactive 0 j=0 For i=36 to 96 step 12 j=j+1 if note= i then a2$= "Do"+" ("+str$(j)+")" if note= (i+2) then a2$= "Ré"+" ("+str$(j)+")" if note= (i+4) then a2$= "Mi"+" ("+str$(j)+")" if note= (i+5) then a2$= "Fa"+" ("+str$(j)+")" if note= (i+7) then a2$= "Sol"+" ("+str$(j)+")" if note= (i+9) then a2$= "La"+" ("+str$(j)+")" if note= (i+11) then a2$= "Si"+" ("+str$(j)+")"
Next i active 0
a$= a2$+" "+caption$(217): item_add 230, a$ item_add 231,a$ item_add 232, note item_add 233, tps midi_play note, tps
goto start
jtout: j=count(230): If i<1 then return inactive 0 For i= 1 to j midi_play item_read$(232,i),item_read$(233,i) next i active 0 return
fin: midi_off terminate end
| |
|