c2aedcc95c2d79c9448b4ed3b382df4a13c72349
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c2aedcc95c |
Add an LFO phase dropdown to the synth (v0.25.0)
The synth's LFO always started at phase 0 on every note, so a Square LFO could only ever gate on-beat-first and a Saw could only ever ramp up. The new lfophase parameter offsets it in eight 45-degree steps — enough to put the gate on the off-beat (180) or land a ramp anywhere useful, without a dropdown nobody wants to scroll. The offset is applied where the LFO is READ, not seeded into lfoPhase at note-on. Two reasons: setPatch swaps the patch under a sounding voice, so turning the knob moves a held note's LFO immediately rather than waiting for the next trigger; and it matches the toolbox LFO device, which offsets its phase the same way. Sample & Hold is deliberately unaffected — it clocks on the raw wrap, and a held random value has no phase to shift. Presets saved before this existed have no lfophase key, read the default label and land on 0, which is exactly what they played. The control reuses the editor's existing EnumParam dropdown and sits beside WAVE and RATE in the LFO card. Checked on an emulator that three dropdowns still fit that row at the widest label (PHASE:180°) without crowding, and that the selection sticks. Tests: 180 degrees must inverse a square LFO's loud/quiet halves, 90 must leave both halves audible (a shift, not just an inversion), and the labels must map onto the cycle with an unknown or missing one falling back to no offset. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
deb582727f |
Harden untrusted-file parsing, drop two audio-thread allocations, prune dead code (v0.24.0)
SECURITY
A crafted .sf2 hung the app. SoundFontLoader's RIFF walk trusted the chunk
sizes in the file: a negative size moved the cursor BACKWARDS, so the walk
re-read the same chunk header forever. runCatching cannot catch that — there is
no exception, just a thread that never returns. 76 bytes was enough. Every seek
in both the chunk and sub-chunk loops is now forced forward, negative sizes end
the walk, and the sample offset is resolved in Long so a hostile 32-bit start
index can no longer wrap Int and land the read somewhere arbitrary.
Neither ZIP import had a decompression budget. The zip-slip path check does not
see a bomb, because its entries are perfectly well-named — they are just
enormous. A restore streams to disk and filled the device; a project bundle
accumulates in memory and exhausted the heap. New ZipLimits budgets both, with
different limits because they fail differently: 512 MB for a restore, 64 MB for
a bundle, 20k entries either way. An over-budget archive is rejected like any
other bad file, leaving existing data untouched.
PlaybackService was exported with no permission, so any app on the device could
bind the MediaSessionService and take transport control. Now exported="false".
Verified on an emulator that this changes nothing that matters: the session is
still the system's media button session, the notification still posts, the
foreground service survives backgrounding, no SecurityException. The only loss
is discovery by external media browsers (Auto, Assistant, Wear), which this app
never supported.
String.format("%.2f") in three parameter readouts used the default locale, so a
comma-decimal locale rendered knob values inconsistently with the rest of the
monospace UI. Pinned to Locale.US.
PERFORMANCE
Two allocations removed from threads documented as allocation-free:
- applyLfos() called target.substring(sep + 1) every block for each active
LFO (~250/s each), in a function that already parses the slot index
character-by-character to avoid exactly this. Now matched with
regionMatches, which allocates nothing.
- busNoteOn() built `(0 until N).map { … }.firstOrNull { … }` twice — a range
iterator plus an ArrayList per incoming MIDI note. Replaced with an indexed
freeBusVoice() scan, matching the style used elsewhere in the file.
DEAD CODE
Arrangement.isLaneMuted had no callers (everything reads laneMuted[] directly).
Four tab-title strings and a notification-channel name were left over from an
earlier design — the tabs are composed with literals and media3 names its own
channel. Added the missing android:roundIcon, which is why lint thought
ic_launcher_round was unused; the asset was always meant to be referenced.
Lint is clean of UnusedResources, DefaultLocale and ExportedService. Its
remaining ObsoleteSdkInt advice — merge mipmap-anydpi-v26 into mipmap-anydpi —
is wrong for this AGP version and was reverted: aapt then fails to resolve the
launcher icons at all.
NOT CHANGED, flagged for a decision: android:allowBackup is still true, so
projects, presets, themes and the settings/bindings DataStore go to Google's
cloud backup. That is a standard hardening finding, but it is also a data
portability feature, and the app now has its own backup/restore — a product
call rather than a defect.
New tests: SoundFontLoaderTest (hostile SF2 headers, with timeouts — the hang
reproduces as a TestTimedOutException without the fix) and ZipBombTest (both
import paths, plus a guard that an ordinary backup still restores).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
3453f9f003 |
Band-limit amp modulation so a Square/Saw LFO no longer clicks (v0.23.1)
The amplifier is the only modulation destination with nothing downstream to
absorb a discontinuity. Pitch feeds a phase accumulator and cutoff feeds filter
coefficients, both of which integrate a step away; the amp multiplies the
output sample directly:
a = ampE * velocity * (1 + mAmp)
y = filtered * a * OUT_GAIN
A Saw, Square or S&H LFO steps instantaneously, so wiring one to Amp put a
full-scale jump straight on the output — a broadband click at every edge, and
at a musical LFO rate (8 Hz is a 1/8 note at 120 BPM) that is a stream of
clicks several times a second: the reported crackle. Sine and Triangle were
unaffected because they are continuous, which is why only the stepping
waveforms were reported.
mAmp now runs through a 2 ms one-pole, so each edge becomes a short ramp. At
8 Hz a half cycle is 62 ms, so 2 ms is 3% of it and a chop still reads as a
chop. The envelope itself is deliberately NOT smoothed — it is already
continuous, and rounding it there would soften every attack. A note starts at
its modulated level rather than ramping up to it, so triggering on a square
LFO's quiet half does not blip before ducking.
Measured by the new SynthAmpModTest, worst single-sample output jump during
sustain (C3 triangle, filter wide open, LFO -> Amp at full depth):
waveform before after
Square 0.804 0.018
S&H 0.705 0.017
Saw 0.590 0.011
(no mod) 0.003 0.003
Not addressed, and worth a separate look: the toolbox LFO *device* writes its
target parameter once per ~4 ms block, which steps every target for every
waveform. That is a different mechanism from the synth's own mod matrix and was
not what was reported here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
208de84012 |
Separate the flick from the tap on the tracker and arrangement canvases (v0.23.0)
Both canvases detected their tap with detectTapGestures, which is the wrong
tool next to a scroll container for two reasons:
- it CONSUMES the initial down, so the scrollable/horizontalScroll wrapped
around the canvas had to fight for the gesture. A quick flick frequently
did nothing, or landed as a tap and moved the cursor; only a slow,
deliberate drag scrolled reliably.
- it knows nothing about an in-flight fling, so tapping to halt a flick — the
reflex every scrolling surface trains — selected a cell under a view that
was still moving.
Replaced with detectScrollAwareTaps, shared by both canvases: it leaves the
down unconsumed so the scroll container sees the whole gesture, drops the tap
as soon as the finger travels past touch slop or the container claims a drag,
and treats a touch landing on a moving view as "stop here" rather than
"select".
Also fixes a regression from v0.22.1: keeping the cursor row on screen was
written as a standing clamp inside the scroll accessor, which made it a
constraint on the viewport rather than a reaction to the cursor moving. With
the cursor on line 0 it pinned the grid to the top and no amount of dragging
could scroll it. It is now a snapshotFlow on the cursor line that nudges the
offset only when the cursor actually moves off screen, so free scrolling is
unconstrained and a tapped cell still never moves.
Verified on an emulator (Pixel, API 34): a fast flick on the pattern grid now
flings across the whole 64-line pattern where it previously did not move at
all; a slow drag tracks 1:1 with no overshoot; a tap lands on the exact cell
and leaves the view still; the arrangement roll flings from bar 1 to bar 31 and
taps the right lane/bar. The tap-stops-a-fling path is not covered — adb cannot
inject a tap inside the fling window.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
1815566b6c |
Keep the tapped cell under the finger on a scrolled pattern grid (v0.22.1)
On a pattern long enough to overflow the viewport, tapping a cell moved the grid: the follow logic re-centred the viewport on the cursor the moment it changed, so the row that was just tapped slid up to the middle of the screen, well away from the fingertip. The hit test itself was correct — the view moved out from under it. While not playing the view now holds still and scrolls only far enough to keep the cursor row on screen, so a tap never moves it and an off-screen cursor (arrow keys, punch-in advancing a row) still comes back into view. Centring on the playhead during playback is unchanged, as is the flick-to-detach. Also clip the Canvas. Compose does not clip a Canvas to its bounds, and the grid deliberately draws one row past each edge to fill the partially scrolled rows, so a scrolled grid painted over the toolbar above it. Verified on an emulator (Pixel, API 34): before the fix a tap near the bottom of a 64-line pattern jumped the row to the middle; after it the row stays under the tap, scroll-then-tap lands on the right cell, an off-screen cursor is pulled back to the nearest edge, and the playhead still centres during playback. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
fdee7853e5 |
Adopt the cc.tiredsysadmin namespace and a Makefile entrypoint (v0.22.0)
Brings the project in line with CLAUDE.md: - Application id / namespace is now cc.tiredsysadmin.android.sizzle (cc.tiredsysadmin.<os>.<application>), including the two JNI symbols in native_audio.cpp — JNI resolves by mangled package path, so renaming the package alone would fail at runtime, not at build time. - Versions move to versions.properties at the repo root, read by both Gradle and the Makefile, with slots for the other platforms. The release APK name now derives from applicationId instead of being spelled out. - Makefile becomes the build/publish entrypoint: atomic targets with real dependencies (deps, check, staging, release, install, dist, bump-*), and a manual-only publish split into publish-apk / publish-metadata, which also regenerates the F-Droid metadata from versions.properties. - Annotate the two lint errors in MainActivity that this surfaced (ComponentActivity.dispatchKeyEvent's LIBRARY_GROUP_PREFIX restriction, media3's UnstableApi) so `make check` is green rather than advisory. - Document identity, versioning, build types and publishing in the handover doc; point the README at make. NOTE: the id change makes this a different app to Android and to F-Droid. Installs of space.rcmd.android.sizzle will not be upgraded by it and will sit side by side with the new one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |