Reply To: Set a bpm speed in arduino code

Home Forums Products NS1nanosynth Set a bpm speed in arduino code Reply To: Set a bpm speed in arduino code



Nice one! Thanks. I might need to find some equipment to do those kinds of experiments also! Could you maybe share a picture of it?

I managed to do it with the simple blinking code 🙂 I set the HIGH delay to 0, and the LOW delay to whatever bpm (converted to milliseconds) I want. 120bpm is 500ms.

int BPMPin = 11; // BPM out connected to digital pin 11

void setup()
pinMode(BPMPin, OUTPUT); // sets the digital pin as output

void loop()
digitalWrite(BPMPin, HIGH); // sets the LED on
delay(0); // waits for a second
digitalWrite(BPMPin, LOW); // sets the LED off
delay(500); // sets BPM in milliseconds

There seems to be a problem with the gate out from the sequencer when I do this. If I change anything on the ADSR, the sound stops and I need to reset the Arduino board. Any idea why that happens?