It’s unfortunately not implemented yet, but it’s on my list! Part of the reason it hasn’t been a priority is that it’s so easy to do manually after the fact, either through abjad (if you’re using the lilypond output) or through notation software if you’re using the musicxml output.
But yeah, it’s silly that it’s not there! Part of the reason is that I’m not totally sure how to do it the right way. The way you suggest is good if the whole piece is in the same key, but if you’re changing keys part way through, how would you specify that?
The truth is that SCAMP needs a way of attaching staff notations that aren’t attached to particular notes, and that’s a bigger thing to implement.
I’m slightly relieved to hear that - lol, was worried that I was missing something obvious
I’m building a series of apps that generate musical exercises, currently: random sight reading exercises and melodic patterns - so for my situation, printing in one key is common. Although, I’m aware that this only uses a very small slice of SCAMP’s true functionality - it still saves me some short term work rather than creating my own custom XML writing module.
It’s been a good excuse for me to dig deeper into the documentation and tutorials! I’ve definitely got lots of inspiration for more compositional/creative uses for SCAMP.
Appreciate the help!
BTW I’ve got some early WIP on my github if you’re interested
Makes sense! BTW, if you’re exporting to XML, you could do this:
from scamp import *
s = Session(tempo=120)
violin = s.new_part("violin")
s.start_transcribing()
for _ in range(3):
for p in [62, 65, 63, 67, 68, 72, 70]:
violin.play_note(p, 0.7, 0.5, "key: Eb")
pymusicxml_score = s.stop_transcribing().to_score().to_music_xml()
pymusicxml_part = pymusicxml_score.contents[0]
pymusicxml_part.measures[0].key = "Eb"
pymusicxml_score.export_to_file("KeySig.musicxml")
It’s a little klugey — you get the musicxml representation, and then find the first measure of the first part and manually add a key signature — but maybe useful for your purposes?