Fix type in function parameters.

Add MIDI notes.
master
Holger Wirtz 7 years ago
parent 3014059571
commit 4a40382dec
  1. 11
      MIDITESTER.ino
  2. 5
      midinotes.h

@ -11,10 +11,10 @@
#define TEST_NOTE_MAX MIDI_B5
#define TEST_VEL_MIN 60
#define TEST_VEL_MAX 120
#define TEST_DUR_MIN 150
#define TEST_DUR_MAX 1000
#define TEST_DUR_MIN 200
#define TEST_DUR_MAX 1500
#define MASTER_KEY_MIDI MIDI_B6
#define MASTER_KEY_MIDI MIDI_C6
#define MASTER_NUM1 MIDI_C1
class midi_event {
@ -107,7 +107,7 @@ void loop()
sched.scheduler();
}
void sendMIDI(int8_t note, int8_t vel, int8_t chan, int8_t dur)
void sendMIDI(int8_t note, int8_t vel, int8_t chan, uint32_t dur)
{
midi_event *m = new midi_event();
m->note = note;
@ -140,8 +140,7 @@ void do_midi_events(void)
{
midi_event *m = MIDIEvents.get(i);
// If its a mammal, then print it's name
if (m->dur < millis())
if (millis() > m->dur)
{
MIDI.sendNoteOff(m->note, 0, m->chan);
MIDIEvents.remove(i);

@ -2,6 +2,9 @@
* MIDI note values
*************************************************/
#ifndef _MIDINOTES_H
#define _MIDINOTES_H
#define MIDI_A0 21
#define MIDI_AIS0 22
#define MIDI_B0 23
@ -90,3 +93,5 @@
#define MIDI_AIS7 106
#define MIDI_B7 107
#define MIDI_C8 108
#endif

Loading…
Cancel
Save