From 551e857fb1bd806b88a1dea7bb308f8a6a32c8bf Mon Sep 17 00:00:00 2001 From: Eugene8388608 Date: Fri, 5 Nov 2021 23:26:14 +0300 Subject: [PATCH] Add files via upload --- colorchord2/DisplayArray.c | 4 ++-- colorchord2/DisplayOUTDriver.c | 6 +++--- colorchord2/DisplayPie.c | 4 ++-- colorchord2/DisplayRadialPoles.c | 6 +++--- colorchord2/OutputCells.c | 6 +++--- colorchord2/OutputLinear.c | 6 +++--- colorchord2/OutputProminent.c | 14 ++++++-------- colorchord2/OutputVoronoi.c | 6 +++--- 8 files changed, 25 insertions(+), 27 deletions(-) diff --git a/colorchord2/DisplayArray.c b/colorchord2/DisplayArray.c index 2eed784..de1d25a 100644 --- a/colorchord2/DisplayArray.c +++ b/colorchord2/DisplayArray.c @@ -54,7 +54,7 @@ static void DPOUpdate(void * id, struct NoteFinder*nf) { index = x+y*d->xn; } - CNFGColor( OutLEDs[index*3+0] | (OutLEDs[index*3+1] <<8)|(OutLEDs[index*3+2] <<16) ); + CNFGColor( (OutLEDs[index*3+0] <<24) | (OutLEDs[index*3+1] <<16) | (OutLEDs[index*3+2] <<8) | 0xff ); float dx = (x) * cw; float dy = (y) * ch; @@ -63,7 +63,7 @@ static void DPOUpdate(void * id, struct NoteFinder*nf) else CNFGTackRectangle( dx, dy, dx+cw+.5, dy+ch+.5 ); } - CNFGColor( 0xffffff ); + CNFGColor( 0xffffffff ); } static void DPOParams(void * id ) diff --git a/colorchord2/DisplayOUTDriver.c b/colorchord2/DisplayOUTDriver.c index aa17c04..9e01890 100644 --- a/colorchord2/DisplayOUTDriver.c +++ b/colorchord2/DisplayOUTDriver.c @@ -130,9 +130,9 @@ static void DPOUpdate(void * id, struct NoteFinder*nf) if( sat > 1 ) sat = 1; uint32_t color = CCtoHEX( nf->note_positions[i] / nf->freqbins, 1.0, sat ); - OutLEDs[led*3+0] = color & 0xff; - OutLEDs[led*3+1] = ( color >> 8 ) & 0xff; - OutLEDs[led*3+2] = ( color >> 16 ) & 0xff; + OutLEDs[led*3+0] = ( color >> 24 ) & 0xff; + OutLEDs[led*3+1] = ( color >> 16 ) & 0xff; + OutLEDs[led*3+2] = ( color >> 8 ) & 0xff; led++; } diff --git a/colorchord2/DisplayPie.c b/colorchord2/DisplayPie.c index 723a986..e1d97fc 100644 --- a/colorchord2/DisplayPie.c +++ b/colorchord2/DisplayPie.c @@ -53,13 +53,13 @@ static void DPOUpdate(void * id, struct NoteFinder*nf) pts[5].x = cw + cos(angB) * sizeA; pts[5].y = ch + sin(angB) * sizeA; - CNFGColor( OutLEDs[i*3+0] | (OutLEDs[i*3+1] <<8)|(OutLEDs[i*3+2] <<16) ); + CNFGColor( ( OutLEDs[i*3+0] <<24) | (OutLEDs[i*3+1] <<16) | (OutLEDs[i*3+2] <<8) | 0xff ); CNFGTackPoly( pts, 3 ); CNFGTackPoly( pts+3, 3 ); } - CNFGColor( 0xffffff ); + CNFGColor( 0xffffffff ); } static void DPOParams(void * id ) diff --git a/colorchord2/DisplayRadialPoles.c b/colorchord2/DisplayRadialPoles.c index d61bf5a..4765c99 100644 --- a/colorchord2/DisplayRadialPoles.c +++ b/colorchord2/DisplayRadialPoles.c @@ -65,7 +65,7 @@ static void DPRUpdate(void * id, struct NoteFinder*nf) CNFGTackPoly( pts+3, 3 ); - CNFGColor( 0x00000000 ); + CNFGColor( 0x000000ff ); CNFGTackSegment( p1x, p1y, p2x, p2y); CNFGTackSegment( p2x, p2y, p4x, p4y); CNFGTackSegment( p3x, p3y, p1x, p1y); @@ -114,7 +114,7 @@ static void DPRUpdate(void * id, struct NoteFinder*nf) CNFGTackPoly( pts, 3 ); CNFGTackPoly( pts+3, 3 ); - CNFGColor( 0x00000000 ); + CNFGColor( 0x000000ff ); CNFGTackSegment( p1x, p1y, p2x, p2y); CNFGTackSegment( p2x, p2y, p4x, p4y); CNFGTackSegment( p3x, p3y, p1x, p1y); @@ -124,7 +124,7 @@ static void DPRUpdate(void * id, struct NoteFinder*nf) - CNFGColor( 0xffffff ); + CNFGColor( 0xffffffff ); } static void DPRParams(void * id ) diff --git a/colorchord2/OutputCells.c b/colorchord2/OutputCells.c index b1abd4a..67fc0ba 100644 --- a/colorchord2/OutputCells.c +++ b/colorchord2/OutputCells.c @@ -187,9 +187,9 @@ static void LEDUpdate(void * id, struct NoteFinder*nf) if( sendsat > 1 ) sendsat = 1; int r = CCtoHEX( binpos[ia], 1.0, pow( sendsat, led->outgamma ) ); - OutLEDs[i*3+0] = r & 0xff; - OutLEDs[i*3+1] = (r>>8) & 0xff; - OutLEDs[i*3+2] = (r>>16) & 0xff; + OutLEDs[i*3+0] = (r>>24) & 0xff; + OutLEDs[i*3+1] = (r>>16) & 0xff; + OutLEDs[i*3+2] = (r>>8) & 0xff; } } diff --git a/colorchord2/OutputLinear.c b/colorchord2/OutputLinear.c index 2a75db8..e0d78f3 100644 --- a/colorchord2/OutputLinear.c +++ b/colorchord2/OutputLinear.c @@ -180,9 +180,9 @@ static void LEDUpdate(void * id, struct NoteFinder*nf) int r = CCtoHEX( led->last_led_pos[i], 1.0, pow( sendsat, led->outgamma ) ); - OutLEDs[i*3+0] = r & 0xff; - OutLEDs[i*3+1] = (r>>8) & 0xff; - OutLEDs[i*3+2] = (r>>16) & 0xff; + OutLEDs[i*3+0] = (r>>24) & 0xff; + OutLEDs[i*3+1] = (r>>16) & 0xff; + OutLEDs[i*3+2] = (r>>8) & 0xff; } if( led->is_loop ) diff --git a/colorchord2/OutputProminent.c b/colorchord2/OutputProminent.c index c9f1792..b67c7dc 100644 --- a/colorchord2/OutputProminent.c +++ b/colorchord2/OutputProminent.c @@ -43,18 +43,16 @@ static void LEDUpdate(void * id, struct NoteFinder*nf) } } - + float sendsat = selected_amp; + if( sendsat > 1 ) sendsat = 1; + int r = CCtoHEX( selected_note, 1.0, sendsat ); //Advance the LEDs to this position when outputting the values. for( i = 0; i < led->total_leds; i++ ) { - float sendsat = selected_amp; - if( sendsat > 1 ) sendsat = 1; - int r = CCtoHEX( selected_note, 1.0, sendsat ); - - OutLEDs[i*3+0] = r & 0xff; - OutLEDs[i*3+1] = (r>>8) & 0xff; - OutLEDs[i*3+2] = (r>>16) & 0xff; + OutLEDs[i*3+0] = (r>>24) & 0xff; + OutLEDs[i*3+1] = (r>>16) & 0xff; + OutLEDs[i*3+2] = (r>>8) & 0xff; } } diff --git a/colorchord2/OutputVoronoi.c b/colorchord2/OutputVoronoi.c index 0940703..9745781 100644 --- a/colorchord2/OutputVoronoi.c +++ b/colorchord2/OutputVoronoi.c @@ -131,9 +131,9 @@ static void DPOUpdate(void * id, struct NoteFinder*nf) color = CCtoHEX( note_color, 1.0, pow( sat, d->outgamma ) ); } - OutLEDs[led*3+0] = color & 0xff; - OutLEDs[led*3+1] = ( color >> 8 ) & 0xff; - OutLEDs[led*3+2] = ( color >> 16 ) & 0xff; + OutLEDs[led*3+0] = ( color >> 24 ) & 0xff; + OutLEDs[led*3+1] = ( color >> 16 ) & 0xff; + OutLEDs[led*3+2] = ( color >> 8 ) & 0xff; led++; } }