Skip to content

Fix #3004: Scheme sfx() ignores note/octave/speed from SFX editor - #3073

Merged
nesbox merged 1 commit into
nesbox:mainfrom
theluckystrike:fix/3004-scheme-sfx-sample
Oct 11, 2026
Merged

nesbox merged 1 commit into
nesbox:mainfrom
theluckystrike:fix/3004-scheme-sfx-sample

Conversation

@theluckystrike

Copy link
Copy Markdown
Contributor

Fixes #3004

The Scheme sfx binding never read the SFX sample, so (sfx 0) played the bottom of the frequency table whatever the editor showed. This brings e8359b8, the Python fix for #2920, over to scheme_sfx.

The binding now reads the sample's note, octave and speed first, and the caller's arguments override them. The speed default moves from 0 to -1 so the sample's own speed is used, and a note of -1 keeps the sample's note. I also replaced the old note range check, which was always true (raw_note >= 0 || raw_note <= 95), with the same != -1 test Python uses.

Like the Lua binding, it only reads the sample for an index inside SFX_COUNT. Without a sample to read (a negative index), speed falls back to SFX_DEF_SPEED as in Lua.

I couldn't build the full Scheme runtime here, but scheme.c compiles cleanly up to the generated demo asset include, the same as on main. I haven't heard it play yet.

Michael

Read the sample's note, octave and speed first and let the caller's
arguments override them, as e8359b8 does for Python and the Lua
binding already does. The speed default moves from 0 to -1, and the
sample is only read for an index inside SFX_COUNT.
@nesbox
nesbox merged commit 1d29e5b into nesbox:main Oct 11, 2026
11 checks passed
@theluckystrike

theluckystrike commented Oct 11, 2026 via email •

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheme sfx() ignores the sample's own note, octave and speed

2 participants