Added MIDI DIN handeling

This commit is contained in:
Oleksiy 2020-10-23 00:35:32 +03:00
parent 82a799e1b2
commit dcd53afeed
2 changed files with 11 additions and 4 deletions

View File

@ -4,11 +4,13 @@
#include <Smooth.h>
#include <AutoMap.h> // maps unpredictable inputs to a range
#include <MIDIUSB.h>
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
#define CONTROL_RATE 64
bool gate = 0;
// desired carrier frequency max and min, for AutoMap
const int MIN_CARRIER_FREQ = 22;
@ -64,10 +66,14 @@ void noteOff(byte channel, byte note, byte velocity) {
}
void setup(){
startMozzi();
pinMode(LED_BUILTIN_TX,INPUT); //switch rx and tx leds of, so they don't blink on midi
pinMode(LED_BUILTIN_RX,INPUT);
startMozzi();
MIDI.setHandleNoteOn(noteOn);
MIDI.setHandleNoteOff(noteOff);
MIDI.begin();
}
@ -114,6 +120,8 @@ void updateControl(){
float mod_speed = (float)kMapModSpeed(LDR2_value)/1000;
kIntensityMod.setFreq(mod_speed);
MIDI.read();
}

View File

@ -7,5 +7,4 @@ DIY Arduino-based synth built with [Mozzi library](https://sensorium.github.io/M
- Add note buffer
- Tidy up the code (e.g. remove LDR references)
- Tune the values and remap the knobs
- Add MIDI DIN connector
- Add LICENCE