Merge pull request #78 from cnlohr/experimental

Experimental
This commit is contained in:
CNLohr 2018-12-08 19:14:01 -08:00 committed by GitHub
commit 0b2e686d55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 370 additions and 93 deletions

View file

@ -132,24 +132,30 @@ static void LEDUpdate(void * id, struct NoteFinder*nf)
if( led->led_note_attached[j] != -1 ) continue;
if( !led->timebased ) { selindex = j; break; }
float bias = 0;
float timeimp = 1;
if( led->snakey )
{
// bias = (j - led->snakeyplace + led->total_leds+(rand()%100)*.01);
// if( bias > led->total_leds ) bias -= led->total_leds;
float bias = 0;
float timeimp = 1;
bias = (j - led->snakeyplace + led->total_leds) % led->total_leds;
if( bias > led->total_leds / 2 ) bias = led->total_leds - bias + 1;
timeimp = 0;
}
float score = led->time_of_change[j] * timeimp + bias;
if( score < seltime )
float score = led->time_of_change[j] * timeimp + bias;
if( score < seltime )
{
seltime = score;
selindex = j;
}
}
else
{
seltime = score;
selindex = j;
if( led->time_of_change[j] < seltime )
{
seltime = led->time_of_change[j];
selindex = j;
}
}
}
if( selindex >= 0 )

View file

@ -9,6 +9,9 @@ steady_bright = 0
rgby = 1
sourcename = alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
#sourcename = default
#alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor
# alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1.monitor
#alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
@ -16,12 +19,12 @@ skipfirst = 0
firstval = 0
port = 7777
address = 192.168.3.192
address = 192.168.11.157
slope=.10
amplify=.5
qtyamp=50
qtyamp=120
timebased=1