Skip to content

Commit

Permalink
M0 and M1
Browse files Browse the repository at this point in the history
  • Loading branch information
robstave committed Mar 29, 2019
1 parent 366787e commit 53e1ff8
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
34 changes: 34 additions & 0 deletions M0_Simple_Synth_01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# M0_Simple_Synth_01

Verify that you are getting Midi messages from a Midi controller.

You will need to have the Trinket Library installed.

https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/arduino-ide-setup

Perhaps run a few of the initial sketches there as well. There should be one that makes the on board LED (DOT) blink.

You will need to have the Dot Star library installed into you IDE and we are using the
MIDIUSB.h Library.

https://github.com/arduino-libraries/MIDIUSB
http://blog.stekgreif.com/?p=699
https://tigoe.github.io/SoundExamples/midiusb.html

## Setup

You will need some software to actually connect to the Trinket. In my case, I am using a Ableton Lite. Both the Controller ( Arturia Beat STep ) and the trinket are connected to my PC (Windows) via USB.

Ableton is set up so that it recieves ( and broadcasts ) the midi. Because of this, I can tell if the messages are being sent from the controller.

The code has three basic handlers

- Note On - Detect a note
- Note Off - Detect a note release
- Control Change - a knob was turned

All it does is capture the message and log it.

Note that the Logging is a little different. IF you are adapting this for Arduino ( DUE or something legit ) you may need to change the serial code.


13 changes: 2 additions & 11 deletions M0_Simple_Synth_02/M0_Simple_Synth_02.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
//
// distinguish between 3 notes C3, D3, E3 for Red, Green Blue and track intensity





// Setup Onboard Dot
#define NUMPIXELS 1 // Number of LEDs in strip
Expand Down Expand Up @@ -46,7 +43,6 @@ void setup() {

void setColor(byte note){


if (note == C3){
red = 0xFF;
}
Expand All @@ -58,13 +54,10 @@ void setColor(byte note){
}

strip.setPixelColor(0, red, green, blue); //set the pixel colors
//strip.setPixelColor(0, 0x9F0000); // red
strip.show();
strip.show();
}

void clearColor(byte note){



if (note == C3){
red = 0x0;
Expand All @@ -77,8 +70,7 @@ void clearColor(byte note){
}

strip.setPixelColor(0, red, green, blue); //set the pixel colors
//strip.setPixelColor(0, 0x9F0000); // red
strip.show();
strip.show();
}

// 0x9
Expand Down Expand Up @@ -110,7 +102,6 @@ void controlChange(byte channel, byte control, byte value) {

void loop() {


initSequence(); // Blinky intro

while (true) {
Expand Down
5 changes: 5 additions & 0 deletions M0_Simple_Synth_02/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# M0_Simple_Synth_02

Check the values of the midi notes and turn on/off lights based on the value of the note.

Also save of the value of the CC messages and use that to set the intensity of the light.
2 changes: 2 additions & 0 deletions M0_Simple_Synth_03/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# M0_Simple_Synth_03

Binary file modified README.md
Binary file not shown.

0 comments on commit 53e1ff8

Please sign in to comment.