App 2.44.0: the pumpkin light follows the kick drum, behind a switch
MusicPulse reads 40-120 Hz and lights only on jumps of the bass, so held notes and bass lines stay dark. Settings gets "Pumpkin light follows the music" (Halloween only, off by default); off, the audio analyser never starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -36,6 +36,45 @@ public class MusicPulseTest {
|
||||
assertEquals(0f, last, 0f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aHeldBassNoteLightsOnlyItsStart() {
|
||||
MusicPulse p = new MusicPulse();
|
||||
for (int i = 0; i < 50; i++) p.update(0.05f, STEP);
|
||||
assertTrue(p.update(0.4f, STEP) > 0.8f);
|
||||
float last = 1f;
|
||||
for (int i = 0; i < 25; i++) last = p.update(0.4f, STEP);
|
||||
assertEquals(0f, last, 0f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aWobblingBassLineStaysDark() {
|
||||
MusicPulse p = new MusicPulse();
|
||||
for (int i = 0; i < 50; i++) p.update(0.3f, STEP);
|
||||
float top = 0f;
|
||||
for (int i = 0; i < 200; i++) top = Math.max(top, p.update(i % 3 == 0 ? 0.33f : 0.3f, STEP));
|
||||
assertEquals(0f, top, 0f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aSwellingNoteStaysDark() {
|
||||
MusicPulse p = new MusicPulse();
|
||||
for (int i = 0; i < 50; i++) p.update(0.1f, STEP);
|
||||
float top = 0f;
|
||||
for (int i = 0; i < 100; i++) top = Math.max(top, p.update(0.1f + i * 0.004f, STEP));
|
||||
assertEquals(0f, top, 0f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aKickOverABassLineLights() {
|
||||
MusicPulse p = new MusicPulse();
|
||||
float top = 0f;
|
||||
for (int i = 0; i < 300; i++) {
|
||||
float v = p.update(i % 12 == 0 ? 0.6f : (i % 3 == 0 ? 0.33f : 0.3f), STEP);
|
||||
if (i > 100) top = Math.max(top, v);
|
||||
}
|
||||
assertTrue("a kick lights it, got " + top, top > 0.8f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void quietAndLoudSongsPulseAlike() {
|
||||
assertEquals(beatOf(0.5f), beatOf(0.05f), 0.02f);
|
||||
|
||||
Reference in New Issue
Block a user