Forums > MaxMSP

How do I use different MIDI instruments?

April 10, 2009 | 2:51 pm

Hello everyone,

I want to make MIDI music using Max but I can’t find a way to change the mapping of the MIDI channels to other instruments than piano. I searched the documentation, but they only tell you how to choose a channel, alter the pitch and the velocity and so on, but I don’t know how to set channel properties.

I want to automatically create randomized music like in the Max Tutorial "List Processing" but not just with the piano and drums.

Greetings, Alexander



baz
April 10, 2009 | 4:00 pm

pgmout to change instruments on your default MIDI synth. You may want to look at vst~ and use vst instruments if you want sounds that don’t suck so hard.


April 10, 2009 | 4:03 pm

Have a look at this patch I posted recently, it should show you how to select different midi instruments.

lh

http://tinyurl.com/ce4fhr


April 10, 2009 | 6:23 pm

Thank you both!

I understood the pgmout-patch.

I think it’ll take more time until I understood that vst~ object, but I’ll try it out. I’m currentlich downloading a vst-plugin from yellowtools.us. Is this a good one? Do you have any favourites?

There are also ways to make MIDI sound better, e.g. Wingroove or downloading other Soundfonts, but I didn’t find any. Do you know some free ones?



baz
April 10, 2009 | 6:49 pm

Yeah, the help patch for vst~ contains a lot of information. All you really care about is the "plug" message to get a new plugin (or put the name of the vst instrument in the vst~ – assuming it is installed), numbers into vst~ change programs, and the midievent message sends MIDI. In the help patch, "midievent 144 64 60" plays note number 64 with velocity of 60, and "midievent 144 64 0" turns that note off, so for your note events you can have a message "midievent 144 $1 $2", where $1 and $2 come into the message as a list of note number and velocity.

BTW, you can double-click the vst~ to change parameters, or (back to the help patch) use the "params" message to print parameter names from the third outlet to use in messages to change plugin parameters.

I’d love to help you out finding vst instruments and soundfonts, but the truth is I don’t use MIDI at all, preferring to "roll my own". I use vst~ for effects like reverb, which are often nicer sounding and more CPU-friendly than things that can be built in Max/MSP.

And if anyone made it this far through this message, the au~ object for OSX is now working in Max5:

http://www.michaelnorris.info/soundmagicspectral/au.html

Thanks to Michael Norris for his work.

b


April 10, 2009 | 7:35 pm

"currentlich", i like that.

independence free might be one of the best in this area, but with vst~ you will run into the next trap, you will now have to learn how to send vst paramater data into plug-ins, as vst~ only takes midi for note on note off.

-110


April 10, 2009 | 9:30 pm

Wow, I don’t know why I put that German suffix at the end. O_O I am SO spell-checking my post this time.

I downloaded independence free and was able to connect the plugin with vst. Clicking open also shows me the editing window. But I guess I fell in that trap already since I once again don’t know how to change instruments. It only makes some kind of Ocarina-like sound and I’m not sure if it really sounds any better than MIDI (and why is it Ocarina anyway?).
And yes, I did download the Image Files (2GB) but I get the feeling that they won’t work unless I configure something somewhere…

If no-one knows it’s ok, too. At the beginning of this semester our Professor introduced us to MIDI + random functions, then told us to split up in groups and by the end of the semester we are expected to do some kind of improvised performance using random elements. And if he uses MIDI sound, we can, too. ^^ I like this project but since I only borrowed a Max/MSP-licence I won’t be able to continue using Max after this semester so my motivation to gain very deep knowledge about this software is kind of limited.

Still, it would be nice to have beautiful sounds…

I find it surprisingly difficult to look for a sound font tutorial that is not about creating them but about how to use them. At the beginning I was kind of hoping there’d be something like the WinGroove driver which I can simply choose as MIDI-Output in the Control Panel (and if that driver would work correctly on my new PC I would be sure to use it). Doesn’t seem to be quite that easy though.


April 11, 2009 | 1:15 am
Squall83 wrote on Fri, 10 April 2009 09:51
Hello everyone,

I want to make MIDI music using Max but I can’t find a way to change the mapping of the MIDI channels to other instruments than piano. I searched the documentation, but they only tell you how to choose a channel, alter the pitch and the velocity and so on.

yep, pgmout with a value from 0 to 127.

Also you can send ctlout 7 1 (for channel 1) for MIDI volume. This way you can control the volume level beyond just the initial velocity. The velocity sets the maximum level for the note, then ctlout 7 will let you scale that from 0 to its max level while it’s playing. Try sound 80 (sine wave) for sustain, play a long note, then fiddle with the volume after the attack. lots of other params too of course.


April 11, 2009 | 5:00 pm

Thx, I’ll have a look at it later. Since it’s easter I’m kind of busy. ^^


April 11, 2009 | 5:46 pm

There is a project called Fluidsynth that plays Soundfonts, and there was even a Max/MSP object called fluid~ based on it.

I used it for a while, because I wanted to use general MIDI and then feed the output through a bunch of filters, and fluid~ was an elegant way to do it, if you loaded it with a general MIDI soundfont.

I remember it was a bit of a pain to set up, since soundfonts are usually archived in an odd format, so I had to find all sorts of weird decompressor utilities.

Sadly, the links to download fluid~ seem to be down. I’ll see if I can track down my copy of the fluid~ object and an unpacked version of the GM soundfont.

[Edit] Get fluidsynth~ from here: http://imtr.ircam.fr/index.php/FluidSynth_for_Max/MSP


April 12, 2009 | 7:46 am

Unfortunately there doesn’t seem to be a download link for Windows users.

Furthermore, "Independence Free" told me "No audio driver available". I installed my SigmaTel Audio driver, so I don’t know why this still happens.

And finally I don’t even know whether or not my sound card supports sound fonts at all. Does anyone know where I can look this up?


April 12, 2009 | 11:23 am

Are you referring to fluidsynth? The link is for both a Mac and Windows version, they’re in the same zip file.

Fluidsynth interprets the soundfonts itself, your soundcard does not need to support them. (That is the point of the project: a software soundfont interpreter.)

The way you use fluidsynth in your patch is that you route everything that would have gone to a midi out to the fluidsynth object instead. The fluidsynth object then outputs MSP audio data.


April 12, 2009 | 1:18 pm

Do you have a tutorial for this? The documentation contains only shell commands, but my computer doesn’t accept them. It tells me that the command "fluidsynth" is either unknown or misspelled.

Is there any way for me to override my standard MIDI Output? I’d like MIDI to sound nice everytime I start a program that has something to do with playing MIDI. If I could simply choose the output driver in the control panel, that would be best. ^^


April 12, 2009 | 1:28 pm

Are we talking about the same thing here?

If you followed the link I posted, you downloaded a zip file that contains the Mac and Windows externals. Put those in Max/MSP’s search path.

There is a help patch for fluidsynth in the zip file, it is called fluidsynth~.help

You can download soundfounts, and the utilities for packing and unpacking them, from here: http://soundfonts.homemusician.net/

Basically:

1 – copy fluidsynth~.mxe to somewhere where Max can find it
2 – download and unpack a soundfont (presumably one with GM in the description) to the same folder as your patch, or somewhere in the Max search path
3 – make a patch with the fluidsynth~ object
4 – send it the command to load a soundfont
5 – send MIDI to the fluidsynth~ object, not to a midiout


April 12, 2009 | 3:24 pm

Yes, I followed your link and while downloading it I went on to their homepage and found that tutorial which only lists shell commands.

I opened the help file in MaxMSP, but it’s huge and since I didn’t know anything about Maxs’ search paths yet it obviously didn’t do anything. ^^ I added the path and now the help file makes sounds.

I also successfully included fluidsynth in my patch now. I’ll look for sound fonts later because now I’m tired. Thank you for your patient and detailed explanation. Smile I wish that every tutorial would contain an easy noob-friendly explanation like this one.

edit: One more thing:
Can fluidsynth load more than one sound font at a time? I’m asking because some fonts are described like "this changes the drumset" or "this adds a nice collection of pianos". I guess this means that only certain instruments are overridden.
How do I find out which instruments have changed?


Viewing 15 posts - 1 through 15 (of 15 total)