You need a midi block in your score.
import abjad score = abjad.Score() staff = abjad.Staff(r"c'4 d'4 e'4") score.append(staff) midi_block = abjad.Block("midi") score_block = abjad.Block("score", items=[score, midi_block]) lilypond_file = abjad.LilyPondFile( items=[score_block], ) abjad.persist.as_midi(lilypond_file, "file.midi")
Best regards,
Davi
Andrew Rickards <ricka...@gmail.com> writes:
I'm sure I'm making some newbie mistake but I can't figure out how to get the persist.asmidi() function to work. The persist.aspng() work just as I need it to but asmidi seems to want to save as PDF instead of a midi file.