Closed jmamma closed 3 years ago
Shift left and shift right are broken. Have been before since I was working on piano_roll.
velocity shifting was missing.
still seems broken.
just to confirm @yatli we are shifting around visible length. not the entire data structure?
520ee3f
reverse has mysteriously disappeared from menu options... SEQ_MENU_REVERSE is not disabled anywhere...
If I add
@@ -85,6 +85,8 @@ void SeqPage::init() {
seq_menu_page.menu.enable_entry(SEQ_MENU_PIANOROLL, false);
seq_menu_page.menu.enable_entry(SEQ_MENU_PARAMSELECT, false);
seq_menu_page.menu.enable_entry(SEQ_MENU_SLIDE, false);
+ seq_menu_page.menu.enable_entry(SEQ_MENU_REVERSE, true);
+
I get a corrupt menu, and then lockup.
@yatli can you investigate what's happening here.
just to confirm @yatli we are shifting around visible length. not the entire data structure?
IIRC yes
33 class MenuBase {
34 public:
35 uint8_t entry_mask[2];
we've gone beyond 16bit.
lol.
uint8_t entry_mask[2];
ha you beat me to it
yes
it's a 32bit console era now
hmm, how about splitting the seq page menu?
let me prototype it (don't have MC at hand, but anyway I can try it)
I think we would be doubling up on menu items if we did that.
Running out of time for 3.0 release. I'm trying to wrap this one up ASAP.
985 case DIR_REVERSE:
986 uint16_t end = ev_end / 2;
987 for (uint16_t i = 0; i < end; ++i) {
988 auto tmp = events[i];
989 auto j = ev_end - i - 1;
990 events[i] = events[j];
991 events[j] = tmp;
992
993 // need to flip note on/off
994 if (!events[i].is_lock) {
995 events[i].event_on = !events[i].event_on;
996 }
997
998 if (!events[j].is_lock) {
999 events[j].event_on = !events[j].event_on;
1000 }
1001 }
1002 for (uint8_t n = 0; n < length; n++) {
1003 uint8_t vel_tmp = velocities[n];
1004 uint8_t z = length - 1 - n;
1005 velocities[n] = velocities[z];
1006 velocities[z] = vel_tmp;
1007 }
1008 timing_buckets.reverse(length);
1009 break;
what's wrong here ^
where
955 locate(length, ev_idx, ev_end);
Running out of time for 3.0 release. I'm trying to wrap this one up ASAP.
Ok, discarding.
velocity is 0..127 event is 0..511
yes velocity has been separated. see above ^
yep, but velocity reverse uses length
which is for events.
I think the problem might be to do with microtiming ?
If I have the notes at full step length it's okay ?
microtiming not reversed!
try this:
case DIR_REVERSE:
uint16_t end = ev_end / 2;
uint8_t timing_mid_2x = get_timing_mid() * 2;
for (uint16_t i = 0; i < end; ++i) {
auto tmp = events[i];
auto j = ev_end - 1 - i;
events[i] = events[j];
events[j] = tmp;
// need to flip note on/off
if (!events[i].is_lock) { events[i].event_on = !events[i].event_on; }
if (!events[j].is_lock) { events[j].event_on = !events[j].event_on; }
// reverse microtiming
events[i].micro_timing = timing_mid_2x - events[i].micro_timing;
events[j].micro_timing = timing_mid_2x - events[j].micro_timing;
}
for (uint8_t n = 0; n < length; n++) {
uint8_t vel_tmp = velocities[n];
uint8_t z = length - 1 - n;
velocities[n] = velocities[z];
velocities[z] = vel_tmp;
}
timing_buckets.reverse(length);
break;
emm,
for (uint8_t n = 0; n < length; n++) {
uint8_t vel_tmp = velocities[n];
uint8_t z = length - 1 - n;
velocities[n] = velocities[z];
velocities[z] = vel_tmp;
}
you end up swapping twice
It looks better on the editor, but no audible note playback on reverse.
Also now my shift menu has disappeared
oh should be length/2
git pull it
git pull it
?
I pushed one commit for that.
which branch?
i'm working in dev
emm, dev?
commit id ?
0931bc78d249b1eee9f3bba07663f1ddd0f12dcf
I merged your commit with mine.
Reverse playback is still broken. some notes not playing.
And shift menu has disappeared since increase entry_mask to 32bit.
05e246da
Reverse playback is still broken. some notes not playing.
What if without microtiming reverse? Just no velocity?
yep. midi monitor showing 0 vel
vel_tmp is wrong.
i've well and truly exhausted my capabality this weekend. day job in 8 hours.
if you can get the A4 conversion problem sorted that would be a big help. that way I can tick off project conversion.
i'm off. 🛌
if you can get the A4 conversion problem sorted that would be a big help. that way I can tick off project conversion.
roger roger.
good night!
We can keep track of current ev_idx. And then increase/decrease as items are added removed. Use ISR block for consistency.
Implement order by lock