Breath sensor made from an MPXV7002 and a silicon tube. The tube has incisions added near the breathing end to allow air to flow through while still building pressure at the sensor end. Enough pressure is still built up within the tube to allow circular breathing if desired. The sensor sends note on / off and continuous control data.
To improve this I might consider a wider tube that is coupled with the sensor or try more or different-sized puncture holes or a 3D printed mouthpiece. However, it still works really well as-is.
Wiring is simple as the sensor outputs an analog voltage and works fine on 3v3 or 5v power supply. The output voltage is rail to rail across the power supply voltage range, and can represent both positive and negative pressure, meaning that the neutral pressure will output at halfway of the voltage supply.
For a Teensy 3.x or 4.x: 3v3 to the 5V pin on the sensor, ground to ground and output of the sensor to Teensy A0 analog input pin.
This Arduino sketch and Max patch takes the inertia motion unit data of the Nano BLE 33 and sends it via Bluetooth BLE using the ArduinoBLE library. The data is transferred as a set of BLE Characteristics as a BLE Service. The Max patch scans for the BLE device, connects to it and then subscribes to the data streams. The output can be normalised, smoothed and then routed via MIDI to music software such as Ableton. The Max patch uses the max-ble external.
Get the Arduino code here, the Max patch here and the 4bf subpatch here.
With Bluetooth Low Energy (BLE), devices do not need to pair in order to communicate data. Instead, a paradigm of central and peripheral devices is used. Central devices scan for Peripheral devices and initiate connections. Peripheral devices advertise their BLE Services and wait for a Central device to connect. In this example, the computer running the Max patch is the Central and the Arduino Nano BLE 33 is the Peripheral.
A given Service on a Peripheral device is made up of one or more Characteristics. A Characteristic contains one or more bytes of data and may be part of a standard profile or a generic type with customised data length. Each Service and Characteristic has a UUID unique identifier that is either a 16-bit or 128-bit string. The Arduino BLE library contains a number of functions to create a BLE Service and Characteristic.
In Arduino, start the BLE radio as a Peripheral device, create a Service with a UUID for the IMU data and then create three Characteristics each with a UUID - one each for the accelerometer, gyroscopic and magnetometer
Read the accelerometer, gyroscopic and magnetometer values using the 9-axis LSM9DS1 inertia motion unit
Then, using a data struct for the x, y and z axes the current values from the 9-axis IMU are stored as floats (if there are new readings available)
The data struct for each inertia type is stored in a data union that is also addressable by a byte array
This byte array from the union, which now contains the updated float values from the IMU, is then read and written to the BLE Characteristic which automatically Notifies the Central device
The Max patch acts as the Central device and can scan for devices with the correct UUID
Once the correct UUID is found from the scan, a connection can be made
Once the connection has been made, each of the three characteristics can be Subscribed to
Every time a new value is written to the Characteristic, the Central device is Notified and if the Max patch is Subscribed to this Characteristic, the new data values are received in Max by the max-ble object
In this case, each Characteristic contains a float value for the x, y and z components for the accelerometer, gyroscopic and magnetometer - making for a total of 3 floats per Characteristic and 3 Characteristics
Each of these floats arrives in Max as a set of four bytes. These four bytes are then converted back to a floating value within Max using the subpatch 4bf.
This data is then scaled and normalised, so as to be visualised via multisliders
The data is also smoothed with a user defined ramp time
Finally, the data can be muted by x, y, z channel and then sent via MIDI CC to other music software
Turns a standard I2C OLED display into an audio spectrum visualiser! Audio signal is connected via a USB connection to the Teensy but can be easily modified for analog input. The Teensy displays the audio following FFT analysis using 128 bands from a mono signal.
The Xiao can be mapped as a control surface to control transport from the cherry switches. I find this useful for my setup. The six buttons are mapped to rewind, fast forward, loop, play, stop, rec.
Upload this file to the Xiao board. In Ableton, open up preferences and go the Link Tempo MIDI tab. Select the XiaoMx script in the Control Surface drop down menu. Select the Xiao as the input and output.
I made a simple library for Arduino called Scales that takes an input byte, and forces the value to sit within either a major scale or natural minor scale.
Usage is simple - include the scales.h file within an Arduino sketch after installation, and use either scales.major(pitch) or scales.minor(pitch) to convert from a chromatic scale to a major or natural minor scale.
I've been wanting to control my camera switching from my modular synth. So I made a setup where a low to high transition on a digital input on an ESP8266 module generates an OSC message on the WiFi network for the ATEM Mini Pro switcher to change cameras. Here, it's triggered from the kick but it could be any clock, gate or trigger signal. Makes use of atemOSC.
MIDI clock messages (see System Real-Time Messages) are used to synchronise software or hardware playback transport using MIDI messages. One device sends the clock messages, and another device receives. The device receiving the messages is synchronised to the device that sends the messages.
MIDI clock messages do not carry song position, location or absolute time. Instead, this is transport information for synchronising.
There are four relevant message types - 'start', 'stop', 'continue' and 'clock'. Start and stop are self explanatory - they represent the transport beginning to play and ending to play. Continue represents a transport that is not at the start of the sequence to carry on from the current position. The clock message is sent 24 times per quarter note (a resolution of 24 ppqn). The clock message interval is, of course, depending on the beats-per-minute and can be calculated as (60 / beats-per-minute) / 24 seconds.
Teensy and the Teensyduino add-on can send and receive MIDI clock messages over USB as a USB-compliant MIDI device.
To receive MIDI clock messages on the Teensy, four functions must be written, that correspond with the following:
void myClock()
void myStart()
void myContinue()
void myStop()
These functions are created by the user, and each function will only be called when that type of message is received by the Teensy.
In setup(), each function must be connected by name to the message type it should respond to.
usbMIDI.setHandleClock(myClock);
usbMIDI.setHandleStart(myStart);
usbMIDI.setHandleContinue(myContinue);
usbMIDI.setHandleStop(myStop);
MIDI clock can be used with Ableton Live to sync the Teensy to the Transport. In Ableton Live, set up the Teensy as a sync output source in the Link MIDI tab in preferences.
When the transport is played in Live, this will then send MIDI clock messages from Live to Teensy.
Here are three examples of sending MIDI clock messages from Live to Teensy.
Turn on LED when transport is playing, turn off when transport is stopped
I needed a way to switch cameras without using my hands.
I connected a simple on / off foot switch from a music keyboard to a Teensy, and I added a Wiznet Wiz820io to the SPI port. I then used AtemOSC to receive network OSC messages from the Teensy to auto transition between camera shots.
Connecting the WizNet 820io is as follows: • Wiznet 820io GND, GND, GND are connected to Teensy GND • Wiznet 820io 3.3V, 3.3V are connected to Teensy 3.3V
• Wiznet 820io PWDN is connected to Teensy 3.3V
• Wiznet 820io nRESET is connected to Teensy digital pin 9 • Wiznet 820io nSS is connected to Teensy digital pin10 • Wiznet 820io MOSI is connected to Teensy digital pin11 • Wiznet 820io MISO is connected to Teensy digital pin12 • Wiznet 820io SCLK is connected to Teensy digital pin 13
As long as the IP address of the computer running the switching software is correct in the Arduino sketch, then atemOSC should see the incoming messages for control. The ATEM Mini Pro needs to be on the same network as the computer and the foot switch.
Sending notes to USB MIDI channel 1 is useful for controlling the gate inputs on 12 drum modules.
Sending notes to USB MIDI channel 2 is useful for controlling the gate and accent inputs on 6 drum modules.
Channel 1 maps chromatic notes (C, C#, D, D# etc) to gate outputs G1 - G12, and will respond to note on and note off events. This is useful for controlling the gate inputs on 12 drum modules.
Channel 2 maps the first six chromatic notes (C, C#, D, D# etc) to gate outputs G1 - G6, and will respond to note on and note off events. If a note on event has a velocity above 99, this will also set gate outputs G7 - G12 high. If a note on event has a velocity below 100, this will also set gate outputs G7 - G12 low. This is useful for controlling the gate and accent inputs on 6 drum modules.
This firmware for the Secret Handshake module turns a wireless USB keyboard into an "Ableton-style Music Keybaord".
The USB received for the wireless USB keyboard can be plugged into the Secret Handshake module, and then the row from A to K will become the white keys of a piano, the row Q to U will become the black keys of a piano, Z and X will change the octave up and down, and C and V will change the velocity up and down.
Overview
This is a USB-powered, Teensy-based interface that has 16 CV outputs and 12 gate outputs. USB MIDI channels 1 - 8 are mapped to CV outputs 1 - 16 for pitch and velocity, and gates 1 - 8 for note on and off events. Gates 9 - 12 are mapped to note on and off events only on channel 9, and also will send a sync and transport signal based on MIDI clock messages if received. CV is 12 bit from 0V to 4V, gates 1 - 8 are 0 and 5V, and gates 9 - 12 are 0 and 3.3v.
See: https://github.com/little-scale/eurorack/tree/master/USB_MIDI_12_gate_16_cv_interface Bill of Materials
1 x 12 Gate 16 CV USB MIDI Interface PCB
1 x Teensy LC or 3.2 and associated header pins
40 x 1k 1% resistors
8 x MCP4822 through hole DAC and 8 8-pin IC sockets
1 x 74HC595 through hole shift register and 1 16-pin IC socket
8 x red 3mm LEDs
4 x green 3mm LEDs
28 x PJ301M-12 3.5 mm sockets
Build Guide
This is the PCB.
Place and solder the 40 x 1k resistors.
Place and solder the 8 x red 3mm LEDs. In the picture, the short negative leg is oriented towards the lower edge of the picture.
Place and solder the 4 x green 3mm LEDs. In the picture, the short negative leg is oriented towards the lower edge of the picture.
Place and solder the 8 x 8-pin IC sockets. In the picture, the indent is oriented towards the upper edge of the picture.
Place and solder the 1 x 16-pin IC socket. In the picture, the indent is oriented towards the upper edge of the picture.
If the Teensy does not have headers, place and solder two rows of headers.
Place and solder the Teensy. In the picture, the USB port is oriented towards the left edge of the photo.
Place and solder 28 x PJ301M-12
Populate the IC sockets, paying attention to the orientation of the MCP3822 DACs and the shift register 74hc595.
The Teensy 3.6 can act as a USB host. This includes support for class-compliant USB MIDI devices, as well as other types of USB devices.
The strength of this is to be able to use USB MIDI controllers without the need for a laptop or similar device, and can interface with Eurorack.
I've made a simple Eurorack module that acts as a USB MIDI host, and has two inputs that can be either gate or CV signals, 4 gate outputs and 2 CV outputs.
This includes an example for Launchpad Mini, PS4 controller, NanoKontrol 2.
Different USB MIDI devices have different Arduino sketches written for them as firmware. Each USB device has different controls, functions and mappings, and so the flexibility of having a USB Host module is weighed against needing to program each device.
I will be adding and updating this project in the coming weeks. My plan is to make a new PCB with buffered outputs, voltage scaling, and busses for IO expansion.
Here are demonstrations for NanoKontrol 2, PS4 controller and Launchpad Mini.
Overview
USB MIDI controllers (such as Launchpad Mini Mk II for example) are common and often quite low in cost.
To interface such a controller with a Eurorack synth system, often a host computer and a MIDI to CV interface might be used. The host computer would take USB MIDI data from the MIDI controller, perhaps store and manipulate that data in some way (e.g. a sequence), using a MIDI to CV converter to then control a Eurorack synth system.
It would be useful to use USB MIDI controllers with Eurorack synth systems without needing a computer and MIDI to CV interface in between the two.
Teensy 3.6 is a great microcontroller that can be programmed using the Arduino IDE. A very useful feature of the Teensy 3.6 is the USB host port.
Using the USB host port, the Teensy 3.6 can act as a host device for a USB MIDI controller. This means that a computer is not required to interpret the USB MIDI messages from a USB MIDI controller.
The Teensy can receive MIDI data sent over USB from the MIDI controller (e.g. faders, knobs, buttons) and can also send MIDI data back to the MIDI controller over USB (e.g. LEDs for buttons, displays).
At the same time, the Teensy can send and receive voltages to and from a Eurorack system. This includes control voltages, gates, triggers and clock signals as both inputs and outputs.
By programming the Teensy, a relationship between USB MIDI data from the controller and the voltages to and from a Eurorack system can be set up.
Example - Launchpad Mini Mk II as Eurorack Sequencer
In this example, the Launchpad and Teensy are working together as a simple Eurorack gate sequencer. This example can be built on extensively, but serves to illustrate the point of USB MIDI host mediation.
Hardware Setup
The USB host port on the Teensy 3.6 needs to have header pins soldered for accessibility, so that the header pins stick up out of the Teensy.
A USB host cable is connected between the USB host post on the Teensy and a USB MIDI device, in this case a Launchpad Mini Mk II.
The desired input and output connections are then connected to the Teensy. In this simple example, the Teensy will provide six gate outputs via six Eurorack-style 3.5mm sockets.
Teensy 3.6 digital pins 0 - 5 are connected via 1k resistors to the signal connection of the 3.5mm sockets. Teensy 3.6 ground is connected to the ground connection of the 3.5mm sockets.
If more complexity was required, additional outputs, inputs, buttons and pots could be connected to the Teensy to extend this example beyond the six gates.
The six gate outputs are connected to gate inputs in a Eurorack system, which in the demo video is triggering some Erica Synths, Make Noise and Doepfer modules.
Software Setup
The Arduino code can be downloaded here. The Teensyduino extension should be installed, the board should be set to Teensy 3.6 and the USB mode to Serial. The code is not very concise, but is hopefully easy enough to read.
The code takes button inputs from the Launchpad Mini Mk II grid and stores these button presses in an array which holds the pattern. The Teensy also controls the LED lights on the Launchpad, and has an indicator as to which step is currently playing.
Each row represents a trigger output. Each column represents a step.
Pressing a button in the grid once will make sure it plays each loop of eight steps. Pressing a button a second time will play that gate every odd loop. Pressing a button a third time will play that gate every even loop. Pressing a button a fourth time will turn that stop off completely.
The const int interval_time, which defaults to 90, sets the speed of the sequencer.
Expansion
Obviously, this simple example can be greatly expanded on. The next step in this project is to build a generic PCB with perhaps 8 gate outputs, 4 CV outputs, 4 gate inputs, and two buttons and two pots, and then start writing code to adapt a number of USB MIDI controllers to Eurorack.