AttributeError: 'NoneType' object has no attribute 'Synth'

macOS 12.4
Python 3.10.4

why am I getting this error?

ayk@Ayks-Mini-2 ~ % python3
Python 3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from scamp import *
WARNING:root:Fluidsynth could not be loaded; synth output will not be available.
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.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/__init__.py", line 26, in <module>
    from .session import Session
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/session.py", line 22, in <module>
    from .transcriber import Transcriber
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/transcriber.py", line 20, in <module>
    from .performance import Performance
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/performance.py", line 33, in <module>
    from .instruments import Ensemble, ScampInstrument
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/instruments.py", line 26, in <module>
    from ._soundfont_host import get_best_preset_match_for_name, print_soundfont_presets
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/_soundfont_host.py", line 34, in <module>
    class PlayAndRecSynth(fluidsynth.Synth):
AttributeError: 'NoneType' object has no attribute 'Synth'

This error is not very informative, sorry. I’ll fix it on the next release.

But the basic error is that you don’t have a working copy of fluidsynth. Can you try running this:

import logging; logging.getLogger().setLevel(logging.DEBUG)
import scamp

…and tell me what debug info is printed out?

Also, is it an M1 mac? If so, have you installed Rosetta 2?

Traceback (most recent call last):
File “”, line 1, in
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/init.py”, line 26, in
from .session import Session
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/session.py”, line 22, in
from .transcriber import Transcriber
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/transcriber.py”, line 20, in
from .performance import Performance
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/performance.py”, line 33, in
from .instruments import Ensemble, ScampInstrument
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/instruments.py”, line 26, in
from ._soundfont_host import get_best_preset_match_for_name, print_soundfont_presets
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scamp/_soundfont_host.py”, line 34, in
class PlayAndRecSynth(fluidsynth.Synth):
AttributeError: ‘NoneType’ object has no attribute ‘Synth’

import fluidsynth
Traceback (most recent call last):
File “”, line 1, in
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fluidsynth.py”, line 42, in
raise ImportError(“Couldn’t find the FluidSynth library.”)
ImportError: Couldn’t find the FluidSynth library.

I can’t tell from what you’ve written: what happens if you run this exact code as a file:

import logging; logging.getLogger().setLevel(logging.DEBUG)
import scamp

By setting the logging level to debug before importing SCAMP, it should show some extra information about trying to import fluidsynth.

Also, what is your operating system? Why did it suddenly stop working?