Musical Instrument Digital Interface (MIDI), since late '70s, early '80s.
BINARY
1 byte = 8 bits = 256 ways to represent information (2^8)
10101101--> first 1 is MSb (Most Significant bit) and last 1 is LSb (Least Significant bit)
HEXADECIMAL (colors in HTML use this, a few other things)
0123456789ABCDEF
A0 is hexadecimal for 160 (A is 10*16^1 plus 0)
Dave Smith suggested to synthesizer manufacturers who were considering using computers to control their products to create a language they could all use. Receiving device actually creates the sound.
Macs have CoreAudio and CoreMIDI built in to their operating system, and Macs include AudioMidiSetup application automatically (hidden in a subfolder, search for it). They both also have a MIDI device built in.
midiin object--when patcher locked, can select input device--also digital ways to send MIDI to another program, like GarageBand
128 possible gradations of velocity in MIDI
"note on" message with 0 velocity does same thing as "note off" message
SERIES OF BYTES IN A MIDI MESSAGE
status byte (tells you what kind of message it is, starts with 1 so it's over 128 and not a velocity message, 128-255)
data byte (starts with a zero, 0-127, the actual content of the message)--the number 60 means middle C, then move chromatically from there
velocity (0-127, where 0 means key has been released--or you can send note off specific message, and then the third byte will be release velocity--we don't use this very often)
-MIDI sends no information about duration- Inventors thought this would be used in real time, in performance, so people would be pressing and holding keys to determine duration. Receiving device can contain internal processing to measure duration. That's how a sequencer works--it has a tempo going, uses tempo info to figure out where beats & durations are.
Pitch bend messages can also be sent--224 is status byte meaning pitch bend, then fine pitch bend value, then coarse pitch bend value--some devices put 0 in that middle slot and don't use it, some devices combine fine and coarse bend into one 14-bit number so there's much finer pitch bend resolution--8092 is medium bend--receiving device decides how much bend the pitch wheel will actually give you, a lot of devices use two semitones up and down as a standard
Program change message: changes sound (piano, for example) to some other sound
pgmout object--sends out easy MIDI message to change sound--also internally prevents you from sending out messages outside the 0-127 range
midiout object--considers every number you input to be a byte, you have to program it all manually
notein--looks at MIDI coming in, only responds to note on and note off messages--sends out channel, velocity, and pitch information, just the stuff you care about--or you can type in the device/channel you want after that, and it'll get rid of that outlet for you
noteout--takes in pitch, velocity info, sends out pitch, can specify channel
*when programming, make sure you program a way to end a note or sound
channel information: last four bits of status byte--first channel is 0000, second channel is 0001, etc.--computers have channels 0-15, we humans call it 1-16
bendin object--gives you a simple 0-127 readout of pitch bend, with 64 being middle spot
ctlin object--Mod wheel and other controllers, can select them from the object
ctlout 123 1--input 127 as a message, that's reserved in MIDI as the "panic" messages that turns everything off
makenote object--expects to receive pitch, velocity, and duration--sends out pitches & velocities--tags each note with a duration value, schedules a note off for that pitch in the future
*counter object is good for making chromatic scales, just specify which pitches to start & stop
An array is a stored list of information, use index (#s starting at 0)--can use to store preferred pitches, etc.
coll object--lock, double click, opens editing window to type in what to store, in format "1, 60;"--as in, when you receive the message 1, output middle C--like line by line programming--array doesn't automatically get saved with patcher, use the inspector to "embed", or else type "coll @embed 1" right into object IMMEDIATELY--otherwise it'll erase your whole array you've already typed when you try to save it, embed it FIRST
also object called table (stores numbers, very simple), buffer (stores numbers)
No comments:
Post a Comment