Delay midi clock events using Arduino+Midi Shield

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, lisa, Joe.

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Sun Sep 13, 2020 11:52 pm

I have what may seem like a strange need, but I want to introduce midi clock delay via an Arduino+Midi Shield.

Arduino UNO
Arduino Midi library
Cheap Midi Shield
Image

Why would I want to introduce delay? I have synth connected via USB audio going through mini PC with some effects running on several channels out to an audio interface. The latency is pretty horrible. So when I start the sequencer on the synth - the downstream midi clocked modules are out of sync with the Audio out of the interface.

main module ->usb audio-> mini PC -> Effects soft -> audio interface
|
+------midi clock--------> Korg Volca Sample

I can get the desired midi delay using Ableton Live's "MIDI Clock Sync Delay". Using that function will cause a midi clock sync delay as below.

as can be observed there is always a 20-21ms delay between when the commands are issued by the "Main module" and the volca Sample. When there is such a midi clock sync delay, the two are in sync (realistically, the DSP delayed Audio from Main Module is in sync with midi clock delayed volca sample audio).

I am trying to implement this in Arduino. First I thought simply delaying the outgoing F8 clock messages by 20 milliseconds (for 120bpm), but introducing a delay, causes the clock to be really off because the clock is itself streaming clock every 21ms because.
The other thing I then tried was counting the number of incoming cock packets after clock start and "ignoring" the first 4-5 clock packets and then simply reading midi clock and forwarding them.
I then tried to queue and dequeue messages.

I am at a bit of a loss. Is there a standard algorithm that people implement to do this?

I did notice when tracing the below stream using Midi monitor that there is a decreasing time between midi clock from Main module to Volca, the delay is about 4ms, 3ms, 3ms, 2ms, 1ms, then it switches to increasing again. Does anyone know how this is done on an uPD?

04:11:07.558 From Main Module Clock F8
04:11:07.558 From Main Module Start FA
04:11:07.579 From Main Module Clock F8
04:11:07.600 From Main Module Clock F8
04:11:07.621 From Main Module Clock F8
04:11:07.641 From Main Module Clock F8
04:11:07.644 To Volca Start FA
04:11:07.644 To Volca Clock F8
04:11:07.662 From Main Module Clock F8
04:11:07.666 To Volca Clock F8
04:11:07.683 From Main Module Clock F8
04:11:07.686 To Volca Clock F8
04:11:07.704 From Main Module Clock F8
04:11:07.707 To Volca Clock F8
04:11:07.725 From Main Module Clock F8
04:11:07.727 To Volca Clock F8
04:11:07.746 From Main Module Clock F8
04:11:07.747 To Volca Clock F8
04:11:07.766 From Main Module Clock F8
04:11:07.767 To Volca Clock F8
04:11:07.787 From Main Module Clock F8
04:11:07.788 To Volca Clock F8
04:11:07.808 From Main Module Clock F8
04:11:07.808 To Volca Clock F8
04:11:07.828 To Volca Clock F8
04:11:07.829 From Main Module Clock F8
04:11:07.848 To Volca Clock F8
04:11:07.850 From Main Module Clock F8
04:11:07.868 To Volca Clock F8
04:11:07.871 From Main Module Clock F8
04:11:07.888 To Volca Clock F8
04:11:07.891 From Main Module Clock F8
04:11:07.908 To Volca Clock F8
04:11:07.912 From Main Module Clock F8
04:11:07.928 To Volca Clock F8
04:11:07.933 From Main Module Clock F8
04:11:07.948 To Volca Clock F8
04:11:07.954 From Main Module Clock F8
04:11:07.968 To Volca Clock F8
04:11:07.975 From Main Module Clock F8
04:11:07.988 To Volca Clock F8
04:11:07.996 From Main Module Clock F8
04:11:08.008 To Volca Clock F8
04:11:08.016 From Main Module Clock F8
04:11:08.029 To Volca Clock F8
04:11:08.037 From Main Module Clock F8
04:11:08.049 To Volca Clock F8
04:11:08.058 From Main Module Clock F8
04:11:08.069 To Volca Clock F8
04:11:08.079 From Main Module Clock F8
04:11:08.090 To Volca Clock F8
04:11:08.100 From Main Module Clock F8
04:11:08.110 To Volca Clock F8
04:11:08.121 From Main Module Clock F8
04:11:08.131 To Volca Clock F8
04:11:08.141 From Main Module Clock F8
04:11:08.151 To Volca Clock F8
04:11:08.162 From Main Module Clock F8
04:11:08.172 To Volca Clock F8
04:11:08.183 From Main Module Clock F8
04:11:08.192 To Volca Clock F8
04:11:08.204 From Main Module Clock F8
04:11:08.213 To Volca Clock F8
04:11:08.225 From Main Module Clock F8
04:11:08.234 To Volca Clock F8
04:11:08.246 From Main Module Clock F8
04:11:08.254 To Volca Clock F8
04:11:08.266 From Main Module Clock F8
04:11:08.284 From Main Module Stop FC
04:11:08.275 To Volca Clock F8
04:11:08.287 From Main Module Clock F8
04:11:08.290 To Volca Stop FC
04:11:08.308 From Main Module Clock F8
04:11:08.329 From Main Module Clock F8
04:11:08.350 From Main Module Clock F8
04:11:08.371 From Main Module Clock F8
04:11:08.391 From Main Module Clock F8
04:11:08.412 From Main Module Clock F8
Last edited by jny303 on Mon Sep 14, 2020 12:11 pm, edited 1 time in total.

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Mon Sep 14, 2020 1:31 am

sorry to ask this, but it is a bit unclear to me, have you tried delaying the midi signal in the arduino by 20ms? i read that you delayed it by 20s, and am not sure if that was a typo. also, is there a downside to using the ableton delay, which sounded like it worked, maybe?
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Mon Sep 14, 2020 12:32 pm

Sorry - I updated the post, that was meant to read 20ms.

The issue is delaying every clock message by that amount causes issues around 120 bpm+

I read a post by Emilie of Mutable saying that the way to do this would be to "swallow" a certain number of incoming clock messages , then transmitting the rest which I also tried doing, but I didn't find a suitable implementation.

It appears that Ableton does this by slowly decreasing the time between the delay but the message interval is always 20ms between clock messages.
Δlast-new starts at 4ms delay, then goes to 0ms then increases again - I tried to add 2ms delay again to the midi clock handler but that didn't do anything noticeable.


seq# Δlast-new Δpriorclck timestmp source_dest midi hex
641 20 04:11:07.641 From Main Module Clock F8
644 3 04:11:07.644 To Volca Start FA
644 0 04:11:07.644 To Volca Clock F8
662 18 21 04:11:07.662 From Main Module Clock F8
666 4 22 04:11:07.666 To Volca Clock F8
683 17 21 04:11:07.683 From Main Module Clock F8
686 3 20 04:11:07.686 To Volca Clock F8
704 18 21 04:11:07.704 From Main Module Clock F8
707 3 21 04:11:07.707 To Volca Clock F8
725 18 21 04:11:07.725 From Main Module Clock F8
727 2 20 04:11:07.727 To Volca Clock F8
746 19 21 04:11:07.746 From Main Module Clock F8
747 1 20 04:11:07.747 To Volca Clock F8
766 19 20 04:11:07.766 From Main Module Clock F8
767 1 20 04:11:07.767 To Volca Clock F8
787 20 21 04:11:07.787 From Main Module Clock F8
788 1 21 04:11:07.788 To Volca Clock F8
808 20 21 04:11:07.808 From Main Module Clock F8
808 0 20 04:11:07.808 To Volca Clock F8
828 20 20 04:11:07.828 To Volca Clock F8
829 1 21 04:11:07.829 From Main Module Clock F8

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Mon Sep 14, 2020 2:37 pm

can you post your code for the 20ms delay? that should work regardless of BPM, depending upon implementation. a simple, yet memory intensive way of implementing it would be treat it just like a digital audio delay. make a ring buffer and clock through your midi messages. this will quantize your messages, but sub millisecond timing errors probably wont be an issue. the arduino had 2k of memory, so lets say you used half of that for a 20ms buffer, youd get 20ms/1000 = 20us quantization, which is probably excessive. you could even use a potentiometer to set the delay time via the ADC.
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Mon Sep 14, 2020 11:39 pm

The code is simple, a 20ms at midi start and the same for subsequent midi clock messages.


Code: Select all


#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();


void hMClk(byte clktck)
{

  delayMicroseconds(2000) ;
    MIDI.sendClock() ;

}


void hMCnt(byte mcont)
{
  MIDI.sendContinue() ;
}

void hStrt(byte mstrt)
{
  delayMicroseconds(2000) ;
  MIDI.sendStart() ;
}

void hStp(byte mstp)
{
  MIDI.sendStop() ;
  
}


// Setup
void setup() {
  MIDI.setHandleClock(hMClk) ;
  MIDI.setHandleContinue(hMCnt) ;
  MIDI.setHandleStart(hStrt) ;
  MIDI.setHandleStop(hStp) ;


  MIDI.begin();
  MIDI.turnThruOff();
}


// Program
void loop() {
  MIDI.read();
}

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Tue Sep 15, 2020 2:18 am

ok, using the delayMicroseconds() is blocking, meaning nothing else can happen (depends upon if its happening in interrupt), so if another message was supposed to be sent out in that time, it wont happen. also, it looks like its set to 2ms, not 20ms (maybe that was just for testing? did it give a consistent 2ms delay?). i have to admit, i dont know much about the midi library, but i could help write something that does what you want. basic structure would be:

1. set up an array of 256 bytes and pointer for this array.
2. set up serial port for send/recieve at midi baud rate.
3. set up an interrupt every 20ms/256 = 78us. its possible if all other functions were handled in interrupts, then this could just be done with delayMicroseconds(), but a timer interrupt would be more accurate.
4. every 78us, read out to the serial port whatever data the pointer is pointing at (if that value is 0, dont read it out), and then check if there is new data available at the serial port. if there is, write that data, if not, write a 0. then increment the pointer and go back to waiting. if the pointer is an 8b value, you can just let it roll over, otherwise you would have to check that it hit the end and put it back to the beginning.

by varying the interrupt timing, you could vary the delay time, probably from 2ms to 100ms. for much longer delays, it would be better to just timestamp all midi messages, and then calculate the time to send it out.
openmusiclabs.com

User avatar
Mungo
Super Deluxe Wiggler
Posts: 1156
Joined: Fri Jan 04, 2013 8:12 pm

Re: Delay midi clock events using Arduino+Midi Shield

Post by Mungo » Tue Sep 15, 2020 2:44 am

guest wrote:
Tue Sep 15, 2020 2:18 am
4. every 78us, read out to the serial port whatever data the pointer is pointing at (if that value is 0, dont read it out), and then check if there is new data available at the serial port. if there is, write that data, if not, write a 0. then increment the pointer and go back to waiting. if the pointer is an 8b value, you can just let it roll over, otherwise you would have to check that it hit the end and put it back to the beginning.
0 (0x00) is a valid midi byte, so you'd want to pick something else for the null value. 0xF4, 0xF5, 0xF9, 0xFD are all "not used".

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Tue Sep 15, 2020 3:31 am

thats a really good piont, thanks for that. i had totally spaced on the data portion of the midi messages. those can take any value 0-127.
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Tue Sep 15, 2020 5:17 pm

I chose to try 2ms delays because I saw that Ableton does this internally when doiing sync delay , like I mentioned, it seems to start at 4ms difference then goes to 0.

04:11:07.662 From Main Module Clock F8
04:11:07.666 To Volca Clock F8


That would be very interesting - is that something that has to be done using Atmel Studio - unfortunately I don't know much about interrupts but I should take this opportunity to learn.
Can the standard arduino midi library be leveraged? It seems the midi library handles these events are they occur - are those based on it's own interrupt that we can extend or work into the implementation above ? Also would the above method still work with the Arduino Shield I am using?

Thanks again for looking into this!!

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Tue Sep 15, 2020 5:55 pm

it is possible to do it with the arduino ide and your shield. if youre willing to give it a try, i can help out with things to try. we might be able to use midi library, although the standard serial library might be easier. is there some good documentation on the midi library i could read? i went to the github, but it was a bit confusing.
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Tue Sep 15, 2020 7:37 pm

The midi library doc is here :https://fortyseveneffects.github.io/ard ... i_library/.

I have seen several examples of midi work using just the serial. The Midi library seems to handle all the incoming messages with callback functions.

Unfortunately I am using the delay in the callback function against their advice in the comments but I didnt know where else to put it.

void hMClk(byte clktck)
{
MIDI.send(MIDI.getType(),
MIDI.getData1(),
MIDI.getData2(),
MIDI.getChannel());
// Try to keep your callbacks short (no delays ect)
// otherwise it would slow down the loop() and have a bad impact
// on real-time performance.

}

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Tue Sep 15, 2020 9:29 pm

yeah, there looks like there is a lot of overhead in that library. lets see if we can get something up and running with just the serial library. first thing would be to check that we can send and recieve just fine with it. set up the serial port for 31.25kbps and write a short program that checks if serial is avaiable, and if so, just sends it back out. something like:

if (Serial.available) {
byte input = serial.read();
serial.write(input);
}
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Wed Sep 16, 2020 12:51 am

if that works (straight up midi pass-thru), then we should try storing in a buffer and playing back:

Code: Select all

byte i = 0;
byte data[256];

if (Serial.available() > 0) {
  data[i] = Serial.read();
  Serial.write(data[i]);
  i++;
}
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Wed Sep 16, 2020 2:15 pm

Ok this works with the shield and passed the midi clock unaltered.
Sorry for the delay in testing.
Is the timed interrupt the way to implement this - but use no prescaler? Is receiving data on the serial port an interrupt in itself and so the issue would be to pass what was received out via midi in an ISR?

Code: Select all


// MIDI clock as per Little Scale
// http://little-scale.blogspot.com/2008/05/how-to-deal-with-midi-clock-signals-in.html

byte midi_start = 0xfa;
byte midi_stop = 0xfc;
byte midi_clock = 0xf8;
byte midi_continue = 0xfb;


// Variables

bool play_flag = false;
byte i = 0;
byte data[256];


// Setup
void setup() {
  Serial.begin(31250);

}


// Program
void loop() {

  if (Serial.available() ) {
    data[i] = Serial.read();
    Serial.write(data[i]);
    i++;
    
    if (data == midi_start) { // if midi in start
      
      Serial.write(midi_start); // send midi out start

      play_flag = true;
    }

    if (data == midi_continue) { // if midi in continue
      Serial.write(midi_continue); // send midi out continue

      play_flag = true;
    }

    else if (data == midi_stop) { // if midi in stop
      Serial.write(midi_stop); // send midi out stop
      play_flag = false;

    }

    else if ((data == midi_clock) && (play_flag == true)) {
      Serial.write(midi_clock);
    }
  }
}

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Wed Sep 16, 2020 2:53 pm

awesome, glad its passing data. let see if we can get the delay added in. for right now we can just do a delay() and see what happens.

Code: Select all

byte i = 0;
byte data[256];


// Setup
void setup() {
  for (int j = 0; j < 256; j++) data[j] = 0xf4; // preload with null value
  Serial.begin(31250);
}


// Program
void loop() {
  if(data[i] == 0xf4); // do nothing
  else Serial.write(data[i]);
  if (Serial.available() ) data[i] = Serial.read();
  else data[i] = 0xf4;
  i++;
  delayMicroseconds(78);
}
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Wed Sep 16, 2020 11:25 pm

This worked - however it is not noticeable, or perhaps so slight that it did not delay the clock effectively.

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Thu Sep 17, 2020 1:05 am

does changing the delay time change that at all?
openmusiclabs.com

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Thu Sep 17, 2020 2:22 am

so, i ran this code so i could test it with the serial monitor

Code: Select all

byte i = 0;
byte data[256];


// Setup
void setup() {
  for (int j = 0; j < 256; j++) data[j] = 0xf4; // preload with null value
  Serial.begin(9600);
}


// Program
void loop() {
  if(data[i] == 0xf4); // do nothing
  else Serial.write(data[i]);
  if (Serial.available() ) data[i] = Serial.read();
  else data[i] = 0xf4;
  i++;
  delayMicroseconds(7800);
}
and it worked fine (gave 2s delay).
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Thu Sep 17, 2020 3:08 pm

Hi - I just had a chance to try it again with the module and all the same effects settings to produce the audio latency - the arduino midi sync delay works really well - at all tempos - at least from 90bpm to 140bpm, which is my usual jamming range.
This is amazing - thank you!!!!!
How did you come to the 78us calculation?

Code: Select all



// jny303 and Guest @ muffwiggler 
//
// MIDI clock as per Little Scale
// http://little-scale.blogspot.com/2008/05/how-to-deal-with-midi-clock-signals-in.html

byte midi_start = 0xfa;
byte midi_stop = 0xfc;
byte midi_clock = 0xf8;
byte midi_continue = 0xfb;


// Variables

bool play_flag = false;
byte i = 0;
byte data[256];


// Setup
void setup() {
  for (int j = 0; j < 256; j++) data[j] = 0xf4; // preload with null value
  Serial.begin(31250);

}


// Program
void loop() {

 if(data[i] == 0xf4); // do nothing
  else Serial.write(data[i]);
  if (Serial.available() ) data[i] = Serial.read();
  else data[i] = 0xf4;
  i++;
  delayMicroseconds(78);
}

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Thu Sep 17, 2020 3:14 pm

so, the 78us is 20ms/256. there is some variation in this as it takes ~6us to run the loop when there is no data, and ~14us when there is data. but i figure that is a reasonable level of variation. if you want, you can make the delay variable with a potentiometer. maybe once for every 1,000 times through the loop you can do analogRead and update the delay time with the read value.

glad to hear its working!
openmusiclabs.com

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Thu Sep 17, 2020 9:38 pm

genius idea - I will try that 100%. For now - I am jammin!!

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Fri Sep 18, 2020 3:19 am

a quick way to do it would be:

Code: Select all

byte i = 0;
byte data[256];
unsigned int rate = 78;

// Setup
void setup() {
  for (int j = 0; j < 256; j++) data[j] = 0xf4; // preload with null value
  Serial.begin(31250);
}


// Program
void loop() {
  if(data[i] == 0xf4); // do nothing
  else Serial.write(data[i]);
  if (Serial.available() ) data[i] = Serial.read();
  else data[i] = 0xf4;
  i++;
  if (i == 0) rate = analogRead(0);
  delayMicroseconds(rate);
}
that will give a 2ms to 250ms variable delay time. if the 200ms is excessive, you can get finer control and faster loop times by defining rate as a byte, and shifting it to the right by 2 (rate = analogread() >> 2). that will give 2ms to 65ms.
openmusiclabs.com

User avatar
Mungo
Super Deluxe Wiggler
Posts: 1156
Joined: Fri Jan 04, 2013 8:12 pm

Re: Delay midi clock events using Arduino+Midi Shield

Post by Mungo » Fri Sep 18, 2020 6:43 am

Too long a delay and it'll drop/miss bytes. The maximum possible is 1 second/(31250 baud/9 bits) = 288us including the instructions outside the delay call.

This is the point where it's better going to a fixed interrupt period to keep the timing accurate, and varying the depth of the delay buffer (and correctly flushing it when reducing the delay length).

jny303
Learning to Wiggle
Posts: 47
Joined: Thu Apr 13, 2017 2:18 am
Location: NY

Re: Delay midi clock events using Arduino+Midi Shield

Post by jny303 » Sun Sep 20, 2020 8:56 pm

guest wrote:
Fri Sep 18, 2020 3:19 am
a quick way to do it would be:

Code: Select all

byte i = 0;
byte data[256];
unsigned int rate = 78;

// Setup
void setup() {
  for (int j = 0; j < 256; j++) data[j] = 0xf4; // preload with null value
  Serial.begin(31250);
}


// Program
void loop() {
  if(data[i] == 0xf4); // do nothing
  else Serial.write(data[i]);
  if (Serial.available() ) data[i] = Serial.read();
  else data[i] = 0xf4;
  i++;
  if (i == 0) rate = analogRead(0);
  delayMicroseconds(rate);
}
that will give a 2ms to 250ms variable delay time. if the 200ms is excessive, you can get finer control and faster loop times by defining rate as a byte, and shifting it to the right by 2 (rate = analogread() >> 2). that will give 2ms to 65ms.
I was looking at how to "quantize" this so that the values are somewhat stable and predictable. I was thinking the adafruit I2C digi pot or just another Arduino with the LCD + button shield and output a voltage via a pwm pin, so that rather than using the pot, I have a "quantized" rate - by which I can adjust the delay.

User avatar
guest
Super Deluxe Wiggler
Posts: 4519
Joined: Mon Aug 19, 2013 11:49 am

Re: Delay midi clock events using Arduino+Midi Shield

Post by guest » Sun Sep 20, 2020 9:07 pm

how about a rotary encoder that increases a certain amount per click? the up/down buttons would be pretty easy as well. you could probably do it all with the same arduino, as long as none of it requires the serial port.
openmusiclabs.com

Post Reply

Return to “Music Tech DIY”