Repository navigation
Fix #3004: Scheme sfx() ignores note/octave/speed from SFX editor - #3073
Merged
Merged
Conversation
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
approved these changes
Oct 11, 2026
Contributor
Author
|
@nesbox, thanks for approving and merging #3073. Scheme's sfx() now reads the note, octave and speed from the SFX editor, so (sfx 0) plays the sample you built instead of the bottom of the frequency table.
My profile is https://github.com/theluckystrike and the sponsors page is https://github.com/sponsors/theluckystrike. Even a small one-time sponsorship would tell me the time on this fix was valued, and I'd gladly keep sending TIC-80 patches. Totally fine if not.
Thank you,
Michael Lip
Founder of https://zovo.one, 108 Chrome extensions with 150,000+ users
Also building https://makeroll.com and https://ml0x.com, open-source guardrails for Claude Code agents
Open source has to win, and small fixes like this one are my part of it
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3004
The Scheme
sfxbinding 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 toscheme_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!= -1test 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 toSFX_DEF_SPEEDas in Lua.I couldn't build the full Scheme runtime here, but
scheme.ccompiles cleanly up to the generated demo asset include, the same as on main. I haven't heard it play yet.Michael