[squeak-dev] AbstractSound 2 MIDI?

Squeak List squeaklist at yahoo.com
Sat Mar 6 09:47:07 UTC 2010

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...?


delightful workspace code:

s_PluckedSound new "FMSound clarinet2"  .
m_MixedSound new.    
notes_#(0 1 9 4 5 8)  .
pedal_#(1 2 1 3 1 4 1 5 1 6 6 5 6 4 6 3 6 2 6 1).

st_ReadStream  on:pedal.

oc_OrderedCollection new.

dur_0.1. "0625."

d_Dictionary new.
d at:0 put:'c'; 
at:1 put:'c#';
at:2 put:'d';
at:3 put:'d#';
at:4 put:'e';
at:5 put:'f';
at:6 put:'f#';
at:7 put:'g';
at:8 put:'g#';
at:9 put:'a';
at:10 put:'a#';
at:11 put:'b'.

[st atEnd]whileFalse:
[oc add:(Array with:((d at:((notes at:st next))),octave)with:dur with:vol)].
anArray_oc asArray.

m    add: (AbstractSound noteSequenceOn: s 
        from: anArray ).
m play


i just want to turn THAT into a standard MIDI file... but if there were more "voices" added to the MixedSound, they should also work/show up :)

At this point, all i really care about is that the MIDI file produced would just convey the note, octave, duration, and volume information - nothing fancy (no extra/spiffy controllers)... i don't even care what "instrument" the midi file uses (except DRUMS) - as long as it just contains the correct note info :)

The goal? To see the notation in a program like Finale, MuseScore, or anything (that runs on Windows) that will show the notes as a music score.

I have looked into Siren and Musical Objects for Squeak, but did not find this feature - or at least no way for me to make sense of how to do it...  it probably is in there somewhere, but it seems that Siren at least has moved on to VW for the most part... also, MIDIFileReader is kinda the opposite of what i am looking for:

does not work :)

i am kinda interested in seeing "standard" musical notation in Squeak, but that is entirely beyond my time and ability right now... 


and finally: i am in the Seattle area and remembering the meetings i went to of:

Puget Sound Smalltalk and Object-Oriented Database User Group

yeah, that looks grim :(

yet how great it was to discuss this squeak thing with brilliant folks in person... 





More information about the Squeak-dev mailing list