A basic Max for Live device that can be combined with a Teensy and one or more MCP4922 DAC chips. MIDI notes are converted to 12-bit data that represents a voltage range of 0 - 5V, at a rate of 1V per octave. Pitchbend is mapped, too, with a user defined range. Note-ons and offs trigger gate events. The note length can be left 'as-is' or set as a predefined length.
Very rough demo shown below, using a Teensy 2.0, one MCP4922, gate output and pitch CV output controlling a Moog Mother-32.
Download this device here: http://milkcrate.com.au/_other/downloads/M4L/little-scale.midi.notes.to.pitch.cv.gate.amxd
Showing posts with label MCP4922. Show all posts
Showing posts with label MCP4922. Show all posts
Thursday, December 01, 2016
MIDI to 1V Per 8ve CV and Gate Max for Live Device
Labels:
arduino,
control voltage and gate,
MCP4922,
mother-32,
teensy
MIDI to MCP4922 DAC CV and Gate / Trigger
I've added CV as well as Gate / Trigger output to the Octo DAC setup. Note-on events will trigger a gate on, while note-off events will trigger a gate-off. The eight DAC outputs remain the same. Each gate output has a dedicated digital pin on the Teensy 2.0.
Download the code here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC_GATE/
Download the code here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC_GATE/
Tuesday, November 29, 2016
Monday, November 21, 2016
Moog Mother-32: MIDI to Quad DAC CV Control
An example of using two MCP4922 that are controlled via MIDI. The four DAC channels are used to control filter frequency, filter resonance, LFO frequency and VCA modulation.
In Ableton Live, four LFO generators are used to send MIDI continuous controller data out to the Teensy, which in turn then uses the data to set the DAC voltage level of the MCP4922 chips via the SPI bus.
Multiple MIDI-Controlled 12-Bit DACs via Teensy / Arduino
Overview
The MCP4922 is a 12-bit, two channel, SPI-based DAC - and can be easily connect to a studio setup using a Teensy via MIDI!This is an easy way of adding a 0 - 5V or 0 - 3.3V 4096-step DAC to a MIDI sequencing environment. Using one Teensy, multiple MCP4922 chips can be easily controlled, and mapped via MIDI data.
The cost of these chips is relatively low - around AUD$3 per chip or $1.50 per DAC channel - and they don't require any additional components for basic implementation.
Hardware
Hardware connection is very similar to the previous post on the MCP4922. To connect multiple MCP4922 to a Teensy microcontroller, the following connections should be made:
This way, only a particular MCP4922 is selected when data is written to the SPI bus.
Software
The SPI library can be used to easily write data to the DAC. In the example below, a function is written that has a chip select pin value, a DAC channel value and a DAC output value between 0 - 4095. This function writes to the SPI bus and updates the DAC output.
This function is then connected to MIDI via MIDI control messages.
This particular sketch supports both high res MIDI and normal res MIDI. The controller number that is used determines the DAC channel number as well as the MCP4922 chip.
In this example, the mapping is as follows:
Download here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC_MULTI_MIDI/
The MCP4922 is a 12-bit, two channel, SPI-based DAC - and can be easily connect to a studio setup using a Teensy via MIDI!This is an easy way of adding a 0 - 5V or 0 - 3.3V 4096-step DAC to a MIDI sequencing environment. Using one Teensy, multiple MCP4922 chips can be easily controlled, and mapped via MIDI data.
The cost of these chips is relatively low - around AUD$3 per chip or $1.50 per DAC channel - and they don't require any additional components for basic implementation.
Hardware
Hardware connection is very similar to the previous post on the MCP4922. To connect multiple MCP4922 to a Teensy microcontroller, the following connections should be made:
- Teensy 5V or 3.3V (depending on model) to MCP4922 VDD (Pin 1) - all MCP4922 have this connection in common
- Teensy SPI Chip Select pin (user-designated) to MCP4922 CS (Pin 3) - each individual MCP4922 chip has a corresponding pin on the Teensy microcontroller. In this example, I am using digital pin 4 for the CS pin of MCP4922 #1 and then digital pin 5 for the CS pin of MCP4922 #2.
- Teensy SPI Serial Clock pin (as defined in the SPI library) to MCP4922 SCK (Pin 4) - all MCP4922 have this connection in common
- Teensy SPI Digital Out (as defined in the SPI library) to MCP4922 SDI (Pin 5) - all MCP4922 have this connection in common
- Teensy 5V or 3.3V (depending on model) to MCP4922 V REF A (Pin 13) - all MCP4922 have this connection in common
- Teensy ground to MCP4922 VSS (Pin 12) - all MCP4922 have this connection in common
- Teensy 5V or 3.3V (depending on model)to MCP4922 V REF B (Pin 11) - all MCP4922 have this connection in common
- Teensy 5V or 3.3V (depending on model) to MCP4922 SHDN - all MCP4922 have this connection in common
- Teensy ground to MCP4922 LDAC - all MCP4922 have this connection in common
- MCP4922 V OUT A (Pin 14) is the output for DAC A - all MCP4922 have this connection in common
- MCP4922 V OUT B (Pin 10) is the output for DACB - all MCP4922 have this connection in common
This way, only a particular MCP4922 is selected when data is written to the SPI bus.
Software
The SPI library can be used to easily write data to the DAC. In the example below, a function is written that has a chip select pin value, a DAC channel value and a DAC output value between 0 - 4095. This function writes to the SPI bus and updates the DAC output.
This function is then connected to MIDI via MIDI control messages.
This particular sketch supports both high res MIDI and normal res MIDI. The controller number that is used determines the DAC channel number as well as the MCP4922 chip.
In this example, the mapping is as follows:
- CC 0 paired with CC 32 will send a high resolution value to MCP4922 chip 1 DAC 0
- CC 1 paired with CC 33 will send a high resolution value to MCP4922 chip 1 DAC 1
- CC 2 paired with CC 34 will send a high resolution value to MCP4922 chip 2 DAC 0
- CC 3 paired with CC 35 will send a high resolution value to MCP4922 chip 2 DAC 1
- CC 64 will send a normal resolution value to MCP4922 chip 1 DAC 0
- CC 65 will send a normal resolution value to MCP4922 chip 1 DAC1
- CC 66 will send a normal resolution value to MCP4922 chip 2 DAC 0
- CC 67 will send a normal resolution value to MCP4922 chip 2 DAC 1
Download here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC_MULTI_MIDI/
MIDI-controlled 12-bit DAC
Overview
The MCP4922 is a 12-bit, two channel, SPI-based DAC - and can be easily connect to a studio setup using a Teensy via MIDI!This is an easy way of adding a 0 - 5V or 0 - 3.3V 4096-step DAC to a MIDI sequencing environment.
The cost of these chips is relatively low - around AUD$3 per chip or $1.50 per DAC channel - and they don't require any additional components for basic implementation.
Hardware
Hardware connection is identical to the previous post on the MCP4922. To connect the MCP4922 to a Teensy microcontroller, the following connections should be made:
Software
The SPI library can be used to easily write data to the DAC. In the example below, a function is written that has a chip select pin value, a DAC channel value and a DAC output value between 0 - 4095. This function writes to the SPI bus and updates the DAC output.
This function is then connected to MIDI via MIDI control messages.
This particular sketch supports both high res MIDI and normal res MIDI.
Download here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC_MIDI/
The MCP4922 is a 12-bit, two channel, SPI-based DAC - and can be easily connect to a studio setup using a Teensy via MIDI!This is an easy way of adding a 0 - 5V or 0 - 3.3V 4096-step DAC to a MIDI sequencing environment.
The cost of these chips is relatively low - around AUD$3 per chip or $1.50 per DAC channel - and they don't require any additional components for basic implementation.
Hardware
Hardware connection is identical to the previous post on the MCP4922. To connect the MCP4922 to a Teensy microcontroller, the following connections should be made:
- Teensy 5V or 3.3V (depending on model) to MCP4922 VDD (Pin 1)
- Teensy SPI Chip Select pin (either user-designated or as defined in the SPI library) to MCP4922 CS (Pin 3)
- Teensy SPI Serial Clock pin (as defined in the SPI library) to MCP4922 SCK (Pin 4)
- Teensy SPI Digital Out (as defined in the SPI library) to MCP4922 SDI (Pin 5)
- Teensy 5V or 3.3V (depending on model) to MCP4922 V REF A (Pin 13)
- Teensy ground to MCP4922 VSS (Pin 12)
- Teensy 5V or 3.3V (depending on model)to MCP4922 V REF B (Pin 11)
- Teensy 5V or 3.3V (depending on model) to MCP4922 SHDN
- Teensy ground to MCP4922 LDAC
- MCP4922 V OUT A (Pin 14) is the output for DAC A
- MCP4922 V OUT B (Pin 10) is the output for DACB
Software
The SPI library can be used to easily write data to the DAC. In the example below, a function is written that has a chip select pin value, a DAC channel value and a DAC output value between 0 - 4095. This function writes to the SPI bus and updates the DAC output.
This function is then connected to MIDI via MIDI control messages.
This particular sketch supports both high res MIDI and normal res MIDI.
Download here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC_MIDI/
Teensy and MCP4922 Dual Channel 12-Bit DAC
Overview
The MCP4922 is a 12-bit, two channel, SPI-based DAC. As microcontrollers do not often have many DAC outputs (and are often limited to PWM outputs), cheap external DACs are a great way of increasing the analog output options of a microcontroller such as the Teensy.
The cost of these chips is relatively low - around AUD$3 per chip or $1.50 per DAC channel - and they don't require any additional components for basic implementation.
Hardware
To connect the MCP4922 to a Teensy microcontroller, the following connections should be made:
Software
The SPI library can be used to easily write data to the DAC. In the example below, a function is written that has a chip select pin value, a DAC channel value and a DAC output value between 0 - 4095. This function writes to the SPI bus and updates the DAC output.
Download here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC/
The MCP4922 is a 12-bit, two channel, SPI-based DAC. As microcontrollers do not often have many DAC outputs (and are often limited to PWM outputs), cheap external DACs are a great way of increasing the analog output options of a microcontroller such as the Teensy.
The cost of these chips is relatively low - around AUD$3 per chip or $1.50 per DAC channel - and they don't require any additional components for basic implementation.
Hardware
To connect the MCP4922 to a Teensy microcontroller, the following connections should be made:
- Teensy 5V or 3.3V (depending on model) to MCP4922 VDD (Pin 1)
- Teensy SPI Chip Select pin (either user-designated or as defined in the SPI library) to MCP4922 CS (Pin 3)
- Teensy SPI Serial Clock pin (as defined in the SPI library) to MCP4922 SCK (Pin 4)
- Teensy SPI Digital Out (as defined in the SPI library) to MCP4922 SDI (Pin 5)
- Teensy 5V or 3.3V (depending on model) to MCP4922 V REF A (Pin 13)
- Teensy ground to MCP4922 VSS (Pin 12)
- Teensy 5V or 3.3V (depending on model)to MCP4922 V REF B (Pin 11)
- Teensy 5V or 3.3V (depending on model) to MCP4922 SHDN
- Teensy ground to MCP4922 LDAC
- MCP4922 V OUT A (Pin 14) is the output for DAC A
- MCP4922 V OUT B (Pin 10) is the output for DACB
Software
The SPI library can be used to easily write data to the DAC. In the example below, a function is written that has a chip select pin value, a DAC channel value and a DAC output value between 0 - 4095. This function writes to the SPI bus and updates the DAC output.
Download here: http://milkcrate.com.au/_other/downloads/arduino/MCP4922_DAC/
Subscribe to:
Posts (Atom)











