REQUEST: Testing SCAMP version 0.9.0

Hi everyone!

I was wondering if I could get a few volunteers to test the release of scamp version 0.9.0. I’ve uploaded it to the pypi testing respository, so you can install it using this terminal command:

pip3 install --index-url https://test.pypi.org/simple/ scamp

(Note: on windows I think it would just be pip not pip3)

After I officially release it, I’ll make a post about all the new features (slurs! hairpins! spanners galore!), but for now I just want to make sure it doesn’t break people’s existing code/installations.

Anyway, let me know! Would be great to have at least one person try it on each platform.

You mean the pip command in Thonny? (AFAIK, Windows doesn’t have a pip command, unless they added one in Windows 11.) It seems to support both pip and pip3 (I’m not sure what the difference is, if any).

I can test it under Windows 7 (64-bit), Windows 7 (32-bit), Windows 10 (64-bit) and Raspberry Pi. But is there something in particular you want tested? Or just the short test script that’s provided? If you have a more complete test suite, I could run that. But I haven’t used all the features of SCAMP, so I’d probably confuse my mistakes with bugs and just be wasting your time otherwise.

On my Windows 7 (64-bit) computer (where I had previously installed SCAMP), I had to uninstall it first. When I ran your install command the first time, nothing happened (the version number displayed in the package manager didn’t change to 0.9.0) So I uninstalled the older version and installed 0.9.0, but now I get this error when I run the test script, even after closing and re-opening Thonny, and even if I change the parameter to “show_lilypond=False”:

>>> %Run test_scamp.py
WARNING:root:Installing lilypond template file at C:\Users\user\AppData\Local\SCAMP\scamp_lilypond_template.ly. (This is normal on first import.)
Traceback (most recent call last):
  File "E:\Python\Scamp\test_scamp.py", line 3, in <module>
    from scamp import test_run
  File "C:\Apps\Thonny\lib\site-packages\scamp\__init__.py", line 26, in <module>
    from .session import Session
  File "C:\Apps\Thonny\lib\site-packages\scamp\session.py", line 22, in <module>
    from .transcriber import Transcriber
  File "C:\Apps\Thonny\lib\site-packages\scamp\transcriber.py", line 20, in <module>
    from .performance import Performance
  File "C:\Apps\Thonny\lib\site-packages\scamp\performance.py", line 28, in <module>
    from .note_properties import NoteProperties
  File "C:\Apps\Thonny\lib\site-packages\scamp\note_properties.py", line 25, in <module>
    from .spanners import Spanner
  File "C:\Apps\Thonny\lib\site-packages\scamp\spanners.py", line 25, in <module>
    from ._dependencies import abjad
  File "C:\Apps\Thonny\lib\site-packages\scamp\_dependencies.py", line 17, in <module>
    from .settings import playback_settings
  File "C:\Apps\Thonny\lib\site-packages\scamp\settings.py", line 666, in <module>
    shutil.copy(_factory_lilypond_template_path, lilypond_template_path)
  File "C:\Apps\Thonny\lib\shutil.py", line 248, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Apps\Thonny\lib\shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Apps\\Thonny\\lib\\site-packages\\scamp\\lilypond/scamp_template.ly'
>>>

When I tried to install it on my Windows 7 (32-bit) computer, which didn’t have SCAMP installed previously, I had to uninstall and re-install the package ‘python-osc’ for some reason. After doing that I was able to install everything (although I had to specify “abjad==3.4” again), but I get the same error as above.

I haven’t tried installing it on my Windows 10 computer or my Raspberry Pi. I thought I’d wait until I heard from you about this error.

Ah yes, the old path separator in Windows being a backslash issue! Thanks; that’s an easy fix, and exactly the kind of thing I was hoping to uncover. I pushed a fix—try running:

pip3 install --upgrade --index-url https://test.pypi.org/simple/ scamp

I think that should solve the problem. And yeah, mostly I’m just checking in on installation woes like this.

I’m still getting the error, although it’s all backslashes now (doesn’t Python handle that for you?). I noticed that the directory is named “C:\Apps\Thonny*Lib*\site-packages\scamp” (with a capital ‘L’ in “Lib”, not “C:\Apps\Thonny*lib*\site-packages\scamp”. Could that be the problem?

>>> %Run test_scamp.py
WARNING:root:Installing lilypond template file at C:\Users\user\AppData\Local\SCAMP\scamp_lilypond_template.ly. (This is normal on first import.)
Traceback (most recent call last):
  File "E:\Python\Scamp\test_scamp.py", line 3, in <module>
    from scamp import test_run
  File "C:\Apps\Thonny\lib\site-packages\scamp\__init__.py", line 26, in <module>
    from .session import Session
  File "C:\Apps\Thonny\lib\site-packages\scamp\session.py", line 22, in <module>
    from .transcriber import Transcriber
  File "C:\Apps\Thonny\lib\site-packages\scamp\transcriber.py", line 20, in <module>
    from .performance import Performance
  File "C:\Apps\Thonny\lib\site-packages\scamp\performance.py", line 28, in <module>
    from .note_properties import NoteProperties
  File "C:\Apps\Thonny\lib\site-packages\scamp\note_properties.py", line 25, in <module>
    from .spanners import Spanner
  File "C:\Apps\Thonny\lib\site-packages\scamp\spanners.py", line 25, in <module>
    from ._dependencies import abjad
  File "C:\Apps\Thonny\lib\site-packages\scamp\_dependencies.py", line 17, in <module>
    from .settings import playback_settings
  File "C:\Apps\Thonny\lib\site-packages\scamp\settings.py", line 666, in <module>
    shutil.copy(_factory_lilypond_template_path, lilypond_template_path)
  File "C:\Apps\Thonny\lib\shutil.py", line 248, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Apps\Thonny\lib\shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Apps\\Thonny\\lib\\site-packages\\scamp\\lilypond\\scamp_template.ly'
>>>

I tried to install it on my Raspberry Pi (Rasbian Linux v11) and got the same error, more or less. The “lib” in the path was spelt with a lower-case “L”, but there was no “lilypond” subdirectory underneath it.

Turns out there were two errors! Try one more time; I think I fixed it. The problem is that I’ve changed the lilypond output to use a template file, but I forgot to include that file in the stuff that gets shipped along with the package. (Which would also break on linux.)

It’s working on my Windows 7 64-bit computer now. But on my Windows 7 32-bit computer, I get this error in a pop-up window. Strangely enough, it seems to work anyway (I hear the sound). I don’t know if you officially support 32-bit Windows, it probably isn’t necessary any more.

On the Raspberry Pi I’m getting this error now. I’m not sure what directory it’s looking in, so I don’t know if the missing file or directory is really missing.

>>> %Run test_scamp.py
fluidsynth: warning: SDL2 not initialized, SDL2 audio driver won't be usable
Traceback (most recent call last):
  File "/home/pi/test_scamp.py", line 2, in <module>
    test_run.play(show_lilypond=True)
  File "/home/pi/.local/lib/python3.9/site-packages/scamp/test_run.py", line 49, in play
    score.show()
  File "/home/pi/.local/lib/python3.9/site-packages/scamp/score.py", line 656, in show
    abjad().show(self.to_abjad(wrap_as_file=True, non_score_blocks=non_score_blocks, **lilypond_file_args))
  File "/home/pi/.local/lib/python3.9/site-packages/scamp/score.py", line 1210, in to_abjad
    return ScoreComponent.to_abjad(self, wrap_as_file=wrap_as_file, non_score_blocks=non_score_blocks,
  File "/home/pi/.local/lib/python3.9/site-packages/scamp/score.py", line 522, in to_abjad
    return self._to_abjad_lilypond_file(non_score_blocks=non_score_blocks, **lilypond_file_args)
  File "/home/pi/.local/lib/python3.9/site-packages/scamp/score.py", line 570, in _to_abjad_lilypond_file
    abjad_lilypond_file = abjad().LilyPondFile(items=non_score_blocks + [score_block], **lilypond_file_args)
  File "/home/pi/.local/lib/python3.9/site-packages/abjad/lilypondfile.py", line 1116, in __init__
    version = LilyPondVersionToken()
  File "/home/pi/.local/lib/python3.9/site-packages/abjad/lilypondfile.py", line 872, in __init__
    version_string = configuration.get_lilypond_version_string()
  File "/home/pi/.local/lib/python3.9/site-packages/abjad/configuration.py", line 479, in get_lilypond_version_string
    proc = subprocess.run(command, stdout=subprocess.PIPE)
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'lilypond'
>>>

Yeah, I include both a 32 and 64 bit dll for fluidsynth, and it tries the 64 bit one first, and falls back to 32 bit if it fails. So that’s probably why you hear sound: it did successfullly load the 32 bit version. If that pop up happens every time, though, that’s a little annoying… Maybe I can make it check without actually trying to load the 64 bit version.

This error is just that you don’t have lilypond installed, which abjad relies on. I’m not sure, but you might just be able to install it from the package manager? On the other hand, if you don’t need music notation, no need to bother. (I assume no issues with the show_lilypond flag set to False?)

Yes, it happens every time. But I may be the only one trying to run SCAMP on a 32-bit Windows 7 computer anyway. A lot of software developers have stopped supporting Windows 7 entirely, since Microsoft stopped supporting it. And I don’t think later versions of Windows run on 32-bit computers. So it might not be worth the effort.

Right, I’d forgotten. I tried to install it, but they didn’t have a pre-compiled binary for the Raspberry Pi. I don’t get the error if I set ‘show_lilypond’ to False. But if it isn’t too difficult, you might want to wrap the line causing the exception in a “try/except” block, display a more helpful message and continue running instead of letting the program crash.

I also installed SCAMP on my Windows 10 computer and didn’t have any problems.