Closed Timendus closed 3 years ago
It's been a bit on this pull request, but I feel I can make a choice now that I've finished some of my planned updates for the v0.5 release. I appreciate the work, and fully support and encourage modification of the project, but I'm not going to merge this into the main branch for the following reasons:
There are now much simpler ways to do this (i.e. have a sound play when selecting a patch). A couple options:
This repo will only use FluidSynth as a sound source. Your pull request actually spurred me to do some experimentation with various methods of playing audio files (wavs, mp3, ogg, etc.) from within fluidpatcher including simpleaudio, pydub, and jackclient. My thinking was this would fit not just your use-case, but also allow playing backing tracks, set break music, etc. My conclusion was that there isn't a reliable way to play audio via python while also running FluidSynth. It shouldn't even be possible for simpleaudio to use the sound card while FluidSynth is also active - I think it's just a side effect of the way the Raspberry Pi's CPU talks to the headphone jack. It doesn't work with a USB sound card or add-on DAC like the hifiberry. I decided that this software would reach its highest potential if focused on being a cross-platform wrapper for FluidSynth, without also providing an additional audio source that would have to be maintained and configured differently depending on the audio setup.
Again, thanks for the pull request and interest in the project - I figured a lot of things out looking into this.
First of all, thanks for an awesome project. I plan to use this mainly for my camping trips, playing music with friends around the campfire 🔥 🎶 🎹
What I thought the headless version of this software lacks for that purpose is a way to get a better idea of what the Pi is doing. It felt a bit too much like a black box when I don't have my laptop connected to it. So I added the option to enable audio feedback. It's off by default so it doesn't annoy people who want to use a headless Pi on stage, and in other more professional settings. The feedback can be enabled by setting
audiofeedback
to1
insquishboxconf.yaml
.When enabled, the headless Pi will beep at you in various ways when:
INC_PATCH
orDEC_PATCH
The sound effects were made by me using GarageBand, so there should be no copyright issues there. The files have been given descriptive names so people can easily swap them out for their own sounds.
It adds one dependency,
simpleaudio
. On Linux, this module depends onpython3-dev
andlibasound2-dev
, but I think those are already dependencies of this project..? At least I didn't have to install anything new (besidespip3 install simpleaudio
) to get this to work. Same on MacOS, it "just worked" for me. I guess this will require some changes to the install script, but I don't see that in this repository, so I can't fix that for you.The only thing that's bugging me is the shut down timing. I expected to hear the shut down sound two seconds after the 'about to shut down' sound, but it takes a second or maybe two longer. I'm not sure why, and it's not really a big issue, but I thought I should mention it.
As you may be able to tell from the commit messages, I'm not a Python developer. So I hope my code makes enough sense for you to be able to merge it. If not, I can make changes where necessary, or feel free to start from scratch 😉
Cheers and thanks again, Tim