I want to be able to write MIDI data back to a .mid file from Squeak. Presently I have some pages in other tabs with documentation on the MIDI file format, but I'd rather not reinvent any wheels that I don't need to. I see that there's a class MIDIFileReader, but no matching writer class. I don't see any methods for exporting the data to disk.
Any idea how I might write MIDI data back out to the disk in Squeak?
-- Casey Ransberger |
I just decided to attach the file: MIDIFileWriter.st since http://wiki.squeak.org/squeak/1406 doesn't seem so stable.... ken there is more info, which i will dig up in a bit. in particular, Mu0 does this well with the stuff i will dig up. possibly you will hear something from that camp before i even write back :) also, it does work in 4.1 on windows vista 32. From: Casey Ransberger <[hidden email]> To: The general-purpose Squeak developers list <[hidden email]> Sent: Mon, May 3, 2010 9:30:23 PM Subject: [squeak-dev] Writing a MIDI file? I want to be able to write MIDI data back to a .mid file from Squeak. Presently I have some pages in other tabs with documentation on the MIDI file format, but I'd rather not reinvent any wheels that I don't need to. I see that there's a class MIDIFileReader, but no matching writer class. I don't see any methods for exporting the data to disk. Any idea how I might write MIDI data back out to the disk in Squeak?
-- Casey Ransberger MIDIFileWriter.st (12K) Download Attachment |
> there is more info, which i will dig up in a bit. in particular, Mu0
> does this well with the stuff i will dig up. possibly you will hear > something from that camp before i even write back :) You fired first :) So yes, MIDIFileWriter will convert a MIDIScore into a MIDI file. It should belong to the base image IMO, since we already have the MIDIFileReader. MuO is a full-fledged musical composition environment and provide its own representation of MIDI-like data. Stef |
actually,
the class comment for MIDIFileWriter actually works - not very extensive, but is nearly infinitely more useful/interesting than NO comment :) an example of helpful documentation, and cheers indeed for code created around 10 ago...AND still working in 4.1 update:10112 !!! thank you Lushi (AKA Yisrael Lowenstein). my original MIDI interest was to be able to convert "scores" with the same/similar format found in the AbstractSound bachFugue examples: to create a MIDI file from scratch - not exactly like the MIDIFileWriter example... Stéphane pointed out a way to do that in his Mu0 environment... and i am working on my own version fine-tuned to what i want to do in the way that makes most sense to me in the environment which i am creating :) i also agree that it (Class MIDIFileWriter) should be in the base image, if possible. ken PS: this brief sort of documentation is very helpful to me. a great example imo is the class comment for: KeyboardMorphForInput. KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... i do not know who goes by the initials of 'nice' - but whoever it is did a rather decent job. actually extremely well done imo... and hopefully "someone" could tell me how to search the image for commentStamps created by 'nice'... that would be.... ----- Original Message ---- From: Stéphane Rollandin <[hidden email]> To: The general-purpose Squeak developers list <[hidden email]> Sent: Tue, May 4, 2010 12:37:49 AM Subject: Re: [squeak-dev] Writing a MIDI file? > there is more info, which i will dig up in a bit. in particular, Mu0 > does this well with the stuff i will dig up. possibly you will hear > something from that camp before i even write back :) You fired first :) So yes, MIDIFileWriter will convert a MIDIScore into a MIDI file. It should belong to the base image IMO, since we already have the MIDIFileReader. MuO is a full-fledged musical composition environment and provide its own representation of MIDI-like data. Stef |
On 5/4/10, Squeak List <[hidden email]> wrote:
> actually, > > the class comment for MIDIFileWriter actually works - not very extensive, > but is nearly infinitely more useful/interesting than NO comment :) an > example of helpful documentation, +1 and cheers indeed for code created around > 10 ago...AND still working in 4.1 update:10112 !!! > > thank you Lushi (AKA Yisrael Lowenstein). > > my original MIDI interest was to be able to convert "scores" with the > same/similar format found in the AbstractSound bachFugue examples: to create > a MIDI file from scratch - not exactly like the MIDIFileWriter example... > > Stéphane pointed out a way to do that in his Mu0 environment... and i am > working on my own version fine-tuned to what i want to do in the way that > makes most sense to me in the environment which i am creating :) > > i also agree that it (Class MIDIFileWriter) should be in the base image, if > possible. or than easily accessible as something like SoundAddons on Squeaksource together with a reference in the 'Extending the System' workspace. > ken > > > PS: this brief sort of documentation is very helpful to me. > > a great example imo is the class comment for: KeyboardMorphForInput. > > KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... > > i do not know who goes by the initials of 'nice' - but whoever it is did a > rather decent job. actually extremely well done imo... > and hopefully "someone" could tell me how to search the image for > commentStamps created by 'nice'... that would be.... > --Hannes |
In reply to this post by Squeak List
> i am working on my own version fine-tuned to what i want to do in the way that makes most sense to me in the environment which i am creating :)
Any pointer about your environment main principles ? Cheers, Stef |
In reply to this post by Hannes Hirzel
2010/5/4 Hannes Hirzel <[hidden email]>:
> On 5/4/10, Squeak List <[hidden email]> wrote: >> actually, >> >> the class comment for MIDIFileWriter actually works - not very extensive, >> but is nearly infinitely more useful/interesting than NO comment :) an >> example of helpful documentation, > +1 > > and cheers indeed for code created around >> 10 ago...AND still working in 4.1 update:10112 !!! >> >> thank you Lushi (AKA Yisrael Lowenstein). >> >> my original MIDI interest was to be able to convert "scores" with the >> same/similar format found in the AbstractSound bachFugue examples: to create >> a MIDI file from scratch - not exactly like the MIDIFileWriter example... >> >> Stéphane pointed out a way to do that in his Mu0 environment... and i am >> working on my own version fine-tuned to what i want to do in the way that >> makes most sense to me in the environment which i am creating :) >> >> i also agree that it (Class MIDIFileWriter) should be in the base image, if >> possible. > +1 > or than easily accessible as something like SoundAddons on > Squeaksource together with a reference in the 'Extending the System' > workspace. > >> ken >> >> >> PS: this brief sort of documentation is very helpful to me. >> >> a great example imo is the class comment for: KeyboardMorphForInput. >> >> KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... >> >> i do not know who goes by the initials of 'nice' - but whoever it is did a >> rather decent job. actually extremely well done imo... >> and hopefully "someone" could tell me how to search the image for >> commentStamps created by 'nice'... that would be.... >> > Nice = Nicolas Cellier > > --Hannes > > But I didn't write the comment, just replaced _ with := Nicolas |
Regarding the KeyboardMorphForInput - I can enter the scores for the
first instrument (red scores) but how do I do it for the second (green scores). The answer to this question would result in an update to the comment of class KeyboardMorphForInput. --Hannes On 5/4/10, Nicolas Cellier <[hidden email]> wrote: > 2010/5/4 Hannes Hirzel <[hidden email]>: >> On 5/4/10, Squeak List <[hidden email]> wrote: >>> actually, >>> >>> the class comment for MIDIFileWriter actually works - not very extensive, >>> but is nearly infinitely more useful/interesting than NO comment :) an >>> example of helpful documentation, >> +1 >> >> and cheers indeed for code created around >>> 10 ago...AND still working in 4.1 update:10112 !!! >>> >>> thank you Lushi (AKA Yisrael Lowenstein). >>> >>> my original MIDI interest was to be able to convert "scores" with the >>> same/similar format found in the AbstractSound bachFugue examples: to >>> create >>> a MIDI file from scratch - not exactly like the MIDIFileWriter example... >>> >>> Stéphane pointed out a way to do that in his Mu0 environment... and i am >>> working on my own version fine-tuned to what i want to do in the way that >>> makes most sense to me in the environment which i am creating :) >>> >>> i also agree that it (Class MIDIFileWriter) should be in the base image, >>> if >>> possible. >> +1 >> or than easily accessible as something like SoundAddons on >> Squeaksource together with a reference in the 'Extending the System' >> workspace. >> >>> ken >>> >>> >>> PS: this brief sort of documentation is very helpful to me. >>> >>> a great example imo is the class comment for: KeyboardMorphForInput. >>> >>> KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... >>> >>> i do not know who goes by the initials of 'nice' - but whoever it is did >>> a >>> rather decent job. actually extremely well done imo... >>> and hopefully "someone" could tell me how to search the image for >>> commentStamps created by 'nice'... that would be.... >>> >> Nice = Nicolas Cellier >> >> --Hannes >> >> > > But I didn't write the comment, just replaced _ with := > > Nicolas > > |
in the ScorePlayerMorph that opens, there are 3 instruments/tracks which each have their own volume and panning controls. on my system: the SLIDERS controlling volume and panning are: instrument 1 is red, instrument 2 is green, and instrument 3 has blue sliders... (RGB, nice)...
1 - do whatever you want with the keyboard when it opens - deliberate or random. 2 - the notes/representation which show up in the PianoScrollMorph are the same color as (what i would call the activated recording channel) the sliders mentioned above. 3 - on my system, the red notes appear 1st on the PianoRoll... 4 - then, in the ScorePlayerMorph, if you MUTE instruments 1 and 3, the piano roll is empty again, and what you do next with the keyboard will appear on the piano roll in its corresponding color (green notes now)... 5 - mute instruments 1 and 2, and do what you must with the keyboard again: blue notes this time. 6 - "UN-MUTE" (turn off mute) all of the instruments/tracks to see them all in the piano roll. all 3 colors/tracks/instruments now appear in the piano roll. 7 - mute and "un-mute" in ScorePlayerMorph to see what each track/instrument is doing in the piano roll. a decent place 2 begin :) now if "save as midi file" was added to the "saving" options :) ken ----- Original Message ---- From: Hannes Hirzel <[hidden email]> To: The general-purpose Squeak developers list <[hidden email]> Sent: Tue, May 4, 2010 10:37:33 AM Subject: Re: [squeak-dev] Writing a MIDI file? Regarding the KeyboardMorphForInput - I can enter the scores for the first instrument (red scores) but how do I do it for the second (green scores). The answer to this question would result in an update to the comment of class KeyboardMorphForInput. --Hannes On 5/4/10, Nicolas Cellier <[hidden email]> wrote: > 2010/5/4 Hannes Hirzel <[hidden email]>: >> On 5/4/10, Squeak List <[hidden email]> wrote: >>> actually, >>> >>> the class comment for MIDIFileWriter actually works - not very extensive, >>> but is nearly infinitely more useful/interesting than NO comment :) an >>> example of helpful documentation, >> +1 >> >> and cheers indeed for code created around >>> 10 ago...AND still working in 4.1 update:10112 !!! >>> >>> thank you Lushi (AKA Yisrael Lowenstein). >>> >>> my original MIDI interest was to be able to convert "scores" with the >>> same/similar format found in the AbstractSound bachFugue examples: to >>> create >>> a MIDI file from scratch - not exactly like the MIDIFileWriter example... >>> >>> Stéphane pointed out a way to do that in his Mu0 environment... and i am >>> working on my own version fine-tuned to what i want to do in the way that >>> makes most sense to me in the environment which i am creating :) >>> >>> i also agree that it (Class MIDIFileWriter) should be in the base image, >>> if >>> possible. >> +1 >> or than easily accessible as something like SoundAddons on >> Squeaksource together with a reference in the 'Extending the System' >> workspace. >> >>> ken >>> >>> >>> PS: this brief sort of documentation is very helpful to me. >>> >>> a great example imo is the class comment for: KeyboardMorphForInput. >>> >>> KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... >>> >>> i do not know who goes by the initials of 'nice' - but whoever it is did >>> a >>> rather decent job. actually extremely well done imo... >>> and hopefully "someone" could tell me how to search the image for >>> commentStamps created by 'nice'... that would be.... >>> >> Nice = Nicolas Cellier >> >> --Hannes >> >> > > But I didn't write the comment, just replaced _ with := > > Nicolas > > |
In reply to this post by Nicolas Cellier
Nicolas,
thanks for clarifying :) --- --- --- and for anyone, just looking at: KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... i would "guess" that there were 0/ZERO "prior" comments - as in: this is the 1st comment, since there were ZERO prior... but that is obviously incorrect? here is what i am still hoping for: someone will at least give a useful "hint" at how to search for anything which has a particular "initial/author stamp" - class comments and examples in particular. if i find that someone made a helpful comment in 1 place, i imagine/hope that the same person has made other similarly helpful comments elsewhere in the system. which may or may not be, but i would at least like to know of a simple way to look through the results of such a search ... is this sort of search something which does not exist? Thanks, ken ----- Original Message ---- From: Nicolas Cellier <[hidden email]> To: The general-purpose Squeak developers list <[hidden email]> Sent: Tue, May 4, 2010 10:18:45 AM Subject: Re: [squeak-dev] Writing a MIDI file? 2010/5/4 Hannes Hirzel <[hidden email]>: > On 5/4/10, Squeak List <[hidden email]> wrote: >> actually, >> >> the class comment for MIDIFileWriter actually works - not very extensive, >> but is nearly infinitely more useful/interesting than NO comment :) an >> example of helpful documentation, > +1 > > and cheers indeed for code created around >> 10 ago...AND still working in 4.1 update:10112 !!! >> >> thank you Lushi (AKA Yisrael Lowenstein). >> >> my original MIDI interest was to be able to convert "scores" with the >> same/similar format found in the AbstractSound bachFugue examples: to create >> a MIDI file from scratch - not exactly like the MIDIFileWriter example... >> >> Stéphane pointed out a way to do that in his Mu0 environment... and i am >> working on my own version fine-tuned to what i want to do in the way that >> makes most sense to me in the environment which i am creating :) >> >> i also agree that it (Class MIDIFileWriter) should be in the base image, if >> possible. > +1 > or than easily accessible as something like SoundAddons on > Squeaksource together with a reference in the 'Extending the System' > workspace. > >> ken >> >> >> PS: this brief sort of documentation is very helpful to me. >> >> a great example imo is the class comment for: KeyboardMorphForInput. >> >> KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... >> >> i do not know who goes by the initials of 'nice' - but whoever it is did a >> rather decent job. actually extremely well done imo... >> and hopefully "someone" could tell me how to search the image for >> commentStamps created by 'nice'... that would be.... >> > Nice = Nicolas Cellier > > --Hannes > > But I didn't write the comment, just replaced _ with := Nicolas |
In reply to this post by Stéphane Rollandin
Stéphane,
which principles are you asking about? : 1) principles specific to the music itself which i am most interested in and involved with: which goes on no matter how #2 pans out? or 2) principles specific to making a useful/meaningful/helpful computer program that makes such effort worth while (meaning that it does exactly what "i" want it to)... in that particular area/environment (Computer programming)? or 3) something else... ken ----- Original Message ---- From: Stéphane Rollandin <[hidden email]> To: The general-purpose Squeak developers list <[hidden email]> Sent: Tue, May 4, 2010 5:06:52 AM Subject: Re: [squeak-dev] Writing a MIDI file? > i am working on my own version fine-tuned to what i want to do in the way that makes most sense to me in the environment which i am creating :) Any pointer about your environment main principles ? Cheers, Stef |
> 1) principles specific to the music itself which i am most interested in and involved with: which goes on no matter how #2 pans out?
> > or > > 2) principles specific to making a useful/meaningful/helpful computer > program that makes such effort worth while (meaning that it does exactly > what "i" want it to)... in that particular area/environment (Computer > programming)? Both I guess... although 1) may be a somewhat off-topic in Squeak-dev, while 2) would be food for thought for everyone doing computer-music and so more appropriate here. best, Stef |
In reply to this post by Squeak List
2010/5/5 Squeak List <[hidden email]>:
> Nicolas, > > thanks for clarifying :) > > --- --- --- > > and for anyone, > > just looking at: KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... > > i would "guess" that there were 0/ZERO "prior" comments - as in: this is the 1st comment, since there were ZERO prior... but that is obviously incorrect? > > here is what i am still hoping for: someone will at least give a useful "hint" at how to search for anything which has a particular "initial/author stamp" - class comments and examples in particular. > > if i find that someone made a helpful comment in 1 place, i imagine/hope that the same person has made other similarly helpful comments elsewhere in the system. which may or may not be, but i would at least like to know of a simple way to look through the results of such a search ... is this sort of search something which does not exist? > > > > Thanks, > > ken > > It's possible I used a tool for replacing which bypassed prior registration... Like filing out, replacing, filing in... Can't remember Nicolas > > > > > ----- Original Message ---- > From: Nicolas Cellier <[hidden email]> > To: The general-purpose Squeak developers list <[hidden email]> > Sent: Tue, May 4, 2010 10:18:45 AM > Subject: Re: [squeak-dev] Writing a MIDI file? > > 2010/5/4 Hannes Hirzel <[hidden email]>: >> On 5/4/10, Squeak List <[hidden email]> wrote: >>> actually, >>> >>> the class comment for MIDIFileWriter actually works - not very extensive, >>> but is nearly infinitely more useful/interesting than NO comment :) an >>> example of helpful documentation, >> +1 >> >> and cheers indeed for code created around >>> 10 ago...AND still working in 4.1 update:10112 !!! >>> >>> thank you Lushi (AKA Yisrael Lowenstein). >>> >>> my original MIDI interest was to be able to convert "scores" with the >>> same/similar format found in the AbstractSound bachFugue examples: to create >>> a MIDI file from scratch - not exactly like the MIDIFileWriter example... >>> >>> Stéphane pointed out a way to do that in his Mu0 environment... and i am >>> working on my own version fine-tuned to what i want to do in the way that >>> makes most sense to me in the environment which i am creating :) >>> >>> i also agree that it (Class MIDIFileWriter) should be in the base image, if >>> possible. >> +1 >> or than easily accessible as something like SoundAddons on >> Squeaksource together with a reference in the 'Extending the System' >> workspace. >> >>> ken >>> >>> >>> PS: this brief sort of documentation is very helpful to me. >>> >>> a great example imo is the class comment for: KeyboardMorphForInput. >>> >>> KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... >>> >>> i do not know who goes by the initials of 'nice' - but whoever it is did a >>> rather decent job. actually extremely well done imo... >>> and hopefully "someone" could tell me how to search the image for >>> commentStamps created by 'nice'... that would be.... >>> >> Nice = Nicolas Cellier >> >> --Hannes >> >> > > But I didn't write the comment, just replaced _ with := > > Nicolas > > > > > > |
In reply to this post by Squeak List
<> menu in ScorePlayerMorph
just some thoughts... and, i added "save as MIDI file" to the <> menu - which "pretty much" works (considering #2 below). 2 "issues": 1) the <> menu presents a single "option" when it comes to: either "play via MIDI", or "play via built in synth": i only see 1 option at a time... imo, it would (will be) be very nice if (when) that <> menu shows BOTH possibilities and indicated which one is in use right now. it kinda sorta does that right now: but not as obviously as showing BOTH options and somehow making it clear which option you are using "right now"... it is true: i really get lost in the GUI part of squeak programming entirely too easily/often... yet, it seems like this will be handy when other options are added, like: "play via "some sampled sound", or other options which may not be obvious when there is only 1 possibility at a time showing up to "choose from"... 2) and way more important than #1 imo, is that when i switch to "play via midi", the popup choice of instruments (when clicking on "oboe 1") only show the Abstract sound library instruments (AbstractSound sounds inspect) - not the full list of MIDI instruments which i would expect to be available when i deliberately switch from "play via built in synth" to: "play via MIDI"... as in: (SimpleMIDIPort midiInstruments inspect)... it seems like all of the midi instruments would be available after choosing to "play via midi".... number 2 is the main issue now... onward ken |
In reply to this post by Nicolas Cellier
Nicolas,
thanks. ken ----- Original Message ---- From: Nicolas Cellier <[hidden email]> To: The general-purpose Squeak developers list <[hidden email]> Sent: Wed, May 5, 2010 12:06:05 PM Subject: Re: [squeak-dev] I didn't write the comment 2010/5/5 Squeak List <[hidden email]>: > Nicolas, > > thanks for clarifying :) > > --- --- --- > > and for anyone, > > just looking at: KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... > > i would "guess" that there were 0/ZERO "prior" comments - as in: this is the 1st comment, since there were ZERO prior... but that is obviously incorrect? > > here is what i am still hoping for: someone will at least give a useful "hint" at how to search for anything which has a particular "initial/author stamp" - class comments and examples in particular. > > if i find that someone made a helpful comment in 1 place, i imagine/hope that the same person has made other similarly helpful comments elsewhere in the system. which may or may not be, but i would at least like to know of a simple way to look through the results of such a search ... is this sort of search something which does not exist? > > > > Thanks, > > ken > > It's possible I used a tool for replacing which bypassed prior registration... Like filing out, replacing, filing in... Can't remember Nicolas > > > > > ----- Original Message ---- > From: Nicolas Cellier <[hidden email]> > To: The general-purpose Squeak developers list <[hidden email]> > Sent: Tue, May 4, 2010 10:18:45 AM > Subject: Re: [squeak-dev] Writing a MIDI file? > > 2010/5/4 Hannes Hirzel <[hidden email]>: >> On 5/4/10, Squeak List <[hidden email]> wrote: >>> actually, >>> >>> the class comment for MIDIFileWriter actually works - not very extensive, >>> but is nearly infinitely more useful/interesting than NO comment :) an >>> example of helpful documentation, >> +1 >> >> and cheers indeed for code created around >>> 10 ago...AND still working in 4.1 update:10112 !!! >>> >>> thank you Lushi (AKA Yisrael Lowenstein). >>> >>> my original MIDI interest was to be able to convert "scores" with the >>> same/similar format found in the AbstractSound bachFugue examples: to create >>> a MIDI file from scratch - not exactly like the MIDIFileWriter example... >>> >>> Stéphane pointed out a way to do that in his Mu0 environment... and i am >>> working on my own version fine-tuned to what i want to do in the way that >>> makes most sense to me in the environment which i am creating :) >>> >>> i also agree that it (Class MIDIFileWriter) should be in the base image, if >>> possible. >> +1 >> or than easily accessible as something like SoundAddons on >> Squeaksource together with a reference in the 'Extending the System' >> workspace. >> >>> ken >>> >>> >>> PS: this brief sort of documentation is very helpful to me. >>> >>> a great example imo is the class comment for: KeyboardMorphForInput. >>> >>> KeyboardMorphForInput commentStamp:'nice 3/24/2010 07:37' prior:0... >>> >>> i do not know who goes by the initials of 'nice' - but whoever it is did a >>> rather decent job. actually extremely well done imo... >>> and hopefully "someone" could tell me how to search the image for >>> commentStamps created by 'nice'... that would be.... >>> >> Nice = Nicolas Cellier >> >> --Hannes >> >> > > But I didn't write the comment, just replaced _ with := > > Nicolas > > > > > > |
Free forum by Nabble | Edit this page |