Source code for a MIDI controller built from parts and designed to be extensible
Fork of USBMIDI_HelloWorld by
Revision 2:012e56772666, committed 2016-01-04
- Comitter:
- earlz
- Date:
- Mon Jan 04 05:01:04 2016 +0000
- Parent:
- 1:1e34feaa7774
- Commit message:
- clean up code
Changed in this revision
MovingAverage.lib | Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1e34feaa7774 -r 012e56772666 MovingAverage.lib --- a/MovingAverage.lib Mon Jan 04 05:00:13 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://developer.mbed.org/users/fblanc/code/MovingAverage/#ad69440a9bef
diff -r 1e34feaa7774 -r 012e56772666 main.cpp --- a/main.cpp Mon Jan 04 05:00:13 2016 +0000 +++ b/main.cpp Mon Jan 04 05:01:04 2016 +0000 @@ -2,7 +2,6 @@ #include "mbed.h" #include "USBMIDI.h" -#include "MovingAverage.h" void show_message(MIDIMessage msg) { switch (msg.type()) { @@ -46,13 +45,11 @@ #define SMOOTHING_AMOUNT 500 -int main() { - //MovingAverage <float>vavg(100,0.0); +int main() { midi.attach(show_message); // call back for messages received float last_value = 0.0f; while (1) { - //float values[SMOOTHING_AMOUNT] = {0.0f}; float counter=0.0f; for(int i=0;i<SMOOTHING_AMOUNT;i++){ wait_us(10); @@ -76,11 +73,5 @@ write_full_cc(20, 52, 0, midi_value); } - /*for(int i=48; i<83; i++) { // send some messages! - midi.write(MIDIMessage::NoteOn(i)); - wait(0.25); - midi.write(MIDIMessage::NoteOff(i)); - wait(0.5); - }*/ } }