Monday, March 19, 2007

CComputing - Week 3 - Program Structuring:

CC – Week 3 – Program Structuring:


Here it is, my (my?) first piece of ‘real’ software. Well, you know what I mean. This patch became a little more intense than the exercise required, but I thought I was on to a good thing, so hopefully the EMU overlords won’t mind…

The patch is titled “Baby Vomit Keys” in response to the less than attractive background colour scheme offered by Max, and contains these basic functions:

- Slider and numerical display for note duration and velocity (values are set to a default on startup with a ‘loadbang’ object, so the operator doesn’t have a brain tumor trying to work out why it makes no sound)

- Dropdown menus for selecting MIDI channel, keyboard range, and MIDI input and output

- A four octave keyboard emulation tool with a MIDI note name display showing the most recently pressed key

- An optional auto-play chromatic scale function providing continuous output when toggle is switched on, for testing MIDI output without having to keep clicking the virtual keyboard with the mouse

- An optional random interruption function to add some avant-garde spice to the endlessly entertaining chromatic scale.

The only real brain teaser I found was working out how to select the octave range. I ended up using a select object which sends a bang from a particular output depending on the message or number received (# or message must match the output name). The outputs were routed to three number messages which would alter the changeable argument for an ‘offset’ message (which is a command that the K-slider recognises).

In short, if the operator picks option two from the drop down menu, it sends a 1 out of its left output (it counts starting from zero so 2 = 1, 3=2 etc) to the select object. Select then sends a bang out of its output that matches 1, triggers the argument change for offset via the connected message box, THEN sends the bang to a bang object (located to the left of the offset argument changing messaging boxes so as not to be triggered first) which triggers the new offset message to be sent to K-slider.

Now, those of you who have bothered to read this far may hasten to point out the redundancy of the above mentioned ‘bang’ object, and you would be correct in doing so. However, I have found that the odd flashing object here and there can serve to highlight certain features of the Max language that we need to become familiar with (right to left output order for instance), so it serves a valid purpose in this regard.

Did I say ‘in short’? Geeezzz!

The random interruption function simply works by sending the metro’s output to a ‘gate’ object, which opens when it receives a one and shuts when it receives a zero. The metro’s output is also sent to a ‘random’ object which is set to spit out a zero or a one when it receives a bang. Note once again the issue of right to left order has been taken into account. The random object is located to the right, as it must set the function of the gate (not to be confused with the ‘switch’ object located beneath it, which is simply for toggling random mode on and off) which is located to the left, before the metro’s bang message reaches the gate’s input.

My apologies for going on, but I have found that explaining the functionality of Max objects and programming in writing is helping to set the language straight in my mind. The text for recreating the patch is below, so have fun…


Text file of patch:

MIDI keys ripoff textfile


Reference:

Christian Haines. “Program Structuring”. Lecture presented at Room 408, Level 4, Schultz building, University of Adelaide. 15th March 2007.

3 Comments:

At 7:50 AM, Blogger John said...

Well done on your vomit keys synth. I personally decided to create a Nord Lead 3. Check it out:

johndelany.blogspot.com

 
At 3:56 PM, Blogger Ben said...

I would see a doctor if my vomit was that colour. I went for cocaine-overdose-victim blue for mine.

 
At 9:13 AM, Blogger David J Dowling said...

I thought about going with newborn baby shite black, but you wouldnt be able to see the cables for analysis...

 

Post a Comment

<< Home