SCAMP 0.8.7 released!

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 call ScoreComponent.to_abjad(wrap_as_file=True). Score objects are wrapped as file by default. So if you’ve been writing something like performance.to_score().to_abjad_lilypond_file(), just use performance.to_score().to_abjad() instead.
  • All methods for converting to abjad or lilypond (to_abjad, to_lilypond, print_lilypond, export_lilypond, show) now take a non_score_blocks argument, allowing for the insertion of header blocks, layout blocks, paper blocks etc. These can be strings containing lilypond or abjad.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 altering score.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. :slight_smile:

2 Likes

Thank you Mark, but I am still unable to send instrument data through different midi channels to the same port. The error still point to the _midi.py script, but this time to line 144 in the get_port_connection function. François

Great, Marc!

And I’d be down for an exemple on Markov Chains, I’m going to use them already in my Masters thesis, so knowing how to work them on SCAMP would be great!

Ah, should have tested this more! I think if you give the instruments the same name, it should work. As in:

part1 = s.new_midi_part("midi part", "loopmidi", start_channel=0, num_channels=1)
part2 = s.new_midi_part("midi part", "loopmidi", start_channel=1, num_channels=1)

The issue is that I set it up so that you only reuse a connection if it’s to the same port and with the same name, but I name the midi connection by the name of the instrument. Let me know if this fixes the problem. If so, I just need to come up with a smarter way of approaching naming port connections.

yes, it works that way, thank you
François

1 Like

Yay! Glad to hear it. I’ll fix it so you can use different names soon.

Is this the right github repo? https://github.com/MarcTheSpark/scamp
Because it doesn’t seem to be updated?

It’s not actually… I started on GitHub, but migrated to SourceHut:

https://sr.ht/~marcevanstein/scamp/

What I’d like if for GitHub to automatically mirror SourceHut, with a message (in the readme or something) that the main hosting is on SourceHut, but I’m not sure the best way to do this.

1 Like

Thanks Marc!

From what I read online, sourcehut seems to have a kind of build system where you could insert instructions to update a github repository.

I saw something similar here: https://lists.sr.ht/~sircmpwn/sr.ht-discuss/<86multadvd.wl-tim%40datenknoten.me>