jmamma / MCL

MCL firmware for the MegaCommand MIDI Controller.
BSD 2-Clause "Simplified" License
48 stars 9 forks source link

Assortment of recent bugs #154

Closed yatli closed 3 years ago

yatli commented 3 years ago
yatli commented 3 years ago
C:\Users\Yatao\Documents\Arduino\hardware\MIDICtrl20_MegaCommand\avr\cores\megacommand\MD\MDMessages.cpp:214:57: warning: left shift count >= width of type [-Wshift-count-overflow]
 uint8_t MDMachine::get_model() { return model &= ~(1 << 17); }
jmamma commented 3 years ago
 uint8_t MDMachine::get_model() { return model &= ~(1 << 17); }

Bit 17 is set as tonality. So we must clear it when returning model type ??

jmamma commented 3 years ago

Chain write on a tight time budget result in off-beat tracks. The problem goes away if I stop/restart playback.

Yeah this one is on the list.

jmamma commented 3 years ago

LEV of all tracks stuck at 127 on chain write

This is expected behaviour. CONFIG -> MACHINEDRUM -> NORMALIZE. (LEV is boosted to 127, and VOL is lowered to compensate.)

yatli commented 3 years ago

uint8_t MDMachine::get_model() { return model &= ~(1 << 17); }

Bit 17 is set as tonality. So we must clear it when returning model type ??

uint8_t return type will automatically clear that

nvm, this should be fine.

yatli commented 3 years ago

This is expected behaviour. CONFIG -> MACHINEDRUM -> NORMALIZE.

I see. I think I hear the difference because I have an LFO on VOL -- should turn normalization off.

jmamma commented 3 years ago

uint8_t return type will automatically clear that

good point.

jmamma commented 3 years ago

I see. I think I hear the difference because I have an LFO on VOL -- should turn normalization off.

The is normalisation code should scale LFOs accordingly, but i think the relationship is not linear so there may be some differences.

11 void MDMachine::scale_vol(float scale) {
 12   DEBUG_PRINT_FN();
 13   params[MODEL_VOL] = (uint8_t)((float)params[MODEL_VOL] * scale);
 14   if (params[MODEL_VOL] > 127) {
 15     params[MODEL_VOL] = 127;
 16   }
 17   if ((lfo.destinationParam == MODEL_VOL) && (lfo.destinationTrack == track)) {
 18     params[MODEL_LFOD] = (uint8_t)((float)params[MODEL_LFOD] * scale);
 19 
 20     if (params[MODEL_LFOD] > 127) {
 21       params[MODEL_LFOD] = 127;
 22     }
 23     lfo.depth = params[MODEL_LFOD];
 24   }
 25 }
 26 
 27 float MDMachine::normalize_level() {
 28   DEBUG_PRINT_FN();
 29   if (level == 127) {
 30     return 1.0;
 31   }
 32 
 33   float scale = (float)level / (float)127;
 34   level = 127;
 35 
 36   scale_vol(scale);
 37   return scale;
 38 }
jmamma commented 3 years ago

Seems like the timing issue only occurs when MIDI tracks on grid 2 are loaded.

jmamma commented 3 years ago

3ad60ec

Timing feels good now. Can you confirm @yatli

jmamma commented 3 years ago
Save results in wrong kit name
In X.04 with trig chain of >=3 tracks, sometimes one of the tracks is double-triggered (b-boom)

I can't replicate these.

I also cant replicate your merge bug with GND-X machines.

yatli commented 3 years ago

I can't repro the trig chain problem now.

yatli commented 3 years ago

Another bug -- chaining while playing result in wrong automation -- I have a track without slides, but chaining to it result in a knob being modulated from 0 to 127 and back again rapidly.

jmamma commented 3 years ago

LFOTrack ?

yatli commented 3 years ago

oh didn't thought of that. But when I stop/start it's gone

jmamma commented 3 years ago

Can you replicate the chain movement that got you in to the state?

jmamma commented 3 years ago

@yatli

/Applications/Arduino_nightly.app/Contents/Java/hardware/MIDICtrl20_MegaCommand/avr/cores/megacommand/CommonTools/RingBuffer.h:111:16: error: invalid conversion from 'volatile void*' to 'void*' [-fpermissive]
     memcpy(buf + wr, src, s * sizeof(C));
            ~~~~^~~~

?

yatli commented 3 years ago

Add -fpermissive to g++ flags

yatli commented 3 years ago

FYI current arduino platform.txt options:

compiler.cpp.flags=-std=gnu++1z -c -Os {compiler.warning_flags} -MMD -Wno-attributes -Wno-write-strings -fpermissive -fno-exceptions -fno-threadsafe-statics -fno-rtti -ffunction-sections -fdata-sections -flto=jobserver -Wl,--gc-section,--defsym=__stack=0x8021ff,--section-start,.data=0x802100,--defsym=__heap_end=0x80ffff,--relax -I{build.core.path}/Midi -I{build.core.path}/GUI -I{build.core.path}/CommonTools -I{build.core.path}/Elektron -I{build.core.path}/MD -I{build.core.path}/MidiTools -I{build.core.path}/Sequencer -I{build.core.path}/MNM -I{build.core.path}/PageTools -I{build.core.path}/MDSketches -I{build.core.path}/MDPages -I{build.core.path}/A4 -I{build.core.path}/SPI -I{build.core.path}/Wire -I{build.core.path}/Adafruit-GFX-Library -I{build.core.path}/Adafruit_SSD1305_Library -I{build.core.path}/SdFat -I{build.core.path}/SDCard -I{build.core.path}/MCL
jmamma commented 3 years ago

nice

yatli commented 3 years ago

Converted the X tunnel song to MCL -- timing is good. Also tight chain writes are robust! 🎖

yatli commented 3 years ago

Trying to extract that project for you via MegaCom:

image

yatli commented 3 years ago

MegaCom behavior is interesting -- matches the design goals -- more bandwidth on simpler pages (17KB/s on MIXER), and "nicer" on fancy pages (7KB/s on GRID)

Screensaver = 30KB/s

yatli commented 3 years ago

X_mcl.zip

yatli commented 3 years ago

hmm I still cannot activate chain mode

jmamma commented 3 years ago

Haven't even had a chance to look at megacom yet. you'll need to recreate the binaries because last time I tried they didnt work.

I'll be heading off for a few hours. back later tonight.

jmamma commented 3 years ago

hmm I still cannot activate chain mode

what do you mean?

yatli commented 3 years ago

Set row 0 to chain to row 1, manual Chain write row 0, expecting it to jump to row 1 after playback Not jumping, not displaying the estimated jump time below current time

jmamma commented 3 years ago

there used to be a chain bug on row 0. maybe it came back.

yatli commented 3 years ago

Tried row 1 no banana

jmamma commented 3 years ago

Did you set chain mode to AUTO

jmamma commented 3 years ago

Loops need to be greater than 0 per slot

jmamma commented 3 years ago

@yatli can you double check and report back.

jmamma commented 3 years ago

yatli commented 3 years ago

Woke up

jmamma commented 3 years ago

Wake up Samurai, we've got a firmware to burn.

yatli commented 3 years ago

Just tested -- chain update on any row, loop=1, row=next, cannot activate. Side effect is, kit name is lost after the update

jmamma commented 3 years ago

Chain mode ?

yatli commented 3 years ago

Yes, the button 3 menu, use encoder3 to select all tracks, set row to next, set loop to 1, release button 3 -- kit name is now blank.

jmamma commented 3 years ago

No i mean... from grid page.. hold shift 2. Set CHAIN mode from MANUAL to AUTO

yatli commented 3 years ago

It works! AUTO never worked for me before -- I was sticking with MANUAL all along

jmamma commented 3 years ago

haha 😆

jmamma commented 3 years ago

I think MCL 3.10 is done. I've updated the changelog.

jmamma commented 3 years ago

That means it's time.

yatli commented 3 years ago

image

yatli commented 3 years ago

Yahoooo

jmamma commented 3 years ago

preparing binaries...

jmamma commented 3 years ago

Ready to go here. I sent you a message elsewhere on github for your verification .

jmamma commented 3 years ago

okay tested here.

🚀

jmamma commented 3 years ago

Going live...