   midiEventPacket_t packet = {0x0E, 0xE0 | 0, val_lsb, val_msb};
   MidiUSB.sendMIDI(packet);
   MidiUSB.flush();
-
+}
+
+//val <-4096; 4096>
+inline void send_pitch_event(int val) {
+  unsigned int val2 = 8192 + val;
+  uint8_t val_lsb = val2 & 0x7F;
+  uint8_t val_msb = val2 >> 7;
+  midiEventPacket_t packet = {0x0E, 0xE0 | 0, val_lsb, val_msb};
+  MidiUSB.sendMIDI(packet);
+  MidiUSB.flush();
 }
 
 inline void send_effect_event(int val) { //0-1023

    unsigned long diff_us = micros() - fret_status_last_f_us;
    if (diff_us < FRET_SLIDING_THOLD) {
      int delta = f - ( (frets0_when_noteon != UNDEF) ? frets0_when_noteon : 0 ); //0: no sliding, -1:sliding outward: 1: sliding inward
      // send_midi_debug(delta, frets0_when_noteon);
      send_fret_sliding_event(delta, f);
    }
    fret_status_last_f_us = micros();

#define LASER_THOLD 1000 //[us]
#define STOP_THOLD 500000 //[us]
#define FRET_SLIDING_THOLD 500000 //[us]
#define PITCH_HALFTONE 800
#define VEL_TIME_OUT_OF_RANGE 200000 //[us]
#define VEL_TIME_MIN 6000
#define VEL_TIME_MAX 25000
