Repository navigation
MIDI import: Lemon SoundFont Player as a channel type - #471
Open
ItsAlphaNeon wants to merge 1 commit into
Open
ItsAlphaNeon wants to merge 1 commit into
ItsAlphaNeon wants to merge 1 commit into
Conversation
The Import MIDI data form's Channel type lists Lemon SoundFont Player (issue #440). Accept asks for a SoundFont, and every new channel plays it at its track's General MIDI program and bank, MIDI channel 10 at the drum kit, or the nearest preset the font has. The next import offers the same font. - lemon-soundfont: preset_ids reads a font's presets from its headers, skipping the sample data; general_midi_preset picks the nearest one. - add_channel takes a built-in plugin's saved state; the channel is then hosted from it instead of as a new instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #440.
A MIDI file couldn't be heard on a SoundFont without replacing every imported channel's instrument by hand. The Import MIDI data form's Channel type now lists Lemon SoundFont Player: Accept asks for a
.sf2file, and every new channel plays it, each at the preset its track asks for.How each channel's preset is chosen
The font dialog opens in the last font's folder with its name filled in. Cancel imports nothing. A file that isn't a usable font stops the import with a warning, before anything changes. With the form not shown, the session's last font is used.
Under the hood
lemon-soundfont:sf2::preset_idsreads a font's preset list from its headers, seeking past the sample data, so a large font isn't read twice.sf2::general_midi_presetdoes the fallback, andState::set_programnames a preset without the font open.add_channeltakes an optionalstate: a built-in plugin's saved state, as the project file keeps it. The channel is then hosted from that state by the plugin's own sync instead of as a fresh instance, and undo/redo keep it. A sampler, layer or other non-built-in channel refuses it.docs/control-plane.mddocuments it.docs/status.mddescribes the new entry.Tests
statefield and its refusals..sf2files,preset_idsagrees with the full parse (an ignored test,OS_SF2=...).cargo test -p os-app -p os-session -p lemon-soundfontpasses, and so does the no-default-features check. Not tried by hand in the running app.🤖 Generated with Claude Code