Added defines for MIDI notes.

master
Holger Wirtz 7 years ago
parent ed0d1e1b3f
commit 3014059571
  1. 41
      MIDITESTER.ino
  2. 92
      midinotes.h

@ -1,21 +1,21 @@
#include <MIDI.h>
#include <looper.h>
#include <LinkedList.h>
#include "midinotes.h"
#define LED 13
#define LED_DECAY_MS 50
#define MIDI_EVENT_SCHED_MS 100
#define TEST_NOTE_MIN 40
#define TEST_NOTE_MAX 107
#define TEST_NOTE_MIN MIDI_A0
#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 MASTER_KEY_MIDI 84 // C6
#define MASTER_NUM1 24 // C1
#define MASTER_BANK_SELECT 83 // B5
#define MASTER_KEY_MIDI MIDI_B6
#define MASTER_NUM1 MIDI_C1
class midi_event {
public:
@ -41,41 +41,56 @@ void setup()
randomSeed(analogRead(A0));
// Sound change 17
MIDI.sendNoteOn(MASTER_KEY_MIDI, 99, 1);
delay(500);
MIDI.sendNoteOn(MASTER_NUM1 + 28, 66, 1);
MIDI.sendNoteOn(MIDI_E3, 66, 1);
delay(500);
MIDI.sendNoteOff(MASTER_NUM1 + 28, 0, 1);
MIDI.sendNoteOff(MIDI_E3, 0, 1);
delay(500);
MIDI.sendNoteOff(MASTER_KEY_MIDI, 0, 1);
delay(2000);
// Volume change 0.5
MIDI.sendNoteOn(MASTER_KEY_MIDI, 99, 1);
delay(500);
MIDI.sendNoteOn(MASTER_NUM1 + 3, 66, 1);
MIDI.sendNoteOn(MIDI_AIS1, 66, 1);
delay(500);
MIDI.sendNoteOff(MASTER_NUM1 + 3, 0, 1);
MIDI.sendNoteOff(MIDI_AIS1, 0, 1);
delay(500);
MIDI.sendNoteOff(MASTER_KEY_MIDI, 0, 1);
delay(2000);
// Bank change 3
MIDI.sendNoteOn(MASTER_KEY_MIDI, 99, 1);
delay(500);
MIDI.sendNoteOn(MASTER_NUM1 + 30, 66, 1);
MIDI.sendNoteOn(MIDI_FIS3, 66, 1);
delay(500);
MIDI.sendNoteOff(MASTER_NUM1 + 30, 0, 1);
MIDI.sendNoteOff(MIDI_FIS3, 0, 1);
delay(500);
MIDI.sendNoteOff(MASTER_KEY_MIDI, 0, 1);
delay(2000);
// Sound change 17
MIDI.sendNoteOn(MASTER_KEY_MIDI, 99, 1);
delay(500);
MIDI.sendNoteOn(MASTER_NUM1 + 28, 66, 1);
MIDI.sendNoteOn(MIDI_E3, 66, 1);
delay(500);
MIDI.sendNoteOff(MASTER_NUM1 + 28, 0, 1);
MIDI.sendNoteOff(MIDI_E3, 0, 1);
delay(500);
MIDI.sendNoteOff(MASTER_KEY_MIDI, 0, 1);
delay(2000);
// Volume change 0.1
MIDI.sendNoteOn(MASTER_KEY_MIDI, 99, 1);
delay(500);
MIDI.sendNoteOn(MIDI_DIS1, 66, 1);
delay(500);
MIDI.sendNoteOff(MIDI_DIS1, 0, 1);
delay(500);
MIDI.sendNoteOff(MASTER_KEY_MIDI, 0, 1);

@ -0,0 +1,92 @@
/*************************************************
* MIDI note values
*************************************************/
#define MIDI_A0 21
#define MIDI_AIS0 22
#define MIDI_B0 23
#define MIDI_C1 24
#define MIDI_CIS1 25
#define MIDI_D1 26
#define MIDI_DIS1 27
#define MIDI_E1 28
#define MIDI_F1 29
#define MIDI_FIS1 30
#define MIDI_G1 31
#define MIDI_GIS1 32
#define MIDI_A1 33
#define MIDI_AIS1 34
#define MIDI_B1 35
#define MIDI_C2 36
#define MIDI_CIS2 37
#define MIDI_D2 38
#define MIDI_DIS2 39
#define MIDI_E2 40
#define MIDI_F2 41
#define MIDI_FIS2 42
#define MIDI_G2 43
#define MIDI_GIS2 44
#define MIDI_A2 45
#define MIDI_AIS2 46
#define MIDI_B2 47
#define MIDI_C3 48
#define MIDI_CIS3 49
#define MIDI_D3 50
#define MIDI_DIS3 51
#define MIDI_E3 52
#define MIDI_F3 53
#define MIDI_FIS3 54
#define MIDI_G3 55
#define MIDI_GIS3 56
#define MIDI_A3 57
#define MIDI_AIS3 58
#define MIDI_B3 59
#define MIDI_C4 60
#define MIDI_CIS4 61
#define MIDI_D4 62
#define MIDI_DIS4 63
#define MIDI_E4 64
#define MIDI_F4 65
#define MIDI_FIS4 66
#define MIDI_G4 67
#define MIDI_GIS4 68
#define MIDI_A4 69
#define MIDI_AIS4 70
#define MIDI_B4 71
#define MIDI_C5 72
#define MIDI_CIS5 73
#define MIDI_D5 74
#define MIDI_DIS5 75
#define MIDI_E5 76
#define MIDI_F5 77
#define MIDI_FIS5 78
#define MIDI_G5 79
#define MIDI_GIS5 80
#define MIDI_A5 81
#define MIDI_AIS5 82
#define MIDI_B5 83
#define MIDI_C6 84
#define MIDI_CIS6 85
#define MIDI_D6 86
#define MIDI_DIS6 87
#define MIDI_E6 88
#define MIDI_F6 89
#define MIDI_FIS6 90
#define MIDI_G6 91
#define MIDI_GIS6 92
#define MIDI_A6 93
#define MIDI_AIS6 94
#define MIDI_B6 95
#define MIDI_C7 96
#define MIDI_CIS7 97
#define MIDI_D7 98
#define MIDI_DIS7 99
#define MIDI_E7 100
#define MIDI_F7 101
#define MIDI_FIS7 102
#define MIDI_G7 103
#define MIDI_GIS7 104
#define MIDI_A7 105
#define MIDI_AIS7 106
#define MIDI_B7 107
#define MIDI_C8 108
Loading…
Cancel
Save