Scamp Doesn't Recognize Lilypond

Description:

I wanted to get back into coding with scamp, and I ran an old program I made a while back. I have Lilypond on my computer, fully installed. I’m certain that the issue has to so with creating the PDF version of the score, because I ran a program that just plays the sound without creating a PDF, and that one worked. Can someone please tell me how to fix this issue? (I’m running the program on Windows 10)

Error printout:

WARNING:root:python-rtmidi was not found; streaming midi input / output will not be available.
WARNING:root:pynput was not found; mouse and keyboard input will not be available.
Using preset Piano Merlin for piano
fluidsynth: error: no MIDI in devices found
'lilypond' is not recognized as an internal or external command,
operable program or batch file.

The full code that resulted in the error:

from scamp import *
import random

s = Session(tempo=100)

s.fast_forward_to_beat(200)

#s.print_default_soundfont_presets()

notes = [65, 65, 67, 68, 70, 72, 72, 73, 75, 77]

durList = [1, 1, 1, 2]

p = s.new_part("piano")

s.start_transcribing()

# Collatz Sequence melody generator
# Uses the digits to play melody

for i in range(10):

    x = i + 1

    while x != 1:
        
        if x % 2 == 0:
            x /= 2
        else:
            x = x * 3 + 1
    
        y = str(int(x))
        
        dur = random.randint(0, 3)
        
        for j in y:
            p.play_note(notes[int(j)], 0.5, durList[dur], "staccato, key : Cminor")

pref = s.stop_transcribing()

pref.to_score().show()

hi, I got your code to transcribe ok by changing
pref = s.stop_transcribing()
pref.to_score().show()
to
performance = s.stop_transcribing()
performance.to_score().show_xml()

If you want to get lilypond to work, you need to install lilypond and the abjad python package, and then on Windows you have to edit the abjad config file at: "C:\Users\{yourusername}\.abjad\abjad.cfg" to say:

lilypond_path = {the full path to your lilypond exe file in quotes} 

The path to the lilypond exe is usually something like:
“C:\Program Files (x86)\lilypond-2.24.1-mingw-x86_64\lilypond-2.24.1\bin\lilypond.exe”

Thank you, It works now!

1 Like

Glad to hear it!