Simple general midi player question
Im building a patch which i hope will be able to have the option to either control sound from another application such as reaktor or logic, or will have the option of playing General Midi sounds instead.
For the general midi side of things i currently have an extremely simple midi note player (see below).
The patch currently plays the default piano sound. What id like to know is how to access the other general midi sounds available. And also, how to make the player play polyphonically?
Heres the midi note player i have currently (very simple!!!):
#N comlet Velocity Input;
#P inlet 314 120 15 0;
#N comlet Pitch Input;
#P inlet 133 119 15 0;
#P window setfont "Sans Serif" 9.;
#P number 133 146 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 314 144 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 193 233 179 196617 noteout 1;
#P newex 193 206 94 196617 makenote 120 300;
#P comment 360 147 100 196617 velocity value;
#P comment 176 147 100 196617 note pitch value;
#P connect 7 0 4 0;
#P connect 2 1 3 1;
#P fasten 4 0 2 1 319 189 240 189;
#P connect 2 0 3 0;
#P fasten 5 0 2 0 138 190 198 190;
#P connect 6 0 5 0;
#P window clipboard copycount 8;
for change the piano sound in general midi use the "pgmout" (program change) object with a number box, for example, to search for the other sound, it will play polyphonic by default i supose.
As Sergio mentioned, use pgmout.
A while back I took the time to make a drop down menu of the General MIDI instruments. This patch is what I use when I’m sending MIDI to the built-in "AU DLS Synth" on Mac. I think it’ll work fine on Windows, but the General MIDI instrument names might not match up depending on your sound card.
Unless you are using different channels with noteout, only channel 1 is going to do anything…
BTW the drop down menu works MUCH nicer in Max 5, no scrolling up and down.
Thanks guys. Im on the right road now. Do you know if its possible to have ADSR control over the Apple DSL GM synth module through Max?
And thanks Adam for the menu patch, really appreciated that!
Quote: jason bradberry wrote on Sat, 26 April 2008 11:32
> Thanks guys. Im on the right road now. Do you know if its possible to have ADSR control over the Apple DSL GM synth module through Max?
Not as far as I know, that synth is pretty basic.
But a lot of synthesizers allow envelope (ADSR) controls to be controlled with CC messages (the [ctlout] object). Sending MIDI to other synths is usually pretty easy, just select a different MIDI device with [noteout] or [midiout]. If you are just getting started with this stuff, there are free software synths out there if you search around (otherwise it’s easy spend a lot of money on commercial synths)
Or you could build your own in MSP and control everything :)
Im actually about to try and link MaxMsp to logic, (and hopefully mainstage) so yeah ill need to get my head around it all.
I think as far as the general midi part of what im doing ill be fine without ADSR control. Although it would be nice if i could control the note length by how long a key is held, but i guess thats not possible as youd need to give [makenote] a note length value as soon as the note is triggered, am i right?
As far as using max with logic, im going to look into the [rewire~] object. My hope is to use a [hi] object ive developed to control synths in logic, or more ideally mainstage, as that would work great as a performance tool, although i dont think mainstage is rewire compatible as far as i know.
Hmmmm lots to work out!!
Quote: jason bradberry wrote on Sat, 26 April 2008 13:40
> it would be nice if i could control the note length by how long a key is held, but i guess thats not possible as youd need to give [makenote] a note length value as soon as the note is triggered, am i right?
That’s right. If you want to do that you need to get rid of makenote and handle all your note ons and note offs.
> As far as using max with logic, im going to look into the [rewire~] object.
My primary setup is MIDI generating patches in Max –> Logic. I think some people use rewire with this combo but I did not have much luck with it. Feel free to investigate rewire, but another option is virtual MIDI ports: http://compusition.com/web/articles/logic-multitrack-midi
This works really well for my purposes.
Thanks adam ill take a look into virtual midi ports, it sounds like it might be what im looking for.
As for handling midi note on-offs, i have midi note information set up for four buttons on my [hi] object, which shows the midi note numbers i play, and holds that number for the duration of the note, then outputs a zero when i let go of the button. I was thinking i could use the zero value to indicate a note off for each button. How do i trigger note on/offs without [makenote]?
Quote: jason bradberry wrote on Sat, 26 April 2008 14:29
> How do i trigger note on/offs without [makenote]?
Note off is 0 velocity. Take a look at the [noteout] help file.
Forums > MaxMSP