Skip to content

Commit

Permalink
Add gain slider (wip) and show AGC effects using 🎚
Browse files Browse the repository at this point in the history
Gain slider not working yet...
  • Loading branch information
ewoudwijma committed Apr 22, 2022
1 parent 47e58c8 commit 04dd691
Show file tree
Hide file tree
Showing 6 changed files with 2,416 additions and 2,393 deletions.
30 changes: 15 additions & 15 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -1399,23 +1399,23 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Reserved7",
"Reserved8",
"Reserved9",
" ♪ Pixels@Fade rate,# of pixels;,!;!",
" ♪ Pixelwave@!,Sensitivity;!,!;!",
" ♪ Juggles@!,# of balls;,!;!",
" ♪ Matripix@!,Brightness;,!;!",
" ♪ Gravimeter@Rate of fall,Sensitivity;,!;!",
" ♪ Plasmoid@,# of pixels;!,!;!",
" ♪🎚 Pixels@Fade rate,# of pixels;,!;!",
" ♪🎚 Pixelwave@!,Sensitivity;!,!;!",
" ♪🎚 Juggles@!,# of balls;,!;!",
" ♪🎚 Matripix@!,Brightness;,!;!",
" ♪🎚 Gravimeter@Rate of fall,Sensitivity;,!;!",
" ♪🎚 Plasmoid@,# of pixels;!,!;!",
" ♪ Puddles@Fade rate,Puddle size;!,!;!",
" ♪ Midnoise@Fade rate,Maximum length;,!;!",
" ♪🎚 Midnoise@Fade rate,Maximum length;,!;!",
" ♪ Noisemeter@Fade rate,Width;!,!;!",
" ♫ Freqwave@Time delay,Sound effect,Low bin,High bin,Pre-amp;;",
" ♫ Freqmatrix@Time delay,Sound effect,Low bin,High bin,Sensivity;;",
" ♫🎚 Freqmatrix@Time delay,Sound effect,Low bin,High bin,Sensivity;;",
" ♫ 2D GEQ@Bar speed,Ripple decay;,,Peak Color;!",
" ♫ Waterfall@!,Adjust color,,Select bin, Volume (minimum);!,!;!",
" ♫ Freqpixels@Fade rate,Starting colour and # of pixels;;",
" ♫ Binmap@;!,!;!",
" ♪ Noisefire@!,!;;",
" ♪ Puddlepeak@Fade rate,Puddle size,,Select bin,Volume (minimum);!,!;!",
" ♪🎚 Noisefire@!,!;;",
" ♪🎚 Puddlepeak@Fade rate,Puddle size,,Select bin,Volume (minimum);!,!;!",
" ♫ Noisemove@Speed of perlin movement,Fade rate;,!;!",
"2D Noise@Speed,Scale;;!",
"Perlin Move@!,# of pixels,fade rate;,!;!",
Expand All @@ -1427,16 +1427,16 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"2D Matrix@Falling speed,Spawning rate,Trail,Custom color ☑;Spawn,Trail;",
"2D Metaballs@;;",
" ♫ Freqmap@Fade rate,Starting color;,!;!",
" ♪ Gravcenter@Rate of fall,Sensitivity;,!;!",
" ♪ Gravcentric@Rate of fall,Sensitivity;!;!",
" ♫ Gravfreq@Rate of fall,Sensivity;,!;!",
" ♪🎚 Gravcenter@Rate of fall,Sensitivity;,!;!",
" ♪🎚 Gravcentric@Rate of fall,Sensitivity;!;!",
" ♫🎚 Gravfreq@Rate of fall,Sensivity;,!;!",
" ♫ DJ Light@Speed;;",
" ♫ 2D Funky Plank@Scroll speed,,# of bands;;",
" ♫ 2D CenterBars@Bar speed,Ripple decay,Center ↔ ☑,Center ↕ ☑, Color ↕ ☑;,,Peak Color;!",
"2D Pulser@Speed,Blur;;!",
" ♫ Blurz@Fade rate,Blur amount;,Color mix;!",
"2D Drift@Rotation speed,Blur amount;;!",
" ♪ 2D Waverly@Amplification,Sensitivity;;!",
" ♪🎚 2D Waverly@Amplification,Sensitivity;;!",
"2D Sun Radiation@Variance,Brightness;;",
"2D Colored Bursts@Speed,Number of lines;;!",
"2D Julia@,Max iterations per pixel,X center,Y center,Area size;;!",
Expand All @@ -1446,7 +1446,7 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"2D Game Of Life@!,Palette ☑;!,!;!",
"2D Tartan@X scale,Y scale;;!",
"2D Polar Lights@Speed,X scale,Palette;;",
" ♪ 2D Swirl@!,Sensitivity,Blur;,Bg Swirl;!",
" ♪🎚 2D Swirl@!,Sensitivity,Blur;,Bg Swirl;!",
"2D Lissajous@X frequency,Fadetime;;!",
"2D Frizzles@X frequency,Y frequency;;!",
"2D Plasma Ball@Speed;;!",
Expand Down
28 changes: 18 additions & 10 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,24 @@
<button onclick="window.location.href = '/settings';"><i class="icons">&#xe0a2;</i><p class="tab-label">Config</p></button>
<button id="buttonPcm" onclick="togglePcMode(true)"><i class="icons">&#xe23d;</i><p class="tab-label">PC Mode</p></button>
</div>
<div id="briwrap">
<p class="hd">Brightness</p>
<div class="il">
<i class="icons slider-icon" onclick="tglTheme()">&#xe2a6;</i>
<div class="sliderwrap il">
<input id="sliderBri" onchange="setBri()" oninput="updateTrail(this)" max="255" min="1" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
</div>
<div id="briwrap">
<div class="il">
<p class="hd">Brightness</p>
<i class="icons slider-icon" onclick="tglTheme()">&#xe2a6;</i>
<div class="sliderwrap il">
<input id="sliderBri" onchange="setBri()" oninput="updateTrail(this)" max="255" min="1" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
<div class="il">
<p class="hd">Gain</p>
<i class="icons slider-icon" onclick="tglTheme()">🎚</i>
<div class="sliderwrap il">
<input id="sliderGain" onchange="setGain()" oninput="updateTrail(this)" max="255" min="1" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
</div>
<iframe id="liveview" src="about:blank"></iframe>
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions wled00/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,7 @@ function updateUI()
d.getElementById('buttonSync').className = (syncSend) ? "active":"";

updateTrail(d.getElementById('sliderBri'));
updateTrail(d.getElementById('sliderGain'));
updateTrail(d.getElementById('sliderSpeed'));
updateTrail(d.getElementById('sliderIntensity'));
updateTrail(d.getElementById('sliderCustom1'));
Expand Down Expand Up @@ -1059,6 +1060,7 @@ function makeWS() {
function readState(s,command=false) {
isOn = s.on;
d.getElementById('sliderBri').value= s.bri;
d.getElementById('sliderGain').value= s.gain;
nlA = s.nl.on;
nlDur = s.nl.dur;
nlTar = s.nl.tbri;
Expand Down Expand Up @@ -1892,6 +1894,10 @@ function setBri() {
var obj = {"bri": parseInt(d.getElementById('sliderBri').value)};
requestJson(obj);
}
function setGain() {
var obj = {"gain": parseInt(d.getElementById('sliderGain').value)};
requestJson(obj);
}

function setSpeed() {
var obj = {"seg": {"sx": parseInt(d.getElementById('sliderSpeed').value)}};
Expand Down Expand Up @@ -2490,6 +2496,7 @@ function expand(i,a)

function unfocusSliders() {
d.getElementById("sliderBri").blur();
d.getElementById("sliderGain").blur();
d.getElementById("sliderSpeed").blur();
d.getElementById("sliderIntensity").blur();
d.getElementById("sliderCustom1").blur();
Expand Down
3 changes: 2 additions & 1 deletion wled00/data/settings_sound.htm
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ <h2>Sound Input Settings</h2>
Squelch: <input name="SQ" type="number" min="0" max="255" required><br>
Gain: <input name="GN" type="number" min="0" max="255" required><br>
<i>Enter values between 0 and 255. To tune, start with Squelch=5..10 and Gain=15..40 and modify according to your setup</i><br>
<i>40 means an amplification of 1; 1 is about 1/32, 255 is about 6.5</i><br>
Automatic Gain Control (AGC): <input type="checkbox" name="AGC"><br>
<i>AGC is an expiremental feature</i><br>
<i>AGC is an expiremental feature. Effects supporting AGC show the 🎚 icon</i><br>
<h2>Sound Input Pin Manager</h2>
Microphone type: <select id="dme" name="DMM" onchange="enDM()" >
<option value="0" selected>Generic Analog</option>
Expand Down
21 changes: 11 additions & 10 deletions wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,17 @@ onclick="H()">?</button></div><button type="button" onclick="B()">Back</button>
<input name="SQ" type="number" min="0" max="255" required><br>Gain: <input
name="GN" type="number" min="0" max="255" required><br><i>
Enter values between 0 and 255. To tune, start with Squelch=5..10 and Gain=15..40 and modify according to your setup
</i><br>Automatic Gain Control (AGC): <input type="checkbox" name="AGC"><br><i>
AGC is an expiremental feature</i><br><h2>Sound Input Pin Manager</h2>
Microphone type: <select id="dme" name="DMM" onchange="enDM()"><option
value="0" selected="selected">Generic Analog</option><option value="1">
Generic I2S</option><option value="2">ES7243</option><option value="3">SPH0654
</option><option value="4">Generic I2S with Mclk</option><option value="5">
Generic I2S PDM</option></select><br><div id="dm">I2S SD pin: <input
type="number" min="-1" max="40" name="DI"><br>I2S WS pin: <input type="number"
min="-1" max="40" name="LR"><br>I2S SCK pin: <input type="number" min="-1"
max="40" name="CK"><br></div><i>
</i><br><i>40 means an amplification of 1; 1 is about 1/32, 255 is about 6.5</i>
<br>Automatic Gain Control (AGC): <input type="checkbox" name="AGC"><br><i>
AGC is an expiremental feature. Effects supporting AGC show the 🎚 icon</i><br>
<h2>Sound Input Pin Manager</h2>Microphone type: <select id="dme" name="DMM"
onchange="enDM()"><option value="0" selected="selected">Generic Analog</option>
<option value="1">Generic I2S</option><option value="2">ES7243</option><option
value="3">SPH0654</option><option value="4">Generic I2S with Mclk</option>
<option value="5">Generic I2S PDM</option></select><br><div id="dm">I2S SD pin:
<input type="number" min="-1" max="40" name="DI"><br>I2S WS pin: <input
type="number" min="-1" max="40" name="LR"><br>I2S SCK pin: <input type="number"
min="-1" max="40" name="CK"><br></div><i>
Changing the microphone type or pins requires a hard reset/power cycle</i><br>
<div id="am">Analog Input pin: <input type="number" min="-1" max="40" name="SI">
<br></div><button type="button" onclick="B()">Back</button><button
Expand Down
Loading

0 comments on commit 04dd691

Please sign in to comment.