With my Axis-49 we needed to:
- Translate (remap) an Axis-49 note “harmonic axis” value to a “folded-scale” (Wicki-Hayden) layout
- See what is coming in from the Axis
- Know how hard I had hit the key
- Double-check the note value – e.g. did I really hit a G#?
So
I wrote a little program to do this magical transformation. In it, the
data (midi signal) flows from “notein” (assigned to the Axis), gets
tweaked a bit, the goes on to “noteout” (assigned to some instrumental
sound maker).
Max/MSP: a cute little graphical development system
Signals
travel along the little wires (black lines) connecting boxes. The
boxes do things to the signals, the top is input, the bottom output.
Here’s the flow sequence:
Notein a
Gets the next midi note coming in, splits it into to 3 outputs:
- the midi note value (an integer) e.g 61 = middle C, this is what we need to translate
- the midi note velocity (also an integer, 0 = off, 1-127 = ppp to fff)
- the midi channel number
You can double-click on the notein box to pop up list of the midi input devices and select one.
The
signals then travel along the connections (wires) to be translated. The
note velocity and the channel number go straight to the noteout box
unchanged. The note pitch goes to the coll object to be translated.
coll axis49-wick
In
this case the coll (collection) defined in table Axis49-wick.txt serves
as a look-up table, the table is a series of paired numbers, with the
input value matched to the left of the pair, the output value is the
right pair value. Thus, with pair 84, 78; an input value of 84 (musically a C-5 gets mapped to a 78 (an F# ),
This
table is easily edited in MS Notepad. When Max/MSP starts up, it will
read this table. If like it, the Status box will show “coll; finished,
70 lines”. If not, it will show an error message.
Input “number box”
Display (shows “C-2” ) – shows the key hit by you in terms of what the Axis-49 sent out, as a note.
Subtraction
After I wrote the table, I wanted to shift the notes down an octave, so
I added a little box that takes a number in the top, minuses it (see
the little “-“ (minus) sign?) by 12 and puts it out the bottom
The
12 subtracted from the note value lowers it by an octave (12
semitones), I display the value in the little number box, but also pass
it on two ways, one way goes to stripnote which strips out the note-off
values – other wise the velocity would be zero when the note is lifted-
and I pass the note on to the big yellow note display boxes.
The switch box
In the center is a little switch box, which allows me to turn on or off the translation
- click the mouse on it and the little switch changes to take direct input from “notein a”.
- Click on it again to switch it back to reading the translated values from the "coll" box.
The little “value box”
This shows the midi note value as a number, not a note, for debugging. Shows (0)
stripnote
Stripnote strips out the note-off values, so they persist on the display after the finger lets up.
2 big yellow “value boxes”
I made these big displays (shows “C-2” and 0) to show the last note had hit.
noteout a
Read the 3 midi input values: outputs:
- the midi note value (an integer)
- the midi note velocity
- the midi channel number
You can double click on the notein box to pop up list of the midi input devices and select one.
That’s all it does – pretty simple, once you understand it.