In a rather stupid moment of enthusiasm many months ago I began the process of sequencer for audio gating and based my ideas for an arduino version on the circuits designed by Nic Collins in Handmade Electronic Music. And I should’ve known better… but…. well, never mind, lets just say I should’ve known better.

My photoresitor/LED homebrew opto-coupler was tested and I realized that the audio is not being fully gated on/off. It’s pretty much gated with the proper resistors in place, but you can still faintly hear the audio track slipping through when the LED is off. There are some options available to me, but I’m afraid I may have just set myself up for a bit of failure. That rather doomed statement is, in part, because I just noticed a passage in the book that says that the lack of full on/off gating is inevitable.

So, we move forward, perhaps I can use transistors as my gate? I’m afraid though that even that is not going to give me the true and clean silence I want when that step in the sequence is fully off.

More setbacks, more considerations as I move forward, hopefully towards something good.

arduino.sequencer.setbacks

Well, at least the programming and layout are complete. After a lot of back and forth with a huge amount of help through the arduino forum, it looks like the sequencer is performing properly and accurately. There is one small issue with the LEDs but I believe that it won’t be an issue once I have the appropriate pulldown resistors in place (currently there are no resistors and as a result, when the LEDs are forced off you can see a muted and faint completion of the current sequence pattern).

This version of the sequencer is replete with both potentiometer control over speed and length of sequence… push button control over pause(on) or pause off/restart at beginning of sequence and I believe (hopefully) control over the brightness of the control LED through potentiometer (also/or maybe instead there could be potentiometers between the leds and the switches (wouldn’t that be divine)).

In any case, photos will follow tonight, though at the moment I’m working through the Eagle CAD software in order to learn how to print my own circuits since I’m realizing that that’s going to be important when actually making this circuit since I really want to have PCB mounted components and avoid as much loose wiring as possible. Design and layout are going to be the focus for the near future as I test all this out.

8.step.sequencer.done.arduino.

This still has a bit of work left on it… I’m not totally convinced that the timing is even/smooth… it seems like the final LED in the loop is off in hit and release… though I’m not entirely if it’s my eyes or the code.  Everything else is working well, I’m now able to adjust the sequence length via a potentiometer, pause the sequence using a push-button, and adjust sequence speed using another pot.  The problem at this point remains having a button that first suspends the LED sequence, turns off any lit LEDs and then, when released, starts the sequence over again on the first frame.  I’ve had a huge amount of help on the arduino forum and that’s been really whats made this go from nothing to something.  Hopefully the code is done by the end of the weekend and I can begin to sort out how to board this out and design the interface.

const int buttonPin = 2;
const int ledPin =  12;
int buttonState = 0;

int leds[] = {3, 4, 5, 6, 7, 8, 9, 10};
#define NUMBER_OF_LEDS (sizeof(leds)/sizeof(int))

boolean flickbook[][NUMBER_OF_LEDS] = {
{  HIGH,  LOW,  LOW,  LOW,  LOW,  LOW,  LOW,  LOW},
{  LOW,  HIGH,  LOW,  LOW,  LOW,  LOW,  LOW,  LOW},
{  LOW,  LOW,  HIGH,  LOW,  LOW,  LOW,  LOW,  LOW},
{  LOW,  LOW,  LOW,  HIGH,  LOW,  LOW,  LOW,  LOW},
{  LOW,  LOW,  LOW,  LOW,  HIGH,  LOW,  LOW,  LOW},
{  LOW,  LOW,  LOW,  LOW,  LOW,  HIGH,  LOW,  LOW},
{  LOW,  LOW,  LOW,  LOW,  LOW,  LOW,  HIGH,  LOW},
{  LOW,  LOW,  LOW,  LOW,  LOW,  LOW,  LOW,  HIGH}
};

#define FRAMES (sizeof(flickbook)/(sizeof(flickbook[0])))

int sensorPin = 0;

const int sensorMin = 0;
const int sensorMax = 1023;

void setup()   {
for (int led=0; led<NUMBER_OF_LEDS; led++) {
pinMode(leds[led], OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
}

void loop(){
int sensorReading1 = analogRead(2);
int range1 = map(sensorReading1, sensorMin, sensorMax, 0, 7);

switch (range1) {
case 0:    {
long time = millis();

for (int frame=0; frame<1; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 1:    {
long time = millis();

for (int frame=0; frame<2; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 2:    {
long time = millis();

for (int frame=0; frame<3; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 3:    {
long time = millis();

for (int frame=0; frame<4; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 4:    {
long time = millis();

for (int frame=0; frame<5; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 5:    {
long time = millis();

for (int frame=0; frame<6; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 6:    {
long time = millis();

for (int frame=0; frame<7; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

case 7:    {
long time = millis();

for (int frame=0; frame<8; frame++) {
for (int led=0; led<NUMBER_OF_LEDS; led++){
digitalWrite(leds[led], flickbook[frame][led]);
}
(buttonState = digitalRead(buttonPin));
while (buttonState == HIGH) {
buttonState = digitalRead(buttonPin);
digitalWrite(ledPin, LOW);
}
int sensorValue = map(analogRead(sensorPin), 0, 1023, 0, 1000);
while (sensorValue >= (millis() – time)) {
sensorValue = analogRead(sensorPin);
}
time = millis();
}
}
break;

}
}

arduino.8.step.LED.sequencer.in.progress

I’m back to using an arduino to control the behavior of my gating circuit. It’s cleaner, less wires, fewer issues and can be programmed quickly to alter behavior.

Also, I rather stupidly stripped my wires for the current IC based circuit using snips… and have found that the wires I used are unlikely to hold up to the test of time. I’m looking at seeing how much of this circuit can be etched onto a board. I’d really like to see my process move in that direction. Since it’s cleaner, more durable and more likely to not have wiring/consistency of performance issues.

I also found a site that will allow me to power my USB specific freeduino board through the USB hookup using a 9 volt battery. This is huge since I have little to no interest in having to power this off of my computer when performing…. This way I have a standalone unit with all of the power arduino backing it up.

Arduino Update for 8 step sequencer/phaser/gating