[squeak-dev] AbstractSound 2 MIDI?

Stéphane Rollandin lecteur at zogotounga.net
Sat Mar 6 10:19:18 UTC 2010


Le 06/03/2010 10:47, Squeak List a écrit :
> Hello all,
>
> Wondering if there is something i have overlooked that would enable me to turn this sort of stuff:
>
> #(#('c5' 0.1 300) #('c#5' 0.1 300) #('c5' 0.1 300) #('a5' 0.1 300) #('c5' 0.1 300) #('e5' 0.1 300) #('c5' 0.1 300) #('f5' 0.1 300) #('c5' 0.1 300) #('g#5' 0.1 300) #('g#5' 0.1 300) #('f5' 0.1 300) #('g#5' 0.1 300) #('e5' 0.1 300) #('g#5' 0.1 300) #('a5' 0.1 300) #('g#5' 0.1 300) #('c#5' 0.1 300) #('g#5' 0.1 300) #('c5' 0.1 300))
>
> into a standard MIDI file...?

in muO (Musical Objects for Squeak)), there would be some (simple) 
programming involved to convert your format for notes, but if you don't 
mind using muO's own format the code would be:

'co5d19v120,c+,c,a,c,e,c,f,c,g+,g+,f,g+,e,g+,a,g+,c+,g+,c' kmusic 
asMIDIFileNamed: 'mynotes.mid'

here d19 is the duration (0.1 second, but expressed in clicks with 96 
clicks/seconds) and v120 is the midi volume.



Stef





More information about the Squeak-dev mailing list