From 99f1800524cba1a33ce644a2b5e2a47d66b83903 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 14 Dec 2022 12:17:04 +0100 Subject: [PATCH] Many fixes for drums ans playback speed. --- MicroDexed.ino | 48 +++++------ UI.hpp | 12 ++- addon/SD/PERFORMANCE/0/drums.json | 40 ++++----- addon/tools/drumset.cfg | 126 ++++++++++++++-------------- addon/tools/wav2c.sh | 2 +- config.h | 12 +-- dexed_sd.cpp | 2 +- drumset.h | 132 +++++++++++++++--------------- 8 files changed, 191 insertions(+), 183 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 70185b0..34db5b4 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -1001,7 +1001,10 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { if (drum_config[d].drum_data != NULL && drum_config[d].len > 0) { if (configuration.drums.pitch[d] != 0) { Drum[slot]->enableInterpolation(true); - Drum[slot]->setPlaybackRate(configuration.drums.pitch[d] / 100.0f); + Drum[slot]->setPlaybackRate(pow(2,configuration.drums.pitch[d] / 100.0f / 12.0)); // Neues Tempo" = 2("Halbtöne" / 12) x "Altes Tempo" + } else { + Drum[slot]->enableInterpolation(false); + Drum[slot]->setPlaybackRate(1.0); } Drum[slot]->playRaw((int16_t*)drum_config[d].drum_data, drum_config[d].len, 1); #ifdef DEBUG @@ -1014,7 +1017,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { Serial.print(F(" Pan=")); Serial.print(pan, 2); Serial.print(F(" ReverbSend=")); - Serial.println(reverb_send, 2); + Serial.print(reverb_send, 2); Serial.print(F(" Pitch=")); Serial.println(configuration.drums.pitch[d] / 10.0f, 1); #endif @@ -1977,12 +1980,12 @@ void check_configuration_drums(void) { configuration.drums.midi_channel = constrain(configuration.drums.midi_channel, DRUMS_MIDI_CHANNEL_MIN, DRUMS_MIDI_CHANNEL_MAX); for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG - 1; i++) { - configuration.drums.midinote[i] = constrain(drum_config[i].midinote, DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); - configuration.drums.pitch[i] = mapfloat(drum_config[i].pitch, -12.0, 12.0, DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); - configuration.drums.pan[i] = mapfloat(drum_config[i].pan, 0.0, 1.0, DRUMS_PANORAMA_MIN, DRUMS_PANORAMA_MAX); - configuration.drums.vol_max[i] = mapfloat(drum_config[i].vol_max, 0.0, 1.0, DRUMS_VOL_MIN, DRUMS_VOL_MAX); - configuration.drums.vol_min[i] = mapfloat(drum_config[i].vol_min, 0.0, 1.0, DRUMS_VOL_MIN, DRUMS_VOL_MAX); - configuration.drums.reverb_send[i] = mapfloat(drum_config[i].reverb_send, 0.0, 1.0, DRUMS_REVERB_SEND_MIN, DRUMS_REVERB_SEND_MAX); + configuration.drums.midinote[i] = constrain(configuration.drums.midinote[i], DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); + configuration.drums.pitch[i] = constrain(configuration.drums.pitch[i], DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); + configuration.drums.pan[i] = constrain(configuration.drums.pan[i], DRUMS_PANORAMA_MIN, DRUMS_PANORAMA_MAX); + configuration.drums.vol_max[i] = constrain(configuration.drums.vol_max[i], DRUMS_VOL_MIN, DRUMS_VOL_MAX); + configuration.drums.vol_min[i] = constrain(configuration.drums.vol_min[i], DRUMS_VOL_MIN, DRUMS_VOL_MAX); + configuration.drums.reverb_send[i] = constrain(configuration.drums.reverb_send[i], DRUMS_REVERB_SEND_MIN, DRUMS_REVERB_SEND_MAX); } } @@ -2316,22 +2319,21 @@ uint8_t drum_get_slot(uint8_t dt) { drum_type[i] = DRUM_NONE; Drum[i]->enableInterpolation(false); Drum[i]->setPlaybackRate(1.0); + } else { + if (dt == DRUM_HIHAT || dt == DRUM_HANDCLAP) { + Drum[i]->stop(); + drum_type[i] = DRUM_NONE; + Drum[i]->enableInterpolation(false); + Drum[i]->setPlaybackRate(1.0); +#ifdef DEBUG + Serial.print(F("Stopping Drum ")); + Serial.print(i); + Serial.print(F(" type ")); + Serial.println(dt); +#endif + return (i); + } } - // else - // { - // if (drum_type[i] == dt) - // { - //#ifdef DEBUG - // Serial.print(F("Stopping Drum ")); - // Serial.print(i); - // Serial.print(F(" type ")); - // Serial.println(dt); - //#endif - // Drum[i]->stop(); - // - // return (i); - // } - // } } #ifdef DEBUG Serial.print(F("Using next free Drum slot ")); diff --git a/UI.hpp b/UI.hpp index e601d96..cf5a12d 100644 --- a/UI.hpp +++ b/UI.hpp @@ -3981,7 +3981,17 @@ void UI_handle_OP(uint8_t param) { } void UI_func_drum_midi_channel(uint8_t param) { - ; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + ; + } + if (LCDML.FUNC_loop()) // ****** LOOP ********** + { + ; + } + if (LCDML.FUNC_close()) { // ****** STABLE END **** + ; + } } void UI_func_drums_main_volume(uint8_t param) { diff --git a/addon/SD/PERFORMANCE/0/drums.json b/addon/SD/PERFORMANCE/0/drums.json index 4b5da68..7f7f806 100755 --- a/addon/SD/PERFORMANCE/0/drums.json +++ b/addon/SD/PERFORMANCE/0/drums.json @@ -73,10 +73,7 @@ 0, 0, 0, - 11, - 13, 0, - 14, 0, 0, 0, @@ -84,6 +81,13 @@ 0, 0, 0, + 13, + 16, + 0, + 19, + 0, + 0, + 0, 0, 0, 0, @@ -91,10 +95,7 @@ 0, 0, 0, - 10, 0, - 10, - 9, 0, 0, 0, @@ -106,7 +107,6 @@ 0, 0, 0, - 142, 0, 0, 0, @@ -219,39 +219,39 @@ 0, 0, 0, - 0.282828, - 0.343434, - 0.1, + 28, + 34, + 10, 0, 0, - 0.191919, + 19, 0, 0, - -0.343434, - -0.484849, + -34, + -48, 0, 0, 0, - 0.323232, + 32, 0, 0, 0, - -0.2, + -20, 0, - 0.272727, + 27, 0, 0, - 0.080808, + 8, 0, 0, - 0.414141, - -0.151515, + 41, + -15, 0, 0, 0, 0, 0, - -0.252525, + -25, 0, 0, 0, diff --git a/addon/tools/drumset.cfg b/addon/tools/drumset.cfg index 5c99625..4aa6156 100644 --- a/addon/tools/drumset.cfg +++ b/addon/tools/drumset.cfg @@ -1,64 +1,64 @@ # class, midinote, name, shortname, pitch, p_offset, pan, vol_max, vol_min, reverb_send, filename -DRUM_BASS, MIDI_A1, Clap808, B, 0.0, 0.0, 0.8, 0.0, 0.0, Clap808.wav -DRUM_BASS, MIDI_B1, S_kick_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_kick_1.wav -DRUM_BASS, MIDI_C2, S_kick2_8, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_kick2_8.wav -DRUM_PERCUSSION, MIDI_CIS2, S_Stick_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_snareStick_1.wav -DRUM_SNARE, MIDI_D2, S_snare_Ghost_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_snare_Ghost_1.wav -DRUM_SNARE, MIDI_DIS2, S_snare2_Ghost_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_snare2_Ghost_1.wav -DRUM_SNARE, MIDI_E2, S_snare_2, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_snare_2.wav -DRUM_BASS, MIDI_F2, S_loTom_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_loTom_1.wav -DRUM_BASS, MIDI_FIS2, S_hhClosed_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hhClosed_1.wav -DRUM_LOWTOM, MIDI_G2, S_loTom_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_loTom_1.wav -DRUM_BASS, MIDI_GIS2, S_hh_o_1_2, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hh_o_1_2.wav -DRUM_HIGHTOM, MIDI_A2, S_hiTom_5, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav -DRUM_BASS, MIDI_AIS2, S_hh_o_5_4, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hh_o_5_4.wav -DRUM_HIGHTOM, MIDI_B2, S_hiTom_5, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav -DRUM_HIGHTOM, MIDI_C3, S_hiTom_5, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav -DRUM_BASS, MIDI_CIS3, S_splash1_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_splash1_1.wav -DRUM_HIGHTOM, MIDI_D3, S_hiTom_5, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav -DRUM_CRASH, MIDI_DIS3, S_china1_4, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_china1_4.wav -DRUM_CRASH, MIDI_E3, S_china2_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_china2_1.wav -DRUM_RIDE, MIDI_F3, S_ride1Bell_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_ride1Bell_1.wav -DRUM_RIDE, MIDI_FIS3, S_ride1Bell_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_ride1Bell_1.wav -DRUM_CRASH, MIDI_G3, S_crash1_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_crash1_1.wav -DRUM_BASS, MIDI_GIS3, S_cowbell_2, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_cowbell_2.wav -DRUM_RIDE, MIDI_A3, S_ride2Crash_2, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_ride2Crash_2.wav -DRUM_RIDE, MIDI_AIS3, S_ride2_1, B, 0.0, 0.0, 0.8, 0.0, 0.0, S_ride2_1.wav -DRUM_BASS, MIDI_B3, 808Kick, B, 0.0, 0.0, 0.8, 0.0, 0.0, Kick808.wav -DRUM_BASS, MIDI_C4, phkick1, B, 0.0, 0.0, 1.0, 0.0, 0.0, phKick1.wav -DRUM_SNARE, MIDI_CIS4, rims1, R, 0.0, -0.2, 0.7, 0.0, 0.0, Rim808.wav -DRUM_SNARE, MIDI_D4, Shaker, R, 0.0, -0.2, 0.5, 0.0, 0.0, Shaker.wav -DRUM_HANDCLAP, MIDI_DIS4, LNclap1, C, 0.0, 0.1, 0.9, 0.0, 0.1, LnClap.wav -DRUM_SNARE, MIDI_E4, LNsnare1, S, 0.0, 0.0, 0.9, 0.0, 0.0, LnSnare1.wav -DRUM_BASS, MIDI_F4, Bdtrancy, B, 0.0, 0.0, 0.9, 0.0, 0.0, BDTrancy.wav -DRUM_HIHAT, MIDI_FIS4, hhcl1, H, 0.0, 1.0, 0.6, 0.0, 0.0, HhCL1-808.wav -DRUM_BASS, MIDI_G4, Belltree, B, 0.0, 0.0, 0.7, 0.0, 0.0, Belltree.wav -DRUM_BASS, MIDI_GIS4, Bongo16, B, 0.0, 0.0, 0.9, 0.0, 0.0, Bongo16.wav -DRUM_BASS, MIDI_A4, Bongo27, B, 0.0, 0.0, 0.9, 0.0, 0.0, Bongo27.wav -DRUM_BASS, MIDI_AIS4, Casta, B, 0.0, 0.0, 0.9, 0.0, 0.0, Casta.wav -DRUM_BASS, MIDI_B4, Cr78kick, B, 0.0, 0.0, 1.0, 0.0, 0.0, CR78Kick.wav -DRUM_HIHAT, MIDI_C5, Cr78tmb1, B, 0.0, 0.0, 0.8, 0.0, 0.0, CR78Tmb1.wav -DRUM_HIHAT, MIDI_CIS5, Cr78tmb2, B, 0.0, 0.0, 0.8, 0.0, 0.0, CR78Tmb2.wav -DRUM_BASS, MIDI_D5, Crash1, B, 0.0, 0.0, 0.9, 0.0, 0.0, Crash1.wav -DRUM_BASS, MIDI_DIS5, Dmpop, B, 0.0, 0.0, 0.9, 0.0, 0.0, DMpop.wav -DRUM_BASS, MIDI_E5, Electr1, B, 0.0, 0.0, 0.9, 0.0, 0.0, Electr1.wav -DRUM_BASS, MIDI_F5, Excow, B, 0.0, 0.0, 0.9, 0.0, 0.0, EXcow.wav -DRUM_PERCUSSION, MIDI_FIS5, Tamb, T, 0.0, -0.2, 0.6, 0.0, 0.0, Tamb.wav -DRUM_PERCUSSION, MIDI_GIS5, Cowbell, S, 0.0, 0.2, 0.6, 0.0, 0.0, CowBell.wav -DRUM_HIHAT, MIDI_G5, 660HatC1, T, 0.0, 0.0, 0.6, 0.0, 0.0, HatC660.wav -DRUM_HIHAT, MIDI_A5, Hhopen1, S, 0.0, 0.0, 0.6, 0.0, 0.0, HHopen1.wav -DRUM_PERCUSSION, MIDI_AIS5, Histicks, S, 0.0, 0.0, 0.6, 0.0, 0.0, HiSticks.wav -DRUM_PERCUSSION, MIDI_B5, Hr16snr2, S, 0.0, 0.0, 0.6, 0.0, 0.0, HR16Snr2.wav -DRUM_HIGHTOM, MIDI_C6, Xrhitom, B, 0.0, 0.0, 0.8, 0.0, 0.0, XRHiTom.wav -DRUM_PERCUSSION, MIDI_CIS6, Tick1, S, 0.0, 0.0, 0.9, 0.0, 0.0, Tick1.wav -DRUM_PERCUSSION, MIDI_D6, M1-18, S, 0.0, 0.0, 0.9, 0.0, 0.0, M1-18.wav -DRUM_PERCUSSION, MIDI_DIS6, Md16_clp, S, 0.0, 0.0, 0.9, 0.0, 0.0, MD16_CLP.wav -DRUM_HIHAT, MIDI_E6, Ohhwav, S, 0.0, 0.0, 0.9, 0.0, 0.0, OHH909.wav -DRUM_PERCUSSION, MIDI_F6, Quijada, S, 0.0, 0.0, 0.9, 0.0, 0.0, Quijada.wav -DRUM_PERCUSSION, MIDI_FIS6, tabla1, S, 0.0, 0.0, 0.9, 0.0, 0.0, R8Tabla1.wav -DRUM_PERCUSSION, MIDI_G6, Ride808, S, 0.0, 0.0, 0.9, 0.0, 0.0, Ride808.wav -DRUM_PERCUSSION, MIDI_GIS6, Scratch1, S, 0.0, 0.0, 0.7, 0.0, 0.0, scratch1.wav -DRUM_PERCUSSION, MIDI_A6, Tomlow, S, 0.0, 0.0, 0.9, 0.0, 0.0, TomLow.wav -DRUM_PERCUSSION, MIDI_AIS6, Tom808, S, 0.0, 0.0, 0.9, 0.0, 0.0, Tom808.wav -DRUM_BASS, MIDI_B6, Vl1lbeep, B, 0.0, 0.0, 0.8, 0.0, 0.0, vl1-Lbeep.wav -DRUM_BASS, MIDI_C7, Vl1hbeep, B, 0.0, 0.0, 0.8, 0.0, 0.0, vl1-Hbeep.wav +DRUM_BASS, MIDI_A1, Clap808, B, 1.0, 0.0, 0.8, 0.0, 0.0, Clap808.wav +DRUM_BASS, MIDI_B1, S_kick_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_kick_1.wav +DRUM_BASS, MIDI_C2, S_kick2_8, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_kick2_8.wav +DRUM_PERCUSSION, MIDI_CIS2, S_Stick_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_snareStick_1.wav +DRUM_SNARE, MIDI_D2, S_snare_Ghost_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_snare_Ghost_1.wav +DRUM_SNARE, MIDI_DIS2, S_snare2_Ghost_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_snare2_Ghost_1.wav +DRUM_SNARE, MIDI_E2, S_snare_2, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_snare_2.wav +DRUM_BASS, MIDI_F2, S_loTom_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_loTom_1.wav +DRUM_HIHAT, MIDI_FIS2, S_hhClosed_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_hhClosed_1.wav +DRUM_LOWTOM, MIDI_G2, S_loTom_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_loTom_1.wav +DRUM_HIHAT, MIDI_GIS2, S_hh_o_1_2, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_hh_o_1_2.wav +DRUM_HIGHTOM, MIDI_A2, S_hiTom_5, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav +DRUM_BASS, MIDI_AIS2, S_hh_o_5_4, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_hh_o_5_4.wav +DRUM_HIGHTOM, MIDI_B2, S_hiTom_5, B, 1.3, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav +DRUM_HIGHTOM, MIDI_C3, S_hiTom_5, B, 1.6, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav +DRUM_BASS, MIDI_CIS3, S_splash1_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_splash1_1.wav +DRUM_HIGHTOM, MIDI_D3, S_hiTom_5, B, 1.9, 0.0, 0.8, 0.0, 0.0, S_hiTom_5.wav +DRUM_CRASH, MIDI_DIS3, S_china1_4, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_china1_4.wav +DRUM_CRASH, MIDI_E3, S_china2_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_china2_1.wav +DRUM_RIDE, MIDI_F3, S_ride1Bell_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_ride1Bell_1.wav +DRUM_RIDE, MIDI_FIS3, S_ride1Bell_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_ride1Bell_1.wav +DRUM_CRASH, MIDI_G3, S_crash1_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_crash1_1.wav +DRUM_BASS, MIDI_GIS3, S_cowbell_2, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_cowbell_2.wav +DRUM_RIDE, MIDI_A3, S_ride2Crash_2, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_ride2Crash_2.wav +DRUM_RIDE, MIDI_AIS3, S_ride2_1, B, 1.0, 0.0, 0.8, 0.0, 0.0, S_ride2_1.wav +DRUM_BASS, MIDI_B3, 808Kick, B, 1.0, 0.0, 0.8, 0.0, 0.0, Kick808.wav +DRUM_BASS, MIDI_C4, phkick1, B, 1.0, 0.0, 1.0, 0.0, 0.0, phKick1.wav +DRUM_SNARE, MIDI_CIS4, rims1, R, 1.0, -0.2, 0.7, 0.0, 0.0, Rim808.wav +DRUM_SNARE, MIDI_D4, Shaker, R, 1.0, -0.2, 0.5, 0.0, 0.0, Shaker.wav +DRUM_HANDCLAP, MIDI_DIS4, LNclap1, C, 1.0, 0.1, 0.9, 0.0, 0.1, LnClap.wav +DRUM_SNARE, MIDI_E4, LNsnare1, S, 1.0, 0.0, 0.9, 0.0, 0.0, LnSnare1.wav +DRUM_BASS, MIDI_F4, Bdtrancy, B, 1.0, 0.0, 0.9, 0.0, 0.0, BDTrancy.wav +DRUM_HIHAT, MIDI_FIS4, hhcl1, H, 1.0, 1.0, 0.6, 0.0, 0.0, HhCL1-808.wav +DRUM_BASS, MIDI_G4, Belltree, B, 1.0, 0.0, 0.7, 0.0, 0.0, Belltree.wav +DRUM_BASS, MIDI_GIS4, Bongo16, B, 1.0, 0.0, 0.9, 0.0, 0.0, Bongo16.wav +DRUM_BASS, MIDI_A4, Bongo27, B, 1.0, 0.0, 0.9, 0.0, 0.0, Bongo27.wav +DRUM_BASS, MIDI_AIS4, Casta, B, 1.0, 0.0, 0.9, 0.0, 0.0, Casta.wav +DRUM_BASS, MIDI_B4, Cr78kick, B, 1.0, 0.0, 1.0, 0.0, 0.0, CR78Kick.wav +DRUM_HIHAT, MIDI_C5, Cr78tmb1, B, 1.0, 0.0, 0.8, 0.0, 0.0, CR78Tmb1.wav +DRUM_HIHAT, MIDI_CIS5, Cr78tmb2, B, 1.0, 0.0, 0.8, 0.0, 0.0, CR78Tmb2.wav +DRUM_BASS, MIDI_D5, Crash1, B, 1.0, 0.0, 0.9, 0.0, 0.0, Crash1.wav +DRUM_BASS, MIDI_DIS5, Dmpop, B, 1.0, 0.0, 0.9, 0.0, 0.0, DMpop.wav +DRUM_BASS, MIDI_E5, Electr1, B, 1.0, 0.0, 0.9, 0.0, 0.0, Electr1.wav +DRUM_BASS, MIDI_F5, Excow, B, 1.0, 0.0, 0.9, 0.0, 0.0, EXcow.wav +DRUM_PERCUSSION, MIDI_FIS5, Tamb, T, 1.0, -0.2, 0.6, 0.0, 0.0, Tamb.wav +DRUM_PERCUSSION, MIDI_GIS5, Cowbell, S, 1.0, 0.2, 0.6, 0.0, 0.0, CowBell.wav +DRUM_HIHAT, MIDI_G5, 660HatC1, T, 1.0, 0.0, 0.6, 0.0, 0.0, HatC660.wav +DRUM_HIHAT, MIDI_A5, Hhopen1, S, 1.0, 0.0, 0.6, 0.0, 0.0, HHopen1.wav +DRUM_PERCUSSION, MIDI_AIS5, Histicks, S, 1.0, 0.0, 0.6, 0.0, 0.0, HiSticks.wav +DRUM_PERCUSSION, MIDI_B5, Hr16snr2, S, 1.0, 0.0, 0.6, 0.0, 0.0, HR16Snr2.wav +DRUM_HIGHTOM, MIDI_C6, Xrhitom, B, 1.0, 0.0, 0.8, 0.0, 0.0, XRHiTom.wav +DRUM_PERCUSSION, MIDI_CIS6, Tick1, S, 1.0, 0.0, 0.9, 0.0, 0.0, Tick1.wav +DRUM_PERCUSSION, MIDI_D6, M1-18, S, 1.0, 0.0, 0.9, 0.0, 0.0, M1-18.wav +DRUM_PERCUSSION, MIDI_DIS6, Md16_clp, S, 1.0, 0.0, 0.9, 0.0, 0.0, MD16_CLP.wav +DRUM_HIHAT, MIDI_E6, Ohhwav, S, 1.0, 0.0, 0.9, 0.0, 0.0, OHH909.wav +DRUM_PERCUSSION, MIDI_F6, Quijada, S, 1.0, 0.0, 0.9, 0.0, 0.0, Quijada.wav +DRUM_PERCUSSION, MIDI_FIS6, tabla1, S, 1.0, 0.0, 0.9, 0.0, 0.0, R8Tabla1.wav +DRUM_PERCUSSION, MIDI_G6, Ride808, S, 1.0, 0.0, 0.9, 0.0, 0.0, Ride808.wav +DRUM_PERCUSSION, MIDI_GIS6, Scratch1, S, 1.0, 0.0, 0.7, 0.0, 0.0, scratch1.wav +DRUM_PERCUSSION, MIDI_A6, Tomlow, S, 1.0, 0.0, 0.9, 0.0, 0.0, TomLow.wav +DRUM_PERCUSSION, MIDI_AIS6, Tom808, S, 1.0, 0.0, 0.9, 0.0, 0.0, Tom808.wav +DRUM_BASS, MIDI_B6, Vl1lbeep, B, 1.0, 0.0, 0.8, 0.0, 0.0, vl1-Lbeep.wav +DRUM_BASS, MIDI_C7, Vl1hbeep, B, 1.0, 0.0, 0.8, 0.0, 0.0, vl1-Hbeep.wav diff --git a/addon/tools/wav2c.sh b/addon/tools/wav2c.sh index b24d4ed..5595cf0 100755 --- a/addon/tools/wav2c.sh +++ b/addon/tools/wav2c.sh @@ -106,7 +106,7 @@ typedef struct drum_config_s { float32_t reverb_send; // how much signal to send to the reverb (0.0 - 1.0) } drum_config_t; -enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION, DRUM_POLY}; +enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION}; EOF rm -f "${DRUMS_H}" diff --git a/config.h b/config.h index 9ac721b..99da738 100644 --- a/config.h +++ b/config.h @@ -660,11 +660,8 @@ #define DRUMS_REVERB_SEND_MIN 0 #define DRUMS_REVERB_SEND_MAX 99 -#define DRUMS_PITCH_MIN -50 -#define DRUMS_PITCH_MAX 50 - -#define DRUMS_PITCH_FLOAT_MIN -5.0 -#define DRUMS_PITCH_FLOAT_MAX -5.0 +#define DRUMS_PITCH_MIN -120 +#define DRUMS_PITCH_MAX 120 #define EQ_1_MIN 15 #define EQ_1_MAX 250 @@ -814,8 +811,7 @@ #define VOLUME_MULTIPLIER 1.4 // Buffer-size define for load/save configuration as JSON -//#define JSON_BUFFER_SIZE 8192 -#define JSON_BUFFER_SIZE 5120 +#define JSON_BUFFER_SIZE 8192 // Internal configuration structure typedef struct dexed_s { @@ -925,7 +921,7 @@ typedef struct drums_s { uint8_t midi_channel; uint8_t midinote[NUM_DRUMSET_CONFIG]; int8_t pitch[NUM_DRUMSET_CONFIG]; - uint8_t pan[NUM_DRUMSET_CONFIG]; + int8_t pan[NUM_DRUMSET_CONFIG]; uint8_t vol_max[NUM_DRUMSET_CONFIG]; uint8_t vol_min[NUM_DRUMSET_CONFIG]; uint8_t reverb_send[NUM_DRUMSET_CONFIG]; diff --git a/dexed_sd.cpp b/dexed_sd.cpp index 90f5262..9977a24 100644 --- a/dexed_sd.cpp +++ b/dexed_sd.cpp @@ -435,7 +435,7 @@ bool load_sd_drumsettings_json(uint8_t number) { for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG - 1; i++) { configuration.drums.midinote[i] = uint8_t(data_json["note"][i]); configuration.drums.pitch[i] = int8_t(data_json["pitch"][i]); - configuration.drums.pan[i] = uint8_t(data_json["pan"][i]); + configuration.drums.pan[i] = int8_t(data_json["pan"][i]); configuration.drums.vol_max[i] = uint8_t(data_json["vol_max"][i]); configuration.drums.vol_min[i] = uint8_t(data_json["vol_min"][i]); configuration.drums.reverb_send[i] = uint8_t(data_json["reverb_send"][i]); diff --git a/drumset.h b/drumset.h index 1094e04..0c6f51b 100644 --- a/drumset.h +++ b/drumset.h @@ -16,7 +16,7 @@ typedef struct drum_config_s { float32_t reverb_send; // how much signal to send to the reverb (0.0 - 1.0) } drum_config_t; -enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION, DRUM_POLY}; +enum {DRUM_NONE, DRUM_BASS, DRUM_SNARE, DRUM_HIHAT, DRUM_HANDCLAP, DRUM_RIDE, DRUM_CRASH, DRUM_LOWTOM, DRUM_MIDTOM, DRUM_HIGHTOM, DRUM_PERCUSSION}; // Converted from Clap808.wav, length = 7744 bytes PROGMEM const uint8_t DRUM_Clap808[] = { @@ -239226,7 +239226,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Clap808, "B", 7744, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239239,7 +239239,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_kick_1, "B", 19520, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239252,7 +239252,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_kick2_8, "B", 19200, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239265,7 +239265,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_Stick_1, "B", 10432, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239278,7 +239278,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_snare_Ghost_1, "B", 19008, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239291,7 +239291,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_snare2_Ghost_1, "B", 22464, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239304,7 +239304,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_snare_2, "B", 17920, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239317,20 +239317,20 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_loTom_1, "B", 40320, - 0.0, + 1.0, 0.0, 0.8, 0.0, 0.0 }, { - DRUM_BASS, + DRUM_HIHAT, MIDI_FIS2, "S_hhClosed_1", DRUM_S_hhClosed_1, "B", 6784, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239343,20 +239343,20 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_loTom_1, "B", 40320, - 0.0, + 1.0, 0.0, 0.8, 0.0, 0.0 }, { - DRUM_BASS, + DRUM_HIHAT, MIDI_GIS2, "S_hh_o_1_2", DRUM_S_hh_o_1_2, "B", 18240, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239369,7 +239369,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_hiTom_5, "B", 23040, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239382,7 +239382,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_hh_o_5_4, "B", 80320, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239395,7 +239395,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_hiTom_5, "B", 23040, - 0.0, + 1.3, 0.0, 0.8, 0.0, @@ -239408,7 +239408,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_hiTom_5, "B", 23040, - 0.0, + 1.6, 0.0, 0.8, 0.0, @@ -239421,7 +239421,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_splash1_1, "B", 57856, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239434,7 +239434,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_hiTom_5, "B", 23040, - 0.0, + 1.9, 0.0, 0.8, 0.0, @@ -239447,7 +239447,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_china1_4, "B", 75840, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239460,7 +239460,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_china2_1, "B", 68864, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239473,7 +239473,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_ride1Bell_1, "B", 58752, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239486,7 +239486,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_ride1Bell_1, "B", 58752, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239499,7 +239499,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_crash1_1, "B", 112064, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239512,7 +239512,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_cowbell_2, "B", 18368, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239525,7 +239525,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_ride2Crash_2, "B", 132160, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239538,7 +239538,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_S_ride2_1, "B", 77504, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239551,7 +239551,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_808Kick, "B", 26688, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239564,7 +239564,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_phkick1, "B", 4800, - 0.0, + 1.0, 0.0, 1.0, 0.0, @@ -239577,7 +239577,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_rims1, "R", 768, - 0.0, + 1.0, -0.2, 0.7, 0.0, @@ -239590,7 +239590,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Shaker, "R", 1792, - 0.0, + 1.0, -0.2, 0.5, 0.0, @@ -239603,7 +239603,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_LNclap1, "C", 6976, - 0.0, + 1.0, 0.1, 0.9, 0.0, @@ -239616,7 +239616,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_LNsnare1, "S", 10560, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239629,7 +239629,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Bdtrancy, "B", 7872, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239642,7 +239642,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_hhcl1, "H", 6208, - 0.0, + 1.0, 1.0, 0.6, 0.0, @@ -239655,7 +239655,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Belltree, "B", 121408, - 0.0, + 1.0, 0.0, 0.7, 0.0, @@ -239668,7 +239668,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Bongo16, "B", 6464, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239681,7 +239681,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Bongo27, "B", 11712, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239694,7 +239694,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Casta, "B", 2048, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239707,7 +239707,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Cr78kick, "B", 10048, - 0.0, + 1.0, 0.0, 1.0, 0.0, @@ -239720,7 +239720,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Cr78tmb1, "B", 7552, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239733,7 +239733,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Cr78tmb2, "B", 10880, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239746,7 +239746,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Crash1, "B", 72768, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239759,7 +239759,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Dmpop, "B", 7808, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239772,7 +239772,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Electr1, "B", 2880, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239785,7 +239785,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Excow, "B", 18368, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239798,7 +239798,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Tamb, "T", 8128, - 0.0, + 1.0, -0.2, 0.6, 0.0, @@ -239811,7 +239811,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Cowbell, "S", 7296, - 0.0, + 1.0, 0.2, 0.6, 0.0, @@ -239824,7 +239824,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_660HatC1, "T", 5952, - 0.0, + 1.0, 0.0, 0.6, 0.0, @@ -239837,7 +239837,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Hhopen1, "S", 11200, - 0.0, + 1.0, 0.0, 0.6, 0.0, @@ -239850,7 +239850,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Histicks, "S", 2432, - 0.0, + 1.0, 0.0, 0.6, 0.0, @@ -239863,7 +239863,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Hr16snr2, "S", 15168, - 0.0, + 1.0, 0.0, 0.6, 0.0, @@ -239876,7 +239876,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Xrhitom, "B", 13504, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -239889,7 +239889,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Tick1, "S", 640, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239902,7 +239902,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_M1_18, "S", 2240, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239915,7 +239915,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Md16_clp, "S", 13312, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239928,7 +239928,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Ohhwav, "S", 23488, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239941,7 +239941,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Quijada, "S", 36096, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239954,7 +239954,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_tabla1, "S", 15488, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239967,7 +239967,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Ride808, "S", 21696, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -239980,7 +239980,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Scratch1, "S", 5888, - 0.0, + 1.0, 0.0, 0.7, 0.0, @@ -239993,7 +239993,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Tomlow, "S", 15360, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -240006,7 +240006,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Tom808, "S", 6272, - 0.0, + 1.0, 0.0, 0.9, 0.0, @@ -240019,7 +240019,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Vl1lbeep, "B", 3008, - 0.0, + 1.0, 0.0, 0.8, 0.0, @@ -240032,7 +240032,7 @@ PROGMEM const drum_config_t drum_config[NUM_DRUMSET_CONFIG] = DRUM_Vl1hbeep, "B", 1984, - 0.0, + 1.0, 0.0, 0.8, 0.0,