Boss DR-202 Backlight & Sync Pulse
#dr202 now outputs a sync pulse compatible with #pocketoperator#volca and my recent looper sync mod. new backlight beatcounter defaults to the kind of orange you expect in 1998, but slowly color drifts when stopped. but how? #digispark used to sense the voltage change when the light behind the play button blinks.
code for arduino digispark digistump
// woz supposedly Jan 2019 - converts LED on in the DR 202 to a sync pulse for looper, drum machines and sequencers
// #include <Arduino.h>
#include <Adafruit_NeoPixel.h>
// #include "DigiKeyboard.h"
#define relay 0
#define led 4
#define in A0
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, led, NEO_GRB + NEO_KHZ800);
int beat;
int beatreset;
int maxBri = 255;
int j;
int c;
int colorMap[3][4] =
{
{255,255,255,255},
{64,64,64,64},
{0,0,0,0},
};
void setup() {
// Serial.begin(9600);
strip.begin();
strip.show();
strip.setBrightness(250);
pinMode(relay, OUTPUT); //relay
pinMode(led, OUTPUT); //LED pin
pinMode(in, INPUT); //sync input
digitalWrite(relay, LOW);
}
void loop() {
inaction();
}
void inaction() {
int x = analogRead(in);
if (x<690){
// DigiKeyboard.println(x);
digitalWrite(relay, HIGH);
colorMap[0][beat]=255;
colorMap[1][beat]=0;
colorMap[2][beat]=255;
strip.setPixelColor(beat, strip.Color(colorMap[0][beat], colorMap[1][beat], colorMap[2][beat]));
strip.show();
delay(15);
digitalWrite(relay, LOW);
delay(242);
colorMap[0][beat]=255;
colorMap[1][beat]=64;
colorMap[2][beat]=0;
strip.setPixelColor(j, strip.Color(colorMap[0][beat], colorMap[1][beat], colorMap[2][beat]));
strip.show();
beat++;
beatreset=0;
if (beat>3){beat=0;}
}
chillled();
// DigiKeyboard.println(analogRead(A0));
}
void chillled() {
j=random(0,4);
c=random(0,3);
if (beat!=0){beatreset++;}
delay(1);
if (beatreset>900){
beat=0;
beatreset=0;
for (j=0;j<4;j++){
colorMap[0][j]=0;
colorMap[1][j]=255;
colorMap[2][j]=255;
strip.setPixelColor(j, strip.Color(colorMap[0][j], colorMap[1][j], colorMap[2][j]));
strip.show();
delay(45);
colorMap[0][j]=255;
colorMap[1][j]=64;
colorMap[2][j]=0;
strip.setPixelColor(j, strip.Color(colorMap[0][j], colorMap[1][j], colorMap[2][j]));
strip.show();
}
}
if (random(2)>=1){
if (colorMap[c][j]<maxBri){
colorMap[c][j]++;
}
}else{
//int test = colorMap[0][j]+colorMap[1][j]+colorMap[2][j];
if (colorMap[c][j]>0){
colorMap[c][j]--;
}
}
strip.setPixelColor(j, strip.Color(colorMap[0][j], colorMap[1][j], colorMap[2][j]));
strip.show();
}