Closed Stooovie closed 1 year ago
When I run this in the GUI I get an error about a tab character at the start of line 390 (right where you added the init
block). According to the YAML spec, which bank files are based on, tabs can't be used at the beginning of lines.
You don't need that init
block, or the router_rules
block - bank0.yaml uses the init block to set some initial control change values for instruments on different channels, and the router rules allow a keyboard sending notes on channel 1 to also talk to those other channels. The gmbank you're using just uses the default values for all instruments, so everything can be on channel 1.
Still, even with your own fluid_gmbank.yaml from https://gist.github.com/albedozero/721442c1d112839c71fd8f7d9ce1a98b I'm not getting anything.
Now I'm not getting anything even out of the box (complete wipe and reinstall).
-Correct audio output is selected in the script (Pi4 headphones) -I do hear static after booting, so the output is fine -output is loud in alsamixer (correct card)
This is aconnect -i
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 20: 'Impact LX88+' [type=kernel,card=1]
0 'Impact LX88+ MIDI1'
1 'Impact LX88+ MIDI2'
aplay -l
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
aseqdump -p 20 shows notes on Ch1 just fine
squishboxconf.yaml
soundfontdir: SquishBox/sf2
bankdir: SquishBox/banks
mfilesdir: SquishBox/midi
plugindir: /usr/lib/ladspa
currentbank: bank0.yaml
fluidsettings: # http://www.fluidsynth.org/api/fluidsettings.xml
audio.driver: alsa
audio.alsa.device: hw:Headphones
audio.period-size: 64
audio.periods: 3
midi.autoconnect: 1
player.reset-synth: 0
synth.audio-groups: 16
synth.cpu-cores: 4
synth.ladspa.active: 1
synth.polyphony: 128
But I'm getting no sound.
./headlesspi.py is giving me
Connection is already subscribed
Connection is already subscribed
even AFTER running
sudo systemctl stop squishbox.service
Anything else? Thanks!
Hmm. All the settings look good. Try
aconnect -iol
to see if the keyboard is being connected to FluidSynth, and
speaker-test --device hw:Headphones
to confirm that sound is in fact working.
aconnect -iol gives me
client 0: 'System' [type=kernel]
0 'Timer '
Connecting To: 128:0
1 'Announce '
Connecting To: 128:0
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
Connecting To: 128:0
client 20: 'Impact LX88+' [type=kernel,card=1]
0 'Impact LX88+ MIDI1'
Connecting To: 128:0
1 'Impact LX88+ MIDI2'
Connecting To: 128:0
client 128: 'FLUID Synth (396)' [type=user,pid=396]
0 'Synth input port (396:0)'
Connected From: 0:1, 14:0, 20:0, 20:1, 0:0
and the sound test does indeed play pink noise. This is 100% clean install. Rpi4 with 32bit Raspbian Bullseye with only the Fluidpatcher script ran after install. Only the Nektar keyboard and headphones are connected to the Pi.
I can also play audio just fine after stopping the squishbox.service with
fluidsynth -a pulseaudio -m alsa_seq -l -i sf2/GeneralUser.sf2 midi/elevatorgroove.mid
But live playing does not produce any sound.
Why does running ./headlesspi.py always say "Connection is already subscribed"? Even when I stop or even disable the squishbox service. That looks suspicious.
Somehow, I have absolutely no idea how, I am now able to produce the basic patch on my LX88, but now I'm unable to change the patches.
The LX88 emits control messages on Ch15 but notes on Ch0. Even when I change "Chan" in headlesspi.py to 15, I can not control the patches, only play notes with the first available patch. I am testing with aseqdump -p 20:0 and the numbers I put in headlesspi.py seem to be correct.
The button I want to go to next patch is showing as this in aseqdump:
20:0 Control change 15, controller 112, value 127
20:0 Control change 15, controller 112, value 0
But when I set Chan to 15 and Controller to 112, and run ./headlesspi.py, pressing the button does nothing.
Why does running ./headlesspi.py always say "Connection is already subscribed"? Even when I stop or even disable the squishbox service. That looks suspicious.
The warning is coming from fluidsynth. When fluidsynth autoconnects, the fluid_alsa_seq_autoconnect function goes through every port on your system and tries to connect it to FluidSynth, but if the port is already connected it skips it with this warning. One of them is the system:announce
port, which is always connected to listen for new devices being plugged in, so maybe it's slightly slopping coding, but it doesn't cause a problem.
when I set Chan to 15 and Controller to 112, and run ./headlesspi.py, pressing the button does nothing.
MIDI channels are numbered starting from 1 according to the MIDI spec. Fluidpatcher follows this rule, since pretty much all keyboards do as well. Unfortunately some programs like aseqdump
and even FluidSynth itself number starting from 0.
TLDR your keyboard is sending notes on MIDI channel 1 and control changes on MIDI channel 16, so in headlesspi.py you should set
CHAN=16
according to asedump the controls are sent on channel 15 (fiftenn) like this
32:0 Note on 0, note 48, velocity 43
32:0 Note off 0, note 48
32:0 Control change 15, controller 112, value 127
32:0 Control change 15, controller 112, value 0
but changing patches indeed DOES work when I set Ch to 16 (sixteen!)
CHAN = 16
Why is that? Is channel 16 some kind of global channel? Thank you!
but changing patches indeed DOES work when I set Ch to 16 (sixteen!)
CHAN = 16
Why is that? Is channel 16 some kind of global channel? Thank you!
aseqdump
numbers MIDI channels starting from 0, which is not the accepted way. Almost all keyboards and the MIDI specification start numbering them at channel 1. So your keyboard is in fact sending control changes on MIDI channel 16 - aseqdump
just reports it as 15.
That's crazy :) Thank you, this one is solved.
Too bad SOME of the controls send on channel 0 (the rotary knobs) and the transport buttons send on channel 15, I'd love to be able to do incremental by the transport buttons and direct by the knobs, but that's just a minor inconvenience,
You can do it with a simple workaround. Go ahead and set CHAN = 16
, but in this line of the connect_controls()
function, replace CHAN
with 1
for your selector knobs' channel.
No matter what I do, doesn't work for me. I did copy the
router_rules
section from bank1.yaml that works for me, and theinit
section on the bottom, i did put the proper filename into squishboxconf.yaml (currentbank: fluid_gmbank.yaml), paths are unchanged, yet upon reboot it just doesn't play. The file looks like this and produces no sound at all at any channel or patch number:I don't see any functional difference to the default bank#.yaml files, yet those play and this doesn't. Permissions are the same. Any clues?