The Cairns Drum Sequencer V1 What is it? This device is an 8 step drum machine that uses the LEDs to show which channel is selected, when midi is being read, and when the sequencer is stepping. This drum machine also includes a potentiometer that allows the user to adjust the velocity on each channel. Continue reading “Digital Lab Final Project”
Category Archives: Uncategorized
Digital Electronics Lab 11
Arduino Code: #include "Button.h" Button buttonOne(33, 60); Button buttonTwo(34, 62); Button buttonThree(35, 64); Button buttonFour(36, 65); void setup() { Serial.begin(9600); buttonOne.pressHandler(onPress); buttonOne.releaseHandler(onRelease); buttonTwo.pressHandler(onPress); buttonTwo.releaseHandler(onRelease); buttonThree.pressHandler(onPress); buttonThree.releaseHandler(onRelease); buttonFour.pressHandler(onPress); buttonFour.releaseHandler(onRelease); } void loop() { buttonOne.process(); buttonTwo.process(); buttonThree.process(); buttonFour.process(); } void onPress(int buttonNumber) { Serial.print(buttonNumber); Serial.println(" pressed"); usbMIDI.sendNoteOn(buttonNumber, 127, 1); } void onRelease(int buttonNumber) { Serial.print(buttonNumber); Serial.println(" released");Continue reading “Digital Electronics Lab 11”
Digital Electronics Lab 10
Video: Processing Code: import processing.serial.*; Serial teensySerial; int inputVal=0; int inputVal2=0; int inputVal3 = 0; int inputVal4=0; int inputVal5=0; int circleSize=0; int circleX=0; int circleSpeed =0; int circleY=0; void setup() { frameRate(30); size(500, 500); //printArray(Serial.list()); String usbPortName = Serial.list()[12]; print(usbPortName); teensySerial = new Serial(this, usbPortName, 9600); } void draw() { if (teensySerial.available()>=6) { inputVal = teensySerial.read(); if (inputVal == 0)Continue reading “Digital Electronics Lab 10”
Digital Lecture Assignment 9
Video: Processing Code: import processing.serial.*; Serial teensySerial; int val=0; int r = 0; int g=0; int b=0; int shapeX=0; int shapeY=0; int shapeSize=0; void setup() { frameRate(30); size(600, 600); printArray(Serial.list()); String portName= Serial.list()[12]; teensySerial= new Serial(this, portName, 9600); while (teensySerial. available() > 0) { teensySerial.read(); } } void draw() { if (teensySerial.available() > 0) { val = teensySerial.read(); ifContinue reading “Digital Lecture Assignment 9”
Digital Electronics Lab 9 (Multi-Channel Step Sequencer)
Video: Code: int ledPin[4] = {29, 30, 31, 32}; int channelLeds[3] = {18, 17, 16}; int buttonPin[5] = {33, 34, 35, 36, 27}; int tempo = 0; int mappedPotValTempo = 0; int currentStep = 0; bool buttonState[5] = {LOW, LOW, LOW, LOW, LOW}; bool lastButtonState[5] = {LOW, LOW, LOW, LOW, LOW}; bool switchedOn[3][4] = {Continue reading “Digital Electronics Lab 9 (Multi-Channel Step Sequencer)”
Digital Electronics Lab 8 (Step Sequencer)
Code: int ledPin[4] = {29, 30, 31, 32}; int buttonPin[4] = {33, 34, 35, 36}; bool switchedOn[4] = {false, false, false, false}; bool buttonState[4] = {LOW, LOW, LOW, LOW}; bool lastButtonState[4] = {LOW, LOW, LOW, LOW}; int tempo = 0; int mappedPotValTempo = 0; int currentStep = 0; unsigned long lastStepTime = 0; void setup()Continue reading “Digital Electronics Lab 8 (Step Sequencer)”
Digital Electronics Lab 7
“Push” ON/OFF Button: The “Push” Button works in 4 steps: First we store the “button states” within 3 boolean values, which controls the button and the LEDs. The checkButton() is used to check to make sure the last button state equals the current button state. If this is true, it will then take the valuesContinue reading “Digital Electronics Lab 7”
Digital Electronics Lab 6
Video: Code: int potVals[4] = {0, 0, 0, 0}; //array for potentiometers int mappedPotVals[4] = {0, 0, 0, 0}; //array for mapped pot values int analogPinNum [4] = {A14, A15, A16, A17}; //array for analog pin numbers int ledPins[4] = {29, 30, 31, 32}; //array for LEDs int tempoPot = 0; int frontBackToggle = 39;Continue reading “Digital Electronics Lab 6”
Digital Lecture Assignment 6
Video: My Code: int ledPins[4] = {29, 30, 31, 32}; // LED array int toggle = 34; int tempo = 0; int currentStep = 0; //"counter" variable unsigned long lastStepTime = 0; void setup() { for (int i = 0; i < 4; i++) { //for loop to set up all LEDs pinMode(ledPins[i], OUTPUT);Continue reading “Digital Lecture Assignment 6”
Digital Lecture Assignment 5
Code: int buttonPins[2] = {33, 34}; //array for button pins int ledPins[4] = {29, 30, 31, 32}; //array for LEDs int potValue = 0; //variable for input pin of potentiometer int toggle = 36; //variable for input pin of toggle switch void setup() { //setup for (int i = 0; i < 4; i++) {Continue reading “Digital Lecture Assignment 5”