Updated examples for latest MIDI library syntax.

master
Steve Lascos 7 years ago
parent 423af27664
commit bd2118e7ff
  1. 9
      examples/TGA_Pro_demo/TGA_Pro_demo.ino
  2. 7
      examples/TGA_Pro_nolib_demo/TGA_Pro_nolib_demo.ino

@ -16,7 +16,10 @@
#include <MIDI.h> #include <MIDI.h>
#include "BAGuitar.h" #include "BAGuitar.h"
//#define ENABLE_MEM_TEST // uncomment this line to enable the memory test MIDI_CREATE_DEFAULT_INSTANCE();
using namespace midi;
//#define ENABLE_MEM_TEST // uncomment this line and 'Save As' to a new location to test the SPI memory
using namespace BAGuitar; using namespace BAGuitar;
@ -122,7 +125,7 @@ void loop() {
// GTA Pro. This test code will periodically send MIDI events which // GTA Pro. This test code will periodically send MIDI events which
// will loop back and get printed in the Serial Monitor. // will loop back and get printed in the Serial Monitor.
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
int type, note, velocity, channel, d1, d2; DataByte note, velocity, channel, d1, d2;
// Send MIDI OUT // Send MIDI OUT
int cc, val=0xA, channelSend = 1; int cc, val=0xA, channelSend = 1;
@ -134,7 +137,7 @@ void loop() {
} }
if (MIDI.read()) { // Is there a MIDI message incoming ? if (MIDI.read()) { // Is there a MIDI message incoming ?
byte type = MIDI.getType(); MidiType type = MIDI.getType();
Serial.println(String("MIDI IS WORKING!!!")); Serial.println(String("MIDI IS WORKING!!!"));
switch (type) { switch (type) {
case NoteOn: case NoteOn:

@ -23,6 +23,9 @@
#include <Audio.h> #include <Audio.h>
#include <MIDI.h> #include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
using namespace midi;
AudioInputI2S i2sIn; AudioInputI2S i2sIn;
AudioOutputI2S i2sOut; AudioOutputI2S i2sOut;
@ -68,7 +71,7 @@ void loop() {
// GTA Pro. This test code will periodically send MIDI events which // GTA Pro. This test code will periodically send MIDI events which
// will loop back and get printed in the Serial Monitor. // will loop back and get printed in the Serial Monitor.
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
int type, note, velocity, channel, d1, d2; DataByte note, velocity, channel, d1, d2;
// Send MIDI OUT // Send MIDI OUT
int cc, val=0xA, channelSend = 1; int cc, val=0xA, channelSend = 1;
@ -80,7 +83,7 @@ void loop() {
} }
if (MIDI.read()) { // Is there a MIDI message incoming ? if (MIDI.read()) { // Is there a MIDI message incoming ?
byte type = MIDI.getType(); MidiType type = MIDI.getType();
Serial.println(String("MIDI IS WORKING!!!")); Serial.println(String("MIDI IS WORKING!!!"));
switch (type) { switch (type) {
case NoteOn: case NoteOn:

Loading…
Cancel
Save