computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit 34b712e3504a59a01ecbf3aa82ae6f92557744f4
parent edbaa0c17d858c9d7f210848e26c960841bdc55f
Author: Adam M <aemalone@gmail.com>
Date:   Sat, 25 Dec 2021 11:45:02 -0600

Revert "save and load cc 0 thru 15, channels 0 thru 15"

This reverts commit edbaa0c17d858c9d7f210848e26c960841bdc55f.

Diffstat:
Msrc/MolyPidi.cpp | 15+++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/MolyPidi.cpp b/src/MolyPidi.cpp @@ -160,11 +160,9 @@ struct MIDICC_CV : Module { // Remember values so users don't have to touch MIDI controller knobs when restarting Rack json_t* valuesJ = json_array(); - - for (int midiCh = 0; midiCh < 16; midiCh++) { - for (int cc = 0; cc < 16; cc++) { - json_array_append_new(valuesJ, json_integer(ccValues[cc][midiCh])); - } + for (int i = 0; i < 128; i++) { + // Note: Only save channel 0. Since MPE mode won't be commonly used, it's pointless to save all 16 channels. + json_array_append_new(valuesJ, json_integer(ccValues[i][0])); } json_object_set_new(rootJ, "values", valuesJ); @@ -188,13 +186,10 @@ struct MIDICC_CV : Module { json_t* valuesJ = json_object_get(rootJ, "values"); if (valuesJ) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < 128; i++) { json_t* valueJ = json_array_get(valuesJ, i); if (valueJ) { - int cc = i % 16; - int midiCh = (i - cc) / 16; - - ccValues[cc][midiCh] = json_integer_value(valueJ); + ccValues[i][0] = json_integer_value(valueJ); } } }