From 1012c467d85aa1931b6228a27a026a0eb90c8add Mon Sep 17 00:00:00 2001 From: cnlohr Date: Tue, 18 Jun 2019 05:43:17 -0400 Subject: [PATCH] making progress. reworking as I go. --- colorchord2/turbo8bit.conf | 18 +++---- embeddedcommon/DFT8Padauk.c | 99 ++++++++++++++++++++++++------------- embeddedcommon/embeddednf.h | 2 +- 3 files changed, 75 insertions(+), 44 deletions(-) diff --git a/colorchord2/turbo8bit.conf b/colorchord2/turbo8bit.conf index 2d4bdcc..039af99 100644 --- a/colorchord2/turbo8bit.conf +++ b/colorchord2/turbo8bit.conf @@ -84,14 +84,12 @@ note_out_chop = 0.05000 shim_sinewave = 0 This is a vornoi thing: -outdrivers = DisplayArray -#lightx = 64 -#lighty = 32 -#fromsides = 1 -#shape_cutoff = 0.03 -#satamp = 5.000 -#amppow = 2.510 -#distpow = 1.500 - - +outdrivers = OutputVoronoi, DisplayArray +lightx = 64 +lighty = 32 +fromsides = 1 +shape_cutoff = 0.03 +satamp = 5.000 +amppow = 2.510 +distpow = 1.500 diff --git a/embeddedcommon/DFT8Padauk.c b/embeddedcommon/DFT8Padauk.c index bc1a976..0194799 100644 --- a/embeddedcommon/DFT8Padauk.c +++ b/embeddedcommon/DFT8Padauk.c @@ -1,4 +1,6 @@ //NOTE DO NOT EDIT THIS FILE WITHOUT ALSO EDITING DFT12SMALL!!! +//WARNING: DFT8Turbo, DFT12Small is currently the only one that's actually working. +//THIS FILE DOES NOT CURRENTLY WORK. #include #include @@ -9,6 +11,10 @@ #define MAX_FREQS (12) #define OCTAVES (4) +/* Backporting notes: + * Change loop to only check if the output table says it's complete. + * Pre-multiply octaves in optable. +*/ /* General procedure - use this code, with uint16_t or uint32_t buffers, and make sure none of the alarms go off. @@ -40,8 +46,11 @@ uint8_t actiontableplace; #define NR_OF_OPS (4< ROM dad is stored in word pairs. romptr = (uint16_t*)accM; //1CYC - acc = *romptr; //2CYC (ldtabl) + acc = *romptr; //2CYC (ldtabl) - //If we are on the one thing we aren't supposed to operate within, cancel. - if( acc == 255 ) continue; //2CYC + //If we are on the one operation we aren't supposed to operate within, we should cancel and loop around. + //XXX XXX XXX XXX XXX This is wrong. We should probably handle this logic above. + //XXX XXX XXX XXX XXX Logic handled above. XXX PICK UP HERE!!! + printf( "+ %d %d %d\n", note, acc, *memptr ); + //if( acc == 255 ) //2CYC + //{ + // //This way, when we loop back around, it will be at index 0, and everything should flow gracefully. + // *memptr = 255; + // continue; + //} + if( acc == 255 ) + { + //We dun goofed. + fprintf( stderr, "Goofed.\n" ); + exit( 0 ); + } - op = acc; //1CYC + //This actually reads the current octave specifier into "op" + //BIT7: add or subtract + //BIT6: reset + //BIT5: Even or odd? + //BITS 0..4 = Which octave. + op = acc; //1CYC - //21 cycles so far. - - acc = MAX_FREQS; //1CYC - mul2 = acc; //1CYC - acc = op; //1CYC - acc = acc & 0xf; //1CYC - octave = acc; //1CYC - acc = acc * mul2; //2CYC + acc = (*romptr)>>8; //2CYC (ldtabh) -> Contains memory offset of which note to use. + note_offset = acc; acc = acc + note; //1CYC - intindex = acc; //1CYC accM = (uint8_t*)integral_at-1 + acc; //1CYC memptr = accM; //1CYC + acc = *memptr; //2CYC idxm - if( op & 0x10 ) //ADD //2CYC + //acc now contains the running integral of the last time we were on this cell. + if( op & (1<<7) ) //ADD //2CYC { - acc = *memptr; //2CYC acc = acc - running_integral; //1CYC - diff = acc; //1CYC } else //SUBTRACT { - acc = *memptr; //2CYC tmp = acc; //1CYC acc = running_integral; //1CYC acc = acc - tmp; //1CYC - diff = acc; //1CYC } + diff = acc; //1CYC + + //Assume 2 extra cycles of overhead for if/else. //2 CYC + acc = running_integral; //1CYC + //Store the current running integral back into this note's running integral for next time. *memptr = acc; //2CYC - //42 AVERAGE cycles so far. - //??? Something below here is wrong??? Or near here??? XXX TODO PICK UP HERE!!! - intindex <<= 1; //1CYC - if( op&(1<<6) ) //2CYC - { - intindex |= 1; //1CYC - } + // op = info about what op we're on. WARNING: Bitfield. + // diff = how much to add to current value. + // note_offset = index of current operative note position. + octave = op & 0x1f; //XXX TODO + printf( "%d %d %d %d\n", op, diff, note_offset, octave ); accM = (uint8_t*)(mulmux - 1); //1CYC accM = accM + note*2; //1CYC romptr = accM; //1CYC diff --git a/embeddedcommon/embeddednf.h b/embeddedcommon/embeddednf.h index d360020..51d3672 100644 --- a/embeddedcommon/embeddednf.h +++ b/embeddedcommon/embeddednf.h @@ -32,7 +32,7 @@ //We take the raw signal off of the #ifndef FILTER_BLUR_PASSES -#define FILTER_BLUR_PASSES 2 +#define FILTER_BLUR_PASSES 1 #endif //Determines bit shifts for where notes lie. We represent notes with an