Oof, okay, this has been a bit of a saga, but I think I’ve got it working now. First of all, thank you so much for the suggestions, Marc—they were extremely helpful.
So the first thing I did was run those three lines of debug code with the M1 versions of homebrew/fluidsynth installed, and I got this:
DEBUG:root:Trying to load copy of pyfluidsynth from within SCAMP package.
DEBUG:root:Trying to load fluidsynth DLL/DYLIB from within SCAMP.
DEBUG:root:Encountered error during load: ‘dlopen(/Users/aes/.virtualenvs/comp/lib/python3.9/site-packages/scamp/_thirdparty/libfluidsynth.1.5.2.dylib, 6): no suitable image found. Did find:
/Users/aes/.virtualenvs/comp/lib/python3.9/site-packages/scamp/_thirdparty/libfluidsynth.1.5.2.dylib: no matching architecture in universal wrapper
/Users/aes/.virtualenvs/comp/lib/python3.9/site-packages/scamp/_thirdparty/libfluidsynth.1.5.2.dylib: no matching architecture in universal wrapper’
DEBUG:root:Loading of SCAMP’s copy of fluidsynth DLL/DYLIB failed.
DEBUG:root:Trying to load system copy of fluidsynth DLL/DYLIB.
DEBUG:root:Could not find system copy of fluidsynth DLL/DYLIB.
DEBUG:root:Loading of pyfluidsynth failed.
DEBUG:root:Trying to load system copy of pyfluidsynth.
DEBUG:root:Loading of pyfluidsynth failed again.
WARNING:root:Fluidsynth could not be loaded; synth output will not be available.
The “matching architecture” message seemed very telling, so then I tried installing the Intel homebrew, and then fluidsynth via that homebrew, using the steps in the Medium post you linked. That gave me this:
DEBUG:root:Trying to load copy of pyfluidsynth from within SCAMP package.
DEBUG:root:Trying to load fluidsynth DLL/DYLIB from within SCAMP.
DEBUG:root:Loading of SCAMP’s copy of fluidsynth DLL/DYLIB succeeded.
DEBUG:root:Loading of pyfluidsynth succeeded.
Testing for working audio driver…
fluidsynth: error: Couldn’t find the requested audio driver alsa. Valid drivers are: coreaudio.
fluidsynth: error: Error setting the audio callback. Status=-66748
fluidsynth: error: Couldn’t find the requested audio driver dsound. Valid drivers are: coreaudio.
fluidsynth: error: Couldn’t find the requested audio driver Direct Sound. Valid drivers are: coreaudio.
fluidsynth: error: Couldn’t find the requested audio driver oss. Valid drivers are: coreaudio.
fluidsynth: error: Couldn’t find the requested audio driver pulseaudio. Valid drivers are: coreaudio.
fluidsynth: error: Couldn’t find the requested audio driver jack. Valid drivers are: coreaudio.
fluidsynth: error: Couldn’t find the requested audio driver portaudio. Valid drivers are: coreaudio.
fluidsynth: error: Couldn’t find the requested audio driver sndmgr. Valid drivers are: coreaudio.
WARNING:root:No working audio driver was found; synth output will not be available.
Which was different, at least. The “Status=-66748” thing led me here, where a few fluidsynth users are speculating that Core Audio has some sort of permissions-related issue on Big Sur: https://www.mail-archive.com/fluid-dev@nongnu.org/msg05491.html
So I figured that maybe the path of least resistance was to try to get fluidsynth to use a different audio driver. I installed portaudio (or maybe it was already installed, but it was just being masked from me at the time?), but I kept getting the same errors as above—the only “valid driver” being printed out was coreaudio and I was being told that portaudio couldn’t be found despite the fact that I had just installed it.
Finally I realized that maybe the problem was with the fluidsynth dll’s/dynlib’s in SCAMP’s _thirdparty folder. I tried deleting those, and voila! It worked. I can get synth playback from SCAMP now. I guess maybe SCAMP’s older, local version of fluidsynth was hard coded to only accept coreaudio, or something? Not sure. Anyway, I have sound now!
Hopefully this will be helpful to others, especially as the M1 chip continues to roll out… thanks again for all of the help, Marc!