Repository navigation
A control-panel adapter for instruments - #37
Merged
Merged
Conversation
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.
audioinstruments.panel.PanelAdapter(inst)wraps an instrument fromaudioinstruments.create()in the adapter a control panel edits through:script_name,macro_labels/macro_count, sixteenmacro_valueson the MIDI scale,patches/patch_index, bypass,engine_ready/engine_error/engine_message,request_reload()andon_external_change(). It imports no panel.For a MIDI path,
note_cc(i, v)andnote_program(i)move the instrument and tell the listeners, andnote_on/note_offpass through withnote_ondropped while bypassed.panel.create(name, rate, **options)remembers the options so a reload builds the same instrument; the reload keeps the patch and macros, swaps.instrument, callson_reload(cb)with the new and old instruments, and on a failure keeps the old one and reports why.Tests:
tests/test_panel.py(poly106 and rhythm808) andtests/mpy/test_panel.py, which passes on a unix MicroPython build with audiodsp, including a check that a bypassed note allocates nothing. Docs:docs/panel.md.