Skip to content

Commit

Permalink
Re-implemnt Bug fix: chaining an entire row then immediately starting…
Browse files Browse the repository at this point in the history
… clock could cause corrupt sysex

We now use delay compensation to anticipate the duration
of the MDKit transfer and mute the sequencer for that time.
  • Loading branch information
jmamma committed Jan 6, 2020
1 parent b159207 commit ec54b5d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
11 changes: 9 additions & 2 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ Bug fix release:

- Poly mode would not work unless MD was restarted, fixed.

- Poly voice select is now accessible from Chromatic Page by pressing [
Save + Write|Chain ]

- Chromatic Page: Changes to voice selection.

If current track is a poly track, then select voices from the poly
tracks. Otherwise if current is not a poly track use the current track
as the chromatic voice.
tracks. Otherwise if current track is not a poly track use the current track
as a monophonic voice.

When MD is set to be controlled by external midi, only the poly voices
will be playable.
Expand All @@ -21,6 +24,10 @@ Bug fix release:
- Sequencer notes would occasionally drop out when using page_select page.
fixed.

- Chaining an entire row, and then immediately pressing play on the MD
could cause corrupt sysex data to be sent to the MD, causing loud noises
and an abrupt pattern change. fixed.

MCL 2.50 01/12/2019

Complete GUI overhaul:
Expand Down
17 changes: 15 additions & 2 deletions avr/cores/megacommand/MCL/MCLActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,11 @@ void MCLActions::send_tracks_to_devices() {
KitExtra kit_extra;
volatile uint8_t *ptr;


uint8_t mute_states[16];
for (i = 0; i < NUM_TRACKS; i++) {


mute_states[i] = mcl_seq.md_tracks[i].mute_state;
mcl_seq.md_tracks[i].mute_state = SEQ_MUTE_ON;
if ((note_interface.notes[i] > 1)) {
if (first_note == 254) {
first_note = i;
Expand Down Expand Up @@ -380,6 +381,7 @@ void MCLActions::send_tracks_to_devices() {
MD.kit.origPosition = MD.currentKit;

/*Send the encoded kit to the MD via sysex*/
uint16_t myclock = slowclock;

md_setsysex_recpos(4, MD.kit.origPosition);
MD.kit.toSysex();
Expand All @@ -399,6 +401,17 @@ void MCLActions::send_tracks_to_devices() {
}
}
#endif
uint16_t md_latency_ms = 10000.0 * ((float)sizeof(MDKit) / (float) MidiUart.speed);

DEBUG_PRINTLN("latency");
DEBUG_PRINTLN(md_latency_ms);

while (clock_diff(myclock,slowclock) < md_latency_ms) { GUI.loop(); };

for (uint8_t i = 0; i < NUM_MD_TRACKS; i++) {
mcl_seq.md_tracks[i].mute_state = mute_states[i];
}

/*All the tracks have been sent so clear the write queue*/
write_original = 0;
if ((mcl_cfg.chain_mode == 0) || (mcl_cfg.chain_mode == 2)) {
Expand Down

0 comments on commit ec54b5d

Please sign in to comment.