Can't maximum the window of hairless midi...so I slide right and left to view.
I renew the picture.
Both baud rate of serial port of code and hairless were setting "384000".
My drum code:
/*
Make 16 single piezo pads with a multiplexer 74HC4067.
Refer: https://github.com/RyoKosaka/HelloDrum-arduino-Library
*/
//Determine the setting value.
//By changing the number in this array set sensitivity, threshold and so on.
//drum software: 0-ADD2, 1-EZD2
#define Drum_map 0
// ADD2 MAP
//cymbal1-0, cymbal2-1, ride-2, ride_edge-3, ride_bell-4, crash-5, crash_edge-6, crash_bell-7, hihat pedal-8, hihatopen-9, hihatclose-10
//floorTom-11, tom4-12, tom3-13, tom2-14, tom1-15, snare rimshot-16, snare head-17, snare cross stick-18, kick-19
byte Note[2][20] = {{79, 81, 60, 63, 61, 77, 78, 85, 48, 54, 49, 65, 47, 67, 69, 71, 37, 38, 40, 36}};
//sensitivity, threshold, scan time, mask time, note map
uint8_t CYM1[5] = {100,10,10, 30, Note[Drum_map][0]};
uint8_t CYM2[5] = {100, 10, 10, 30, Note[Drum_map][1]};
uint8_t RIDE[9] = {100, 10, 10, 30, 4, 9, Note[Drum_map][2], Note[Drum_map][3], Note[Drum_map][4]};
uint8_t CRASH[9] = {100, 10, 10, 30, Note[Drum_map][5], Note[Drum_map][6], Note[Drum_map][7] };
uint8_t HIHAT_PEDAL[6] = {90, 30, 70, 90, 10, Note[Drum_map][8]};
uint8_t HIHAT[6] = {100, 10, 10, 30, Note[Drum_map][9], Note[Drum_map][10]};
uint8_t FTOM[5] = {100, 55, 25, 30, Note[Drum_map][11]};
uint8_t TOM4[5] = {100, 55, 25, 30, Note[Drum_map][12]};
uint8_t TOM3[5] = {100, 55, 25, 30, Note[Drum_map][13]};
uint8_t TOM2[5] = {100, 55, 25, 30, Note[Drum_map][14]};
uint8_t TOM1[5] = {100, 55, 25, 30, Note[Drum_map][15]};
uint8_t SNARE[9] = {100, 10, 30, 10, 10,3, Note[Drum_map][16], Note[Drum_map][17], Note[Drum_map][18]};
uint8_t KICK[5] = {100, 10, 10, 30, Note[Drum_map][19]};
/////////////////////////////////////////////////////////////////////////////////////
#include <hellodrum.h>
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
//Define MUX pin (D2, D3, D4, D5, A0)
HelloDrumMUX_4067 mux(2, 3, 4, 5, 0);
//name pad and define MUX pin
HelloDrum cym01(0);
HelloDrum cym02(1);
HelloDrum ride(2, 3);
HelloDrum crash(4, 5);
HelloDrum hihatPedal(6);
HelloDrum hihat(7);
HelloDrum ftom(8);
HelloDrum tom04(9);
HelloDrum tom03(10);
HelloDrum tom02(11);
HelloDrum tom01(12);
HelloDrum snare(13, 14);
HelloDrum kick(15);
void setup()
{
//MIDI.begin();
Serial.begin(115200);
}
void loop()
{
mux.scan();
cym01.singlePiezoMUX(CYM1[0], CYM1[1], CYM1[2], CYM1[3]);
cym02.singlePiezoMUX(CYM2[0], CYM2[1], CYM2[2], CYM2[3]);
ride.cymbal3zoneMUX(RIDE[0], RIDE[1], RIDE[2], RIDE[3], RIDE[4], RIDE[5]);
//cymbal3zone(byte sens, byte thre, byte scan, byte mask, byte edgeThre, byte cupThre);
crash.cymbal3zoneMUX(CRASH[0], CRASH[1], CRASH[2], CRASH[3], CRASH[4], CRASH[5]);
//cymbal3zone(byte sens, byte thre, byte scan, byte mask, byte edgeThre, byte cupThre);
hihatPedal.hihatControlMUX(HIHAT_PEDAL[0], HIHAT_PEDAL[1], HIHAT_PEDAL[2], HIHAT_PEDAL[3], HIHAT_PEDAL[4]);
//TCRT5000, hihatPedal(byte sens, byte thre, byte scanStart, byte scanEnd, byte pedalSens)
hihat.HHMUX(HIHAT[0], HIHAT[1], HIHAT[2], HIHAT[3]);
ftom.singlePiezoMUX(FTOM[0], FTOM[1], FTOM[2], FTOM[3]);
tom04.singlePiezoMUX(TOM4[0], TOM4[1], TOM4[2], TOM4[3]);
tom03.singlePiezoMUX(TOM3[0], TOM3[1], TOM3[2], TOM3[3]);
tom02.singlePiezoMUX(TOM2[0], TOM2[1], TOM2[2], TOM2[3]);
tom01.singlePiezoMUX(TOM1[0], TOM1[1], TOM1[2], TOM1[3]);
kick.singlePiezoMUX(KICK[0], KICK[1], KICK[2], KICK[3]);
snare.dualPiezoMUX(SNARE[0], SNARE[1], SNARE[2], SNARE[3], SNARE[4], SNARE[5]);
//dualPiezo(byte sens, byte thre, byte scan, byte mask, byte rimSens, byte rimThre);
if (cym01.hit == true)
{
MIDI.sendNoteOn(CYM1[4], cym01.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(CYM1[4], 0, 10);
}
if (cym02.hit == true)
{
MIDI.sendNoteOn(CYM2[4], cym02.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(CYM2[4], 0, 10);
}
//ride bow
if (ride.hit == true)
{
MIDI.sendNoteOn(RIDE[7], ride.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(RIDE[7], 0, 10);
}
//ride edge
else if (ride.hitRim == true)
{
MIDI.sendNoteOn(RIDE[8], ride.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(RIDE[8], 0, 10);
}
//ride cup
else if (ride.hitCup == true)
{
MIDI.sendNoteOn(RIDE[9], ride.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(RIDE[9], 0, 10);
}
//ride choke
if (ride.choke == true)
{
MIDI.sendPolyPressure(RIDE[7], 127, 10);
MIDI.sendPolyPressure(RIDE[8], 127, 10);
MIDI.sendPolyPressure(RIDE[9], 127, 10);
MIDI.sendPolyPressure(RIDE[7], 0, 10);
MIDI.sendPolyPressure(RIDE[8], 0, 10);
MIDI.sendPolyPressure(RIDE[9], 0, 10);
}
//crash bow
if (crash.hit == true)
{
MIDI.sendNoteOn(CRASH[7], crash.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(CRASH[7], 0, 10);
}
//crash edge
else if (crash.hitRim == true)
{
MIDI.sendNoteOn(CRASH[8], crash.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(CRASH[8], 0, 10);
}
//crash cup
else if (crash.hitCup == true)
{
MIDI.sendNoteOn(CRASH[9], crash.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(CRASH[9], 0, 10);
}
//crash choke
if (crash.choke == true)
{
MIDI.sendPolyPressure(CRASH[7], 127, 10);
MIDI.sendPolyPressure(CRASH[8], 127, 10);
MIDI.sendPolyPressure(CRASH[9], 127, 10);
MIDI.sendPolyPressure(CRASH[7], 0, 10);
MIDI.sendPolyPressure(CRASH[8], 0, 10);
MIDI.sendPolyPressure(CRASH[9], 0, 10);
}
if (hihat.hit == true)
{
//check open or close
//1.open
if (hihatPedal.openHH == true)
{
MIDI.sendNoteOn(HIHAT[5], hihat.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(HIHAT[5], 0, 10);
}
//2.close
else if (hihatPedal.closeHH == true)
{
MIDI.sendNoteOn(HIHAT[6], hihat.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(HIHAT[6], 0, 10);
}
}
//when pedal is closed, TCRT5000
if (hihatPedal.hit == true)
{
MIDI.sendNoteOn(HIHAT_PEDAL[6], hihatPedal.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(HIHAT_PEDAL[6], 0, 10);
}
//sending state of pedal with controll change
if (hihatPedal.moving == true)
{
MIDI.sendControlChange(4, hihatPedal.pedalCC, 10);
}
if (ftom.hit == true)
{
MIDI.sendNoteOn(FTOM[4], ftom.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(FTOM[4], 0, 10);
}
if (tom04.hit == true)
{
MIDI.sendNoteOn(TOM4[4], tom04.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(TOM4[4], 0, 10);
}
if (tom03.hit == true)
{
MIDI.sendNoteOn(TOM3[4], tom03.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(TOM3[4], 0, 10);
}
if (tom02.hit == true)
{
MIDI.sendNoteOn(TOM2[4], tom02.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(TOM2[4], 0, 10);
}
if (tom01.hit == true)
{
MIDI.sendNoteOn(TOM1[4], tom01.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(TOM1[4], 0, 10);
}
//SNARE HEAD
if (snare.hit == true)
{
MIDI.sendNoteOn(SNARE[7], snare.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(SNARE[7], 0, 10);
}
//SNARE RIMSHOT
else if (snare.hitRim == true)
{
if (snare.velocity > 60)
{
MIDI.sendNoteOn(SNARE[8], snare.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(SNARE[8], 0, 10);
}
else
{
MIDI.sendNoteOn(SNARE[9], snare.velocity * 2, 10); //(note, velocity, channel)
MIDI.sendNoteOff(SNARE[9], 0, 10);
}
}
if (kick.hit == true)
{
MIDI.sendNoteOn(KICK[4], kick.velocity, 10); //(note, velocity, channel)
MIDI.sendNoteOff(KICK[4], 0, 10);
}
}