Skip to content

Commit

Permalink
show instrument name in MIDI-IN box additional to the MIDI note
Browse files Browse the repository at this point in the history
  • Loading branch information
corrados committed Jan 22, 2022
1 parent 7399450 commit d9db63c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
10 changes: 4 additions & 6 deletions doc/TODO
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@



- show instrument name in MIDI-IN box additional to the MIDI note

- use rim switch theshold in dB (not linear as it is implemented right now)

- for the ESP32 prototype, adjust the ADC_noise_peak_velocity_scaling in edrumulus.h correctly

- introduce defines for debugging functionality instead of /* */

- Documentation: Edrumulus manual which describes the hardware/software setup, parameter description, HOWTOs, etc.

- possible memory issue on the ESP32, see 406c31fd66aeb1609f75e22672d5fa9280749f37

- Documentation: Edrumulus manual which describes the hardware/software setup, parameter description, HOWTOs, etc.

- simulate 16 bit with current hardware and check if thresholds are correct

- Should we consider pre-scan time high peaks for velocity estimation?
Expand All @@ -25,6 +21,8 @@

- support positional sensing for rim shots

- for the ESP32 prototype, adjust the ADC_noise_peak_velocity_scaling in edrumulus.h correctly

- Documentation: Algorithm description
-> improve retrigger cancellation section

Expand Down
23 changes: 14 additions & 9 deletions tools/edrumulus_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <cstring>
#include <curses.h>
#include <jack/jack.h>
Expand All @@ -17,6 +18,8 @@
// tables
const int max_num_pads = 8;
const int number_cmd = 12;
std::map<int, std::string> midi_map = { { 38, "snare" }, { 40, "snare" }, { 36, "kick" }, { 22, "hi-hat" }, { 26, "hi-hat" }, { 44, "pedal" },
{ 49, "crash" }, { 51, "ride" }, { 48, "tom1" }, { 45, "tom2" }, { 43, "tom3" } };
std::vector<std::string> pad_names { "snare", "kick", "hi-hat", "ctrl", "crash", "tom1", "ride", "tom2", "tom3" };
std::vector<std::string> pad_types { "PD120", "PD80R", "PD8", "FD8", "VH12", "VH12CTRL", "KD7", "TP80", "CY6", "CY8", "DIABOLO12", "CY5", "HD1TOM", "PD6", "KD8", "PDX8", "KD120", "PD5" };
std::vector<std::string> curve_types { "LINEAR", "EXP1", "EXP2", "LOG1", "LOG2" };
Expand Down Expand Up @@ -58,11 +61,11 @@ void update_param_outputs()
mvprintw ( row_start + 3, col_start, "Parameter: %9s: %s ", cmd_names[sel_cmd].c_str(), parse_cmd_param ( sel_cmd ).c_str() );
refresh();
box ( midiwin, 0, 0 ); // in this box the received note-on MIDI notes are shown
mvwprintw ( midiwin, 0, 3, "MIDI-IN" );
mvwprintw ( midiwin, 1, 1, "note | value" );
mvwprintw ( midiwin, 0, 8, "MIDI-IN" );
mvwprintw ( midiwin, 1, 2, "note (name) | value" );
wrefresh ( midiwin );
box ( midigwin, 0, 0 ); // in this box the received MIDI velocity graph is shown
mvwprintw ( midigwin, 0, 3, "VELOCITY-GRAPH" );
mvwprintw ( midigwin, 0, 6, "VELOCITY-GRAPH" );
wrefresh ( midigwin );
box ( poswin, 0, 0 ); // in this box the received positional sensing values are shown
mvwprintw ( poswin, 0, 2, "POS" );
Expand Down Expand Up @@ -119,7 +122,7 @@ int process ( jack_nframes_t nframes, void *arg )
{
wmove ( midiwin, 2, 0 );
winsdelln ( midiwin, 1 );
mvwprintw ( midiwin, 2, 1, " %3d | %3d", (int) in_event.buffer[1], (int) in_event.buffer[2] );
mvwprintw ( midiwin, 2, 1, "%3d (%-6s) | %3d", (int) in_event.buffer[1], midi_map[(int) in_event.buffer[1]].c_str(), (int) in_event.buffer[2] );

wmove ( midigwin, 1, 0 );
winsdelln ( midigwin, 1 );
Expand All @@ -133,6 +136,8 @@ int process ( jack_nframes_t nframes, void *arg )
update_pad_selection ( in_event.buffer[1], 22, 26, 2 ); // hi-hat
update_pad_selection ( in_event.buffer[1], 49, 55, 4 ); // crash
update_pad_selection ( in_event.buffer[1], 48, 50, 5 ); // tom1
update_pad_selection ( in_event.buffer[1], 51, 53, 6 ); // ride
update_pad_selection ( in_event.buffer[1], 45, 47, 7 ); // tom2
}
do_update_param_outputs = true;
}
Expand Down Expand Up @@ -186,11 +191,11 @@ int main ( int argc, char *argv[] )

// initialize GUI
mainwin = initscr();
midiwin = newwin ( box_len, 14, row_start + 5, col_start );
midigwin = newwin ( box_len, 26, row_start + 5, col_start + 15 );
poswin = newwin ( box_len, 7, row_start + 5, col_start + 42 );
posgwin = newwin ( box_len, 24, row_start + 5, col_start + 50 );
ctrlwin = newwin ( box_len, 7, row_start + 5, col_start + 75 );
midiwin = newwin ( box_len, 24, row_start + 5, col_start );
midigwin = newwin ( box_len, 26, row_start + 5, col_start + 25 );
poswin = newwin ( box_len, 7, row_start + 5, col_start + 52 );
posgwin = newwin ( box_len, 24, row_start + 5, col_start + 60 );
ctrlwin = newwin ( box_len, 7, row_start + 5, col_start + 85 );
noecho(); // turn off key echoing
keypad ( mainwin, true ); // enable the keypad for non-char keys
nodelay ( mainwin, true ); // we want a non-blocking getch()
Expand Down

0 comments on commit d9db63c

Please sign in to comment.