MIDI Generating LFOs

3 LFOs summed togetherA few weeks ago, I finally got around to thor­oughly read­ing a very dense tuto­r­ial on the Max/Msp web­site about using LFOs as semi–Random num­ber gen­er­a­tors. I’m always look­ing for newer and hip­per ways of adding an amount of ran­dom­ness to com­puter music — so why not use MIDI gen­er­at­ing LFOs?

The tuto­r­ial by Greg Taylor starts here, and in its three parts con­tains a wealth of know-how on MAX.

I agree with his state­ment that,

Max is really just about mes­sages, num­bers, and lists and how you move them about;

As a new­comer to Max/Msp this arti­cle answered many of my ques­tions. It also did a good job of plug­ging some of the advan­tages of MAX 5 at the same time. Specifically, the abil­ity to link dif­fer­ent ele­ments to MAX’s global trans­port, and the new pre­sen­ta­tion view, which although it is cool, I usu­ally put off spend­ing time on.

You can down­load all of Greg’s exam­ples at var­i­ous stages of devel­op­ment through the tuto­ri­als, but con­sid­er­ing how enlight­en­ing this tuto­r­ial was for me I decided to cre­ate my own, some­what pared-down ver­sion, as a learn­ing aid.

LFOs_generating_numbers

The first thing that I did was cre­ate 3 LFOs and add them together. What I did was pretty sim­i­lar to the tuto­r­ial, except I added a [umenu] object that that allows you to choose between sine, saw, tri­an­gle, and square waves. The three are summed together and dis­played below. The fourth LFO, all the way on the right I use to sep­a­rately gen­er­ate the veloc­ity for each midi note that gets sent out. I thought this was a nice addi­tion to explore for gen­er­at­ing some vari­ety in veloc­ity val­ues. I’ve also con­sid­ered using more than one LFO here too, but I haven’t got­ten around to that yet.

The inside of the [p wavetype selec­tor] object look like this:

If any­one out there has any sug­ges­tion on bet­ter ways of doing the math here please let me know. Signal math is def­i­nitely not one of my strong points. I lit­er­ally just copied most of it from the MAX 5 tuto­ri­als. Once the LFOs are summed together I sent the sig­nal to a series of objects that scale the range of the sig­nal out­put (-1 to 1) to the range of 0 to 7. I set the range at 0 to 7 because I wanted the [coll] object to con­tain a scale of 8 notes, the first note being in the 0 posi­tion. I had this vision of the end result being a some­what atmos­pheric pad sound, but at the same time have that pad uti­lize notes based around a par­tic­u­lar tonal center.

scalelfotocollvalues

The pic­ture on the left shows where the scaled val­ues (between 0 and 7) are sent into the [p coll selecter] object(my apolo­gies for the mis­spelling of the word “selec­tor”). I’ll explain what goes on inside this object in just a sec. The metro tog­gle box must be on so that the [umenu] object can select at what rate to gen­er­ate MIDI notes. Again, the [umenu] object con­tains all of the rec­og­niz­able note dura­tions in Max 5. An overview of this syn­tax can be found here.

This sec­tion of the patch decides at what rate to make notes, and from which scale. The var­i­ous scales are held in a series of [coll] objects inside the [p coll selecter] object. After see­ing the way Greg Taylor uses the [coll] object in his exam­ples, I thought it would be cool if I could con­tain a scale within a [coll] and then, via the trans­port, trig­ger dif­fer­ent scales of notes at dif­fer­ent times dur­ing a com­po­si­tion. This way I can have the LFO gen­er­ated sound­scapes move with the har­monic pro­gres­sion of a song. In order to achieve this effect, I placed a series of [time­point] objects along with the [coll] objects inside of the [p coll selec­tor] object which looks like this:

timepointtriggeredcollsHere you can see each of the colls labeled with the scale that they con­tain. Eight notes each. (I do know that this har­monic pro­gres­sion is far from stan­dard, but what­ever, I thought it sounded cool the other day) I am using the time­point objects to trig­ger the dif­fer­ent colls when the chords need to change in the progression.

That is how each midi note is gen­er­ated. Creating the veloc­ity val­ues is pretty much the same pro­ce­dure dis­played on the right side of the patch. You can see this in the pic­ture of the full patch near the top of the post. Both the midi note val­ues, and the veloc­ity val­ues get sent, via [send] and [receive] objects, to the sec­tion of the patch dis­played below.

lfos_midi_outThe midi notes sent from the [r coll­pat­tern] object, the veloc­ity val­ues, and the note dura­tion val­ues all get sent into a [makenote] object to cre­ate the MIDI-off notes, things can get pretty noisy if you leave out his object! After that, the num­bers are packed, for­mat­ted, and sent out the “from Max/Msp 1″ option, avail­able by click­ing on [mid­i­out]. I also copied and pasted the var­i­ous chord con­tain­ing  [coll] objects to the upper right por­tion of the front page. Greg posts an awe­some “coll loader” patch on this page that allows you to use your midi key­board to pop­u­late the colls. A highly rec­om­mended down­load for adjust­ing the coll val­ues on the fly while keep­ing your brain work­ing in musi­cal terms and not in terms of MIDI note values.

I ended up rout­ing this out to some synths in Ableton. Here are a few short sam­ples that I like. At times they seem quite musi­cal, and at oth­ers, fairly chaotic. The midi data can also be recorded. So at the very least it can be a fun brain­storm or spring board for bet­ter ideas.

Audio clip: Adobe Flash Player (ver­sion 9 or above) is required to play this audio clip. Download the lat­est ver­sion here. You also need to have JavaScript enabled in your browser.

Audio clip: Adobe Flash Player (ver­sion 9 or above) is required to play this audio clip. Download the lat­est ver­sion here. You also need to have JavaScript enabled in your browser.

Audio clip: Adobe Flash Player (ver­sion 9 or above) is required to play this audio clip. Download the lat­est ver­sion here. You also need to have JavaScript enabled in your browser.

At the bot­tom of the page you can see where I have copied and pasted the MAX 5 help patch for the [host­sync~] object. This is just the begin­ning of me work­ing on hav­ing the MAX trans­port link up with the trans­port in what­ever DAW pro­gram I am using. At the moment I am using a demo ver­sion of Ableton 8. Right now the [host­sync~] object is just there to pro­vide visual feed­back, but the part of the patch on the bot­tom right (pic­tured below) allows the tog­gle box to start both trans­ports at pre­cisely the same time. The addi­tion of the [time­point] object will cre­ate a 16 bar loop on the MAX trans­port. Unfortunately, for the time being loops points must be set inde­pen­dently in both MAX and Ableton. I sup­pose in the future with the addi­tion of Max for Live this could be an easy thing to imple­ment, but for now, I haven’t spent the time on find­ing a way to have loop points mir­ror each other in both apps.

The Future

I don’t con­sider myself any­where near being done with this project. While writ­ing this post I real­ized a few things that I could have done better.

  • The idea of scal­ing the LFO’s out­put (-1 to 1) to match a series of notes is cool, and if those series of notes are an aurally pleas­ing scale that’s even bet­ter, how­ever I think I could improve the way I am doing this. Once I started play­ing with the LFOs I noticed that scal­ing the out­put down to just 8 notes some­times doesn’t gen­er­ate all that much vari­ety. On top of that, if we use a full major scale for instance, with cer­tain para­me­ters the LFO might get suck undu­lat­ing between the 4th and 7th tones in the scale, which might not exactly be the sound you are going for. In the next ver­sion I am plan­ning on using less tones over more octaves. Maybe instead of the full scale, just the tones that I think will fit nicely, then have them span over maybe 3 octaves to give the LFOs more range to gen­er­ate num­bers within.
  • Using only one LFO to gen­er­ate veloc­ity val­ues seems to lend itself to fairly pre­dictable val­ues being out put. For instance a sin­gle square wave will pro­duce a very high veloc­ity, fol­lowed by very low one, then a high one again.…etc. The sec­ond audio clip is a good exam­ple of this. In the case of that sam­ple, I think it cre­ated a sort of cool bell-like sound with the syn­the­sizer, but it doesn’t have much ver­sa­til­ity. For the next ver­sion, I think I’ll also add another one, or two, LFOs that can be summed together for veloc­ity val­ues and see how that effects things.
  • As much as I enjoy star­ing at all of this overly com­pli­cated look­ing mess, I think I’ll also have to spend a bit of time work­ing out some more use­ful and infor­ma­tive GUI ele­ments in Max 5’s pre­sen­ta­tion view.
  • Lastly, mak­ing LFO gen­er­ated Synth parts that move with a har­monic pro­gres­sion is all fine and dandy, but it doesn’t mean much unless I can link it up with an exist­ing com­po­si­tion, and have a full song to show off. That will be my work for the next week or so, hope­fully some­thing totally awe­some will come of it

Please leave com­ments and let me know what you think. I am post­ing a copy of the .max­pat file here if you’d like to use or mod­ify it. Of course, if you down­load this and cre­ate some­thing even bet­ter than I could have done, or imag­ined in the first place, don’t for­get to give me a shout out and send me link so I can check it out!

CLICK HERE to con­tinue on to MIDI Generating LFOs Pt. 2

Share and Enjoy:
  • Facebook
  • Twitter
  • Digg
  • Reddit
  • Technorati
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • MySpace
  • Fark
  • Tumblr

Tags: , ,

Leave a Reply

Trackbacks