Skip to content
Permalink
Browse files

Revert "pack ratchet toggles into same byte as repeat counts"

This reverts commit 01344a2.
  • Loading branch information
csboling committed May 21, 2019
1 parent 1d96c53 commit db687c67fd6d761d1030ca3bc51b6cb7e6b4a18c
Showing with 9 additions and 6 deletions.
  1. +8 −6 src/ansible_grid.c
  2. +1 −0 src/ansible_grid.h
@@ -337,6 +337,7 @@ void default_kria() {
memset(k.p[0].t[0].note, 0, 16);
memset(k.p[0].t[0].dur, 0, 16);
memset(k.p[0].t[0].rpt, 1, 16);
memset(k.p[0].t[0].rptBits, 1, 16);
memset(k.p[0].t[0].p, 3, 16 * KRIA_NUM_PARAMS);
k.p[0].t[0].dur_mul = 4;
k.p[0].t[0].direction = krDirForward;
@@ -598,7 +599,7 @@ void clock_kria_track( uint8_t trackNum ) {
}

if(kria_next_step(trackNum, mRpt)) {
rpt[trackNum] = track->rpt[pos[trackNum][mRpt]] & 0xF;
rpt[trackNum] = track->rpt[pos[trackNum][mRpt]];
}
if(kria_next_step(trackNum, mAltNote)) {
alt_note[trackNum] = track->alt_note[pos[trackNum][mAltNote]];
@@ -624,7 +625,7 @@ void clock_kria_track( uint8_t trackNum ) {
timer_add( &repeatTimer[trackNum], rptTicks[trackNum], &kria_rpt_off, trackIndex );
}

if ( (track->rpt[pos[trackNum][mRpt]] >> 4) & 1 ) {
if ( track->rptBits[pos[trackNum][mRpt]] & 1 ) {
set_tr( TR1 + trackNum );

timer_remove( &auxTimer[trackNum]);
@@ -662,7 +663,7 @@ static void kria_rpt_off(void* o) {
timer_remove( &repeatTimer[index] );
}

if ( (k.p[k.pattern].t[index].rpt[pos[index][mRpt]] >> 4) & ( 1 << bit ) ) {
if ( k.p[k.pattern].t[index].rptBits[pos[index][mRpt]] & ( 1 << bit ) ) {
set_tr( TR1 + index );
tr[index] = 1;
kria_blinks[index] = 1;
@@ -1557,10 +1558,11 @@ void handler_KriaGridKey(s32 data) {
case modNone:
if (z) {
if ( y > 1 && y < 6 ) {
uint8_t rptBits = (k.p[k.pattern].t[track].rpt[x] >> 4) ^ (1 << (5 - y));
uint8_t rptBits = k.p[k.pattern].t[track].rptBits[x] ^ (1 << (5 - y));
uint8_t rpt = 1;
k.p[k.pattern].t[track].rptBits[x] = rptBits;
while (rptBits >>= 1) rpt++;
k.p[k.pattern].t[track].rpt[x] = rpt | (rptBits << 4);
k.p[k.pattern].t[track].rpt[x] = rpt;

monomeFrameDirty++;
}
@@ -2295,7 +2297,7 @@ void refresh_kria_rpt(void) {
break;
default:
for ( uint8_t i=0; i<16; i++ ) {
uint8_t rptBits = k.p[k.pattern].t[track].rpt[i] >> 4;
uint8_t rptBits = k.p[k.pattern].t[track].rptBits[i];
for ( uint8_t j=0; j<4; j++) {
uint8_t led = 16*(5-j) + i;
monomeLedBuffer[led] = 0;
@@ -29,6 +29,7 @@ typedef struct {
u8 note[16];
u8 dur[16];
u8 rpt[16];
u8 rptBits[16];
u8 alt_note[16];
u8 glide[16];

0 comments on commit db687c6

Please sign in to comment.