Hi all! I’ve released SCAMP 0.9.0, which adds some exciting new functionality. You can install it via pip, or upgrade with
pip3 install --upgrade scamp. Here’s what’s new:
The big one: I added support for spanner notations! This includes slurs, hairpins, brackets, trills, and piano pedaling. See here for more information about how to use them.
Added Performance.remap_to_tempo, which allows you to change the underlying tempo curve for a given performance. This makes it easy, for instance, to double or halve note values in the notation without having to alter the rest of your code.
Made it so that, by default, a MIDI part uses the instrument name as the MIDI device name. For instance, if you are using IAC on a mac, this means that instead of
s.new_midi_part("my midi part", midi_output_device="IAC")you can just say
s.new_midi_part("IAC"). Of course, this will cause the name of the part in any generated notation to be “IAC”, but in many cases we don’t care about notation.
Lilypond output now uses a SCAMP-specific template file, instead of hardcoding formatting into the SCAMP source code. This makes it easier to change the appearance of score elements. You can use
print(scamp.settings.lilypond_template_path)to show the location of the file.
Refactored the process of note properties parsing to use a PEG parser (the arpeggio library). This makes parsing more consistent, and easier to modify/extend/maintain. It does, however, add a new dependency, albeit a pretty stable and easily substitutable one.
Numerous Bug fixes and refactoring. This includes the creation of a MIDIChannelManager class, which should make it easier to output to a MIDI file, which is a feature I’ve been planning to add for a while.
In addition to changes in the code, I updated the documentation as well. This includes a lot of new learning resources, including a long-overdue write-up of the note properties argument to
Lastly, it’s probably obvious from the description above, but maintaining SCAMP takes an enormous amount of time and effort. If you are so inclined, you can support that effort here though Patreon (which I literally just set up) or Liberapay.
P.S. Do let me know if you run into any issues with the new version. @dkettle helped me iron out a few kinks, but there may be some others that I have overlooked.