From b6a9043f6585da39bd063a5903466cf9b3b5e6f6 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 12 Aug 2016 23:09:31 +0200 Subject: Add links to source files --- arduino/Laserharfe/Laserharfe.ino | 29 ++++++++++------------------- arduino/Laserharfe/_config.c | 1 + arduino/Laserharfe/_engine.c | 1 + arduino/Laserharfe/config.h | 1 + arduino/Laserharfe/engine.h | 1 + arduino/Laserharfe/main.h | 1 + arduino/Laserharfe/midi.h | 1 + 7 files changed, 16 insertions(+), 19 deletions(-) create mode 120000 arduino/Laserharfe/_config.c create mode 120000 arduino/Laserharfe/_engine.c create mode 120000 arduino/Laserharfe/config.h create mode 120000 arduino/Laserharfe/engine.h create mode 120000 arduino/Laserharfe/main.h create mode 120000 arduino/Laserharfe/midi.h (limited to 'arduino/Laserharfe') diff --git a/arduino/Laserharfe/Laserharfe.ino b/arduino/Laserharfe/Laserharfe.ino index 9f0d025..d8a7c6f 100644 --- a/arduino/Laserharfe/Laserharfe.ino +++ b/arduino/Laserharfe/Laserharfe.ino @@ -9,8 +9,9 @@ #include "MIDIUSB.h" #include -#include "engine.h" +#include "main.h" #include "config.h" +#include "engine.h" int led = 13; @@ -20,23 +21,10 @@ enum { MODE_REPORTPOINTS_PLAY = 2, } g_mode = MODE_REPORTPOINTS_PLAY; -/* -// First parameter is the event type (0x09 = note on, 0x08 = note off). -// Second parameter is note-on/note-off, combined with the channel. -// Channel can be anything between 0-15. Typically reported to the user as 1-16. -// Third parameter is the note number (48 = middle C). -// Fourth parameter is the velocity (64 = normal, 127 = fastest). -void noteOn(byte channel, byte pitch, byte velocity) { - midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity}; - MidiUSB.sendMIDI(noteOn); +uint32_t now() { + return millis(); } -void noteOff(byte channel, byte pitch, byte velocity) { - midiEventPacket_t noteOff = {0x08, 0x80 | channel, pitch, velocity}; - MidiUSB.sendMIDI(noteOff); -} -*/ - void setup_pwm() { // Set up the generic clock (GCLK4) used to clock timers REG_GCLK_GENDIV = GCLK_GENDIV_DIV(1) | // Divide the 48MHz clock source by divisor 2: 48MHz/2=24MHz @@ -152,8 +140,9 @@ void handle_wire() { if (p1.x==1023 && p2.x==1023 && p3.x==1023 && p4.x==1023) return; - long now = millis(); + uint32_t now = millis(); if (g_mode==MODE_STANDALONE || g_mode==MODE_REPORTPOINTS_PLAY) { +/* if (p1.x!=1023) engine_handle_point(&p1, now); if (p2.x!=1023) @@ -162,6 +151,7 @@ void handle_wire() { engine_handle_point(&p3, now); if (p4.x!=1023) engine_handle_point(&p4, now); +*/ } if (g_mode==MODE_STANDALONE) @@ -214,7 +204,8 @@ void midi_silencenote( int channel, int note, int octave_offset ) { void midi_pitchbend( int channel, int pitch ) { pitch += 8192; if (pitch < 0) pitch = 0; - if (pitch > 16383) pitch = 16383, + if (pitch > 16383) pitch = 16383; + midiEventPacket_t p = { 0xe, 0xe0 | channel, 0x7f & pitch, 0x7f & (pitch>>7) }; MidiUSB.sendMIDI(p); } @@ -295,7 +286,7 @@ void loop() { delay(1500); */ - engine_checksilence(millis()); + //engine_checksilence(millis()); digitalWrite(led, ++led_state & 1 ? HIGH : LOW); // turn the LED on (HIGH is the voltage level) } diff --git a/arduino/Laserharfe/_config.c b/arduino/Laserharfe/_config.c new file mode 120000 index 0000000..1353d74 --- /dev/null +++ b/arduino/Laserharfe/_config.c @@ -0,0 +1 @@ +../../config.c \ No newline at end of file diff --git a/arduino/Laserharfe/_engine.c b/arduino/Laserharfe/_engine.c new file mode 120000 index 0000000..013d780 --- /dev/null +++ b/arduino/Laserharfe/_engine.c @@ -0,0 +1 @@ +../../engine.c \ No newline at end of file diff --git a/arduino/Laserharfe/config.h b/arduino/Laserharfe/config.h new file mode 120000 index 0000000..bce5bfd --- /dev/null +++ b/arduino/Laserharfe/config.h @@ -0,0 +1 @@ +../../config.h \ No newline at end of file diff --git a/arduino/Laserharfe/engine.h b/arduino/Laserharfe/engine.h new file mode 120000 index 0000000..34e3ddb --- /dev/null +++ b/arduino/Laserharfe/engine.h @@ -0,0 +1 @@ +../../engine.h \ No newline at end of file diff --git a/arduino/Laserharfe/main.h b/arduino/Laserharfe/main.h new file mode 120000 index 0000000..c57517f --- /dev/null +++ b/arduino/Laserharfe/main.h @@ -0,0 +1 @@ +../../main.h \ No newline at end of file diff --git a/arduino/Laserharfe/midi.h b/arduino/Laserharfe/midi.h new file mode 120000 index 0000000..65ebe46 --- /dev/null +++ b/arduino/Laserharfe/midi.h @@ -0,0 +1 @@ +../../midi.h \ No newline at end of file -- cgit v1.2.3