Closed jmamma closed 3 years ago
185 bool RAMPage::slice(uint8_t track, uint8_t linked_track) {
186 uint8_t model = (MD.kit.models[track]);
187
188 if (grid_page.active_slots[track] != SLOT_RAM_PLAY) {
189 return false;
190 }
191 uint8_t slices = 1 << encoders[2]->cur;
192
193 uint8_t sample_inc = 128 / slices;
194 uint8_t track_length = encoders[3]->cur * 4;
195 uint8_t step_inc = track_length / slices;
196 bool clear_locks = true;
197 bool send_params = false;
198
199 auto &trk = mcl_seq.md_tracks[track];
200 auto &ln_trk = mcl_seq.md_tracks[linked_track];
201 trk.clear_track(clear_locks, send_params);
202
203 trk.locks_params[0] = ROM_STRT + 1;
204 trk.locks_params[1] = ROM_END + 1;
205 uint8_t mode = encoders[1]->cur;
206 DEBUG_PRINTLN("slices");
207 DEBUG_PRINTLN(slices);
208 DEBUG_PRINTLN(step_inc);
209 for (uint8_t s = 0; s < slices; s++) {
210 uint8_t n = s * step_inc;
211
212 if ((linked_track < track) || (linked_track == 255)) {
213 trk.steps[n].trig = true;
214 }
215
216 trk.timing[n] = trk.get_timing_mid();
217 if (linked_track < track) {
218 trk.set_track_locks_i(n, 0, ln_trk.get_track_lock(n, 0));
219 trk.set_track_locks_i(n, 1, ln_trk.get_track_lock(n, 1));
220 } else if (RAMPage::slice_modes[page_id] == 0) {
221 DEBUG_PRINTLN("slice here");
222 trk.set_track_locks_i(n, 0, sample_inc * s + 0);
223 auto val = (sample_inc) * (s + 1) + 0;
224 trk.set_track_locks_i(n, 1, val);
225 DEBUG_DUMP(val);
224 trk.set_track_locks_i(n, 1, val); memory is not persisting. Why?
So, first lock set ok, but second one (id=1) doesn't?
sorry. was meaning to close this one. It's fixed in latest commits.
@yatli
~line 449. is this a bug?~ not a bug.