Electronic Musical Instrument Design

lecture notes • Spring, 2014

Mar 3

Designing an instrument & Assigning tasks within the team

Meta-events: events about events. What are they and how do you implement them in Max?
Objects: metro, tempo, sliders, dials, lists of numbers, random, number boxes with limits and offsets
Tempo, accelerate & ritard
Range, also restrict to key, scale, chord
Tendency masks: "clouds" of random numbers controlling function to keep it within certain limits, and changing the limits over time
Crescendo and diminuendo, using velocity (control over individual notes, but only one velocity byte per event) vs. volume (continuous control of level, affects all notes on that MIDI channel)
Harmony: distance between notes. Does it follow key, scale, or chord?
Counterpoint: how musical voices move against each other, parallel, opposing, combination
Orchestration: use multiple Reason modules on multiple MIDI channels to layer different sounds or create an orchestra.
Density: growing/shrinking chords or clusters using module's polyphony setting

Feb 26

Sensors summary
Toggle, push-button, momentary, lever, magnetic
Rotary encoder: has two different switch contacts, “0” and “1”. Speed of encoder determined by how fast switch contacts are made; direction determined by order of contacts.

Continuous sensors can act as resistors or current generators. Some, like rotary or slide potentiometers, can be connected directly to the Arduino. Others need buffering, amplification, and/or filtering to provide usable signal.
• Force-sensing resistor=pressure. Button-type or strip.
• “Softpot”, flat variable resistor, ribbon or circular
• Flex sensor=bending angle
• Infrared distance sensor=from about 1.5-10 inches. Available in various ranges. Get too close and the field inverts.
• Photocell: presence or absence of light
• Accelerometer: 1-axis, 2-axis, 3-axis. More sensitive ones can measure tilt (responding to gravity)
• Piezo electric foil=striking or bending force. High voltage.
• Capacitive

Feb 24

Lab safety and rules
Use goggles when using any power tools. No power tools when you’re alone except hand drill.
Don’t use any tools you don’t know how to use, especially soldering irons, electric saws.
Unplug soldering irons after use. Unplug glue gun after use.
Don’t overuse hot glue. Heat destroys components.
No spray painting in the building: take objects outside and use cardboard backing so paint doesn’t get on pavement or grass.

Feb 20

Max/MSP 30-day free download: go to http://cycling74.com/downloads/

Arithmetic functions: Use space after operator, Enter when done.
Select: waits for value, passes 1.
Relational operators: <. >, =, != (not equal). Puts out 1 when condition is met, 0 when it's not.
Metro=clock, number of milliseconds. Start and stop with toggle at input.
Clocker=metro that reports the time since it starts
Random n=puts out random value 1 through n
Gates: pass data or not.
Overdrive: improve MIDI speed at expense of screen redraws.
Max allows having multiple patches open and active, and can communicate with each other.
zl: list functions, zl mth chooses mth number in list.

Feb 19

Intro to Max:
Launch Max. Before opening a patch, check Max's MIDI Setup: "in a" is MPD or keyboard, "out a" is "from MaxMSP1". Disable all other inputs and outputs
Launch Reason. Set Preferences>Advanced MIDI>A to "fromMaxMSP1

Edit and locked mode. command-E toggles, or click on lock icon. When locked, patch can't be altered.

object box = function
start typing, list of objects appears. To list them all, Max Help: objects A-Z or by function

Number box = for monitoring.
Can choose to display MIDI note numbers OR names (command-I = get info on this or any other object)

Patch cables connect everything.

notein arguments: port (a), note#, velocity, channel
noteout: same

makenote: note#, velocity, length in ms. Has to then go to a noteout.

cntlin: controller value, controller #, channel (if no channel, will accept all. If wrong channel, won't respond)
cntlout: same

Sliders (0-127), can change (Get Info)

Pipe: number of arguments is number of messages passed, with last one being delay time in ms. Use "0" for dummy arguments; thus "0 0 0 time" will delay a MIDI message.

MIDI Scope: a Max patch that analyzes incoming MIDI data.

Feb 12

Reason NN19 module: samples, with many of the same filtering and envelope parameters as Subtractor.
Building sample map, assigning controllers.
Aligning pitches in sample map—setting root note. Keyboard tracking (no pitch change).
AIFF audio format. Samples can be mono or stereo.
Recording, importing and converting sounds, SFX libraries.
Self-contain setting!

Akai MPD26 and Reason

Using Vyzex Editor: Follow instructions on desktop. Save a patch with your name on it.

Using MPD with Reason--you can now control anything on the panel with the proper controller numbers (tables printed out at each station)
Multiple modules in Reason: addressable by MIDI channel.

No class Monday Feb 17

Feb 3

What are synth parameters?
Key number
Pitch, detune
Filter freq and resonance
Envelope, filter envelope
LFO rate and depth, mod envelope

Mapping keyboard physical gestures to musical ones: mod wheel and velocity
Mod wheel to pitch vibrato, volume vibrato, timbral change, envelope
velocity to amplitude
velocity upside down to volume
velocity to envelope attack time

velocity to filter envelope (brightness)

Using knobs/sliders on the Oxygen keyboards: Check their action in MIDI Monitor app.
Every knob and slider on the Subtractor module has a MIDI controller number so you can operate it remotely in real time.

Current Oxygen settings:
Mod Wheel=Controller 1, Mod Wheel
Data Slider= Controller 7, volume
Top row of knobs:
Amp Env Attack=73 • Amp Env Release=72 • Filter Freq=74 • Filter Env amount=18
Bottom row of knobs:
LFO rate=26 • Osc Mix=107 • Osc 2 fine tune=104 • LFO 2 amount=111

After you've worked on a patch, save it and save the whole rack (.reason) in your own folder in “Student Work” folder.

Jan 27

Familiar vs. unfamiliar user interfaces for music
Familiar: keyboard, guitar, drums, malletboard, violin, woodwind, brass. Advantage, people already know how to use it. Doesn't require new skills, practicing, rethinking how you make music.
Most commonly in electronic world: keyboard. Used with Moog synths, Switched-on Bach. Became glorified organs with thousands of stops, people play all of them the same way.
But, can extend technique to play keyboard in new way that has different expressive parameters (aftertouch, wheels, pedals).
Adaptive: or extended, like keyboard with pedals; stringless guitar; wind controllers with more buttons and levers than a conventional wind instrument; violins with sensors on the bow, etc.
Unfamiliar: like Theremin: hard for guitar players used to articulating with right hand. Using different parts of the body, or in different ways. Finger position or movement on surface or in free space. Relative positions of fingers -- spread or angle. Bend of joints: wrists, elbows, knees. Pressure on surface. Requires practice and mastery! Think of music in different ways than simple button-pushes/discrete events.

MIDI Hardware
Out jack connects to In jack using MIDI cable. Speed is limited to 31,250 bits/sec, about 1000 commands/sec. Other transports (USB, Firewire, Ethernet) have no speed limit.
Virtual MIDI connections (inside operating system, using software synths) have no speed limit.
External devices communicate with computer using MIDI-USB interface or just USB, in which case computer must have driver software that recognizes the device. We have custom driver for Max that recognizes Arduino.

MIDI command structure
Real-time control language.
Some commands three-bytes, some two, some one, some longer.
Best expressed in hexadecimal notation: 0-255 decimal ($)=00-FF Hex
Numbers below 128$ (80H) are data bytes. Numbers 128$-255$ are command bytes.
Channels: second half of command byte, 0-F=read as 1-16. Different insruments respond to different channels. In Reason, each module is on its own MIDI channel.
Note on (9n) + note number + velocity, off (velocity). Decimal ($): 144-159
Note off (8n)+ note # + velocity. Duration is time between on and off. 128-143$
9n with velocity zero is equivalent to note-off
Controller (Bn), controller number, value. Some continuous (wheel, slider, breath, foot control), some switched (sustain pedal). 127 of them, not all defined. Used for any kind of continuous command. 176-191$
Pitchbend: (En) + LSB + MSB. Like controller but its own command, double precision. 224-239$
Mono Aftertouch or Channel Pressure: (Dn) + value. 208-223$
Poly aftertouch (An) + note # + value. 160-175$
Program change, (Cn) 0-127. Reason doesn't respond to it. 192-207$

Jan 22

Two metaphors/paradigms for musical instruments:

1) Instrument metaphor:
Physical action causes a sound to be made
Control of pitch(es)
Pitch articulation/control (more than just turning on a note)
Amplitude articulation (initial and subsequent)
Timbre articulation
Virtuosity: As you learn it, you get better and can do more with it.
Something interesting to look at: Audience needs to pay attention.
[We're concentrating on this one.]

2) Mixer metaphor:
A tool to control an audio process
Selection, adjustment, nudging, changing volume/balance/timbre on the fly

Simple sound parameters in a subtractive synthesis module:
pitch (inc. glide, bend)
timbre: waveform, filter freq, filter res, noise level
Envelopes (ADSR) of volume, pitch, filter frequency
Vibrato (LFO) + vibrato envelopes

MIDI horn (Casio DH-100): breath sensor generates MIDI aftertouch, which is then mapped to volume, vibrato, and/or filter

Jan 15

1) What is music? Working definition: Sound that is created deliberately, and has interest as sound. "Sound with intent."
2) The elements of music: melody, rhythm/tempo, harmony, timbre/orchestration.
3) What's a gesture controller? Something that responds to a physical action by one (or more) human beings. Examples: Squeeze, blow, pluck, bow, hit with hand or foot or stick, press with fingers.
An electronic musical instrument uses gestures to control electronic circuits.
Can be simple (direct) like theremin or complex (through microprocessor) like Wriggle Screamer
Computers provide ultimate flexibility: they can produce any sound, and interpret any gesture however we like, once we get the gestural information into the computer.

Links in the chain:
• Electronic sensors to detect gestures: touch, pressure/force, movement, acceleration, distance, displacement
• Device to turn data from sensors into MIDI: Arduinos, MIDItron, Bluetooth and USB devices
• Software to interpret and process the MIDI data: Max
• Synthesis software to turn the processed MIDI into sound: Reason
• Audio system to produce the sound

What we will do in the class:
• Study existing electronic instruments, see them demonstrated live and on video
• Conceptualize physical gestures as they can be used to make music
• Learn MIDI, what the commands mean, how they can be used to control music
• Learn Reason, a software synthesis system, and how to use its parameters
• Translate gestures into electronic form, using sensors, and then translate them into MIDI using Arduinos and MIDItrons
• Look at data from other real-time control devices—Bluetooth and USB—and translate it into MIDI
• Process real-time MIDI data with MAX
• Build new controllers and systems
• at the end, do a public demonstration