Overview
A rotary encoder uses digital encoding of pulses in either a clockwise or counter-clockwise direction to determine relative location. This particular rotary encoded includes a push button as part of the shaft.
This example shows how to connect a single, simple rotary encoder, and use the output as a MIDI controller.
Hardware
This particular encoder has five pins. The group of three pins on one side is the encoder. The group of two pins on the other side is the
For the group of three encoder pins, connect the right hand pin to a digital pin on the Teensy. In this case, pin 2 has been chosen. Connect the left hand pin to a digital pin on the Teensy. In this case, pin 3 has been chosen. Connect the middle of the three pins to ground.
These particular pins have been selected because they support interrupts on the Teensy LC. Refer to the Teensy pinouts to see possible pins, labelled INT. Note that Teensy 3.1 and 3.2 support interrupts on all digital pins.
For the group of two button pins, connect one pin to a digital pin on the Teensy and the other pin to ground.
Software
Download here: http://milkcrate.com.au/_other/downloads/arduino/Teensy_Rotary_Encoder.ino
The code uses the encoder library, which is included with the Teensyduino install. The encoder is mapped to MIDI CC #1 channel 1, and is constrained to 0 - 127. The button is mapped to MIDI CC#2 channel 1.
Video
Saturday, July 30, 2016
Simple MIDI Rotary Encoder with Teensy / Arduino
Labels:
arduino,
physical control,
physical digital,
teensy
Mira Control Surface Patch with High Res MIDI
A Mira control surface patch with high resolution MIDI support.
The MIDI mapping is as follows:
• Keyboard: MIDI notes 24 - 53
• Buttons: MIDI notes 60 - 72
• Pitchbend slider: 14-bit pitchbend
• Modulation slider: 7-bit CC #1
• Dials: 7-bit CC #2 - 3
• Toggles: 7-bit CC #4 -15
• Touch X and Y: 7-bit CC#16 - 17 (paired with CC#48 - 49 in 14-bit high res mode)
• Multislider with 8 sliders: 7-bit CC#18 - 25 (paired with CC#50 - 57 in 14-bit high res mode)
Download here: http://milkcrate.com.au/_other/downloads/max_patches/little-scale.Mira.MIDI.Surface.maxpat
Friday, July 29, 2016
Thursday, July 28, 2016
Tuesday, July 26, 2016
Monday, July 25, 2016
High Resolution MIDI with Arduino, Teensy and Ableton Live
High resolution MIDI improves the resolution of continuous controller messages from 7 bits (0 - 127) to 14 bits (0 - 16383) by pairing together certain controller numbers. Controllers 0 - 31 for the high byte are paired with controllers 32 - 63 for the low byte.
This is an example of using the Teensy LC, along the analogReadResolution() function to read an analog value of 12 bits, scaled to 14 bits, and then sent as a high resolution MIDI message sent via MIDI CC 32 paired with MIDI CC 0.
This is an example of using the Teensy LC, along the analogReadResolution() function to read an analog value of 12 bits, scaled to 14 bits, and then sent as a high resolution MIDI message sent via MIDI CC 32 paired with MIDI CC 0.
Labels:
ableton live,
arduino,
physical control,
teensy
Sunday, July 24, 2016
Simple OSC Receiver to Multiple Ableton Live Parameters Max for Live Device
For a multiple elements / parameters. Download here:http://milkcrate.com.au/_other/downloads/M4L/little-scale.OSC.Receive.Simple.Multi.amxd
Simple OSC Receiver to Ableton Live Parameter Max for Live Device
For a single element / parameter. Download here: http://milkcrate.com.au/_other/downloads/M4L/little-scale.OSC.Receive.Simple.amxd
Saturday, July 23, 2016
Ableton Live and High Resolution MIDI Control
MIDI Continuous Controller data is usually restricted to 7-bit values, thereby having a limited range of 0 - 127. This is because a MIDI CC message is structured as a command byte followed by two data bytes:
• Command byte: 0xB0 to 0xB7 for MIDI CC message using MIDI channel 1 - 16
• Data byte: 0x00 to 0x7f for Controller Number 0 - 127
• Data byte: 0x00 to 0x7f for Controller Value 0 - 127
In other words, there are sixteen MIDI channels. Each MIDI channel can carry 128 MIDI controllers (numbered 0 - 127), and each controller can has a value range of 0 - 127 (7 bits worth). This is great if we need lots of different control pathways, but not so great if we need something with a higher resolution than just 0 - 127.
High resolution MIDI control messages offer a solution to this issue. Two standard, 7-bit MIDI CC messages can be combined to form a single, high resolution MIDI CC data point. This is only possible if the software that is receiving the data is able to interpret the two MIDI CC messages as a single 14-bit message. A 14-bit MIDI message has a range of 0 - 16383, as opposed to 0 - 127.
For each of the sixteen MIDI channels, MIDI CC 32 - 63 can be combined with MIDI CC 0 - 31 to form a high resolution message. The value from controller 0 - 31 forms the high byte (i.e. bits 8 - 14) and the value from controller 32 - 63 forms the low byte (i.e. bits 1 - 7).
For example:
• MIDI CC Channel 1; Controller 0, Value 63
• MIDI CC Channel 1, Controller 32, Value 20
These two messages, when read as a 14-bit value, give a high resolution result of 8084. The value of MIDI CC 0 is 63, and is the high byte. The value of MIDI CC 32 is 20, and is the low byte. Thus, the 14-bit combined value is 63 * 128 + 20.
This can be expressed in a Max patch such as this:
Ableton Live supports high resolution MIDI. Simply use the MIDI map function as per usual, but send a pair of high resolution MIDI bytes one after the other. The high byte is sent first, directly followed by the low byte. If the bytes are of the correct MIDI controller and channel pair, then Ableton Live will recognise this as a high resolution MIDI control message.
This option can also be manually selected by mapping a parameter to a MIDI controller in Live, and then selecting the MIDI controller in the MIDI Mapping Mode screen. In the bar on the very bottom left hand side, a menu allows the selection of a variety of MIDI mapping modes, including "Absolute 14-bit".
Each of the 16 MIDI channels supports up to 32 high resolution MIDI controllers in this way.
• Command byte: 0xB0 to 0xB7 for MIDI CC message using MIDI channel 1 - 16
• Data byte: 0x00 to 0x7f for Controller Number 0 - 127
• Data byte: 0x00 to 0x7f for Controller Value 0 - 127
In other words, there are sixteen MIDI channels. Each MIDI channel can carry 128 MIDI controllers (numbered 0 - 127), and each controller can has a value range of 0 - 127 (7 bits worth). This is great if we need lots of different control pathways, but not so great if we need something with a higher resolution than just 0 - 127.
High resolution MIDI control messages offer a solution to this issue. Two standard, 7-bit MIDI CC messages can be combined to form a single, high resolution MIDI CC data point. This is only possible if the software that is receiving the data is able to interpret the two MIDI CC messages as a single 14-bit message. A 14-bit MIDI message has a range of 0 - 16383, as opposed to 0 - 127.
For each of the sixteen MIDI channels, MIDI CC 32 - 63 can be combined with MIDI CC 0 - 31 to form a high resolution message. The value from controller 0 - 31 forms the high byte (i.e. bits 8 - 14) and the value from controller 32 - 63 forms the low byte (i.e. bits 1 - 7).
For example:
• MIDI CC Channel 1; Controller 0, Value 63
• MIDI CC Channel 1, Controller 32, Value 20
These two messages, when read as a 14-bit value, give a high resolution result of 8084. The value of MIDI CC 0 is 63, and is the high byte. The value of MIDI CC 32 is 20, and is the low byte. Thus, the 14-bit combined value is 63 * 128 + 20.
This can be expressed in a Max patch such as this:
Ableton Live supports high resolution MIDI. Simply use the MIDI map function as per usual, but send a pair of high resolution MIDI bytes one after the other. The high byte is sent first, directly followed by the low byte. If the bytes are of the correct MIDI controller and channel pair, then Ableton Live will recognise this as a high resolution MIDI control message.
This option can also be manually selected by mapping a parameter to a MIDI controller in Live, and then selecting the MIDI controller in the MIDI Mapping Mode screen. In the bar on the very bottom left hand side, a menu allows the selection of a variety of MIDI mapping modes, including "Absolute 14-bit".
Each of the 16 MIDI channels supports up to 32 high resolution MIDI controllers in this way.
Wednesday, July 20, 2016
Friday, July 08, 2016
Saturday, July 02, 2016
Subscribe to:
Posts (Atom)










































