Hi all! I just released scamp 0.8.7, which solves several bugs, and adds a couple new capabilities. Here’s what’s new:
- IMPORTANT: Updated to depend on the latest version of abjad (3.3). Unfortunately it’s now incompatible with 3.2, so you have to upgrade abjad. (Since abjad is not a hard dependency, it won’t upgrade by default.)
- Removed
ScoreComponent.to_abjad_lilypond_file
. Instead callScoreComponent.to_abjad(wrap_as_file=True)
.Score
objects are wrapped as file by default. So if you’ve been writing something likeperformance.to_score().to_abjad_lilypond_file()
, just useperformance.to_score().to_abjad()
instead. - All methods for converting to abjad or lilypond (
to_abjad
,to_lilypond
,print_lilypond
,export_lilypond
,show
) now take anon_score_blocks
argument, allowing for the insertion of header blocks, layout blocks, paper blocks etc. These can be strings containing lilypond orabjad.Block
objects. For example:score.show(non_score_blocks=[r"\paper{ top-margin = 50}"])
will cause the top margin of the score to be 50mm. (Note the use of a raw string to avoid issues with the backslash.) - All methods for converting to abjad or lilypond now pass along any keyword arguments to abjad’s LilyPondFile constructor. This means, for instance, that you can call
score.show(global_staff_size=40)
to get enormous notation, a key feature that I know we have all been missing. - Fixed (I think!) the issue with multiple instruments sending MIDI to the same port on Windows; connections are now saved and reused. @jerry400bc, let me know if this solves the issue you were having!
- Fixed bug in which it was accidentally looking up MIDI input devices instead of output devices when looking for the device number of a midi device. @punksterbass, I think this was the bug that made it not work to specify MIDI device by name when doing
new_midi_part
, and I think it should work now! - Made it so that all notes are ended when the Python interpreter finishes, which helps avoid hanging notes. (Unfortunately, Thonny keeps the interpreter alive when a script finishes, so this doesn’t work in Thonny.)
-
Score
now adds final bar line when generating xml or LilyPond. This can be altered or turned off by alteringscore.final_bar_line
.
I also updated scamp_extensions to version 0.3.2, adding:
-
scamp_extensions.utilities.sequences.cyclic_slice
. This lets you treat a list as a cyclical object, going as far into negative and positive indices as you want. For instance:from scamp_extensions.utilities import cyclic_slice print(cyclic_slice([0.3, 0.7, 0.1, 0.2], -2, 12))
…will get the result:
[0.1, 0.2, 0.3, 0.7, 0.1, 0.2, 0.3, 0.7, 0.1, 0.2, 0.3, 0.7, 0.1, 0.2]
-
the
scamp_extensions.process
subpackage, which for now contains my implementations of Markov chains and LSystems. If anyone can’t figure out how to use them and wants to, I can try to cook up an example.