shorepine / tulipcc

The Tulip Creative Computer - a portable Python synthesizer for music and graphics
https://tulip.computer/
Other
431 stars 28 forks source link

midi.py, music.md, ..: Add midi.config.get_synth(), rename polyphony #382

Closed dpwe closed 3 weeks ago

dpwe commented 3 weeks ago

This adds a couple of cleanups to the music.md tutorial, with associated code changes.

midi.config.get_synth() replaces direct access of midi.config.synth_per_channel which was seemingly endorsing direct access of internal data.

midi.config.add_synth() gains defaults for all args, and polyphony becomes num_voices for consistency with lower levels.

Use of synth.program_change() is replaced by patch_number=X in the Synth constructor.

Python style guide spaces around args.

bwhitman commented 3 weeks ago

https://media2.giphy.com/media/R9wlZIvzUrtrdFYhZV/200w.gif?cid=6c09b9525fip3nkrf3pt8kgeum8aewd8sd8xel4q480zbeqd&ep=v1_gifs_search&rid=200w.gif&ct=g