Comments (4)
Hi AlbedoZero, thank you again for the detailed information about fluidsynth internals. While I am still not quite sure how to implement this purely using the bank files, for a current solution I'm using a combination of program change and patches, which add specific programs from different pipe organ sounfonts , creating a mix.
Ill try to think on an implementation to emulate the way a pipe organ behaves. Perhaps some bank files can have a directive at the init level, to separate banks and its rules from the 'normal' banks. I'll write you later 👍
from fluidpatcher.
Unfortunately the only way to remove a rule once it's added to the router is to clear all the rules and start again. As the FluidSynth API states, once you pass a rule to fluid_midi_router_add_rule()
it should not be accessed again. This is because rules are stored in the router in a linked-list structure - removing a rule would break the link and probably cause a segfault. I think delete_fluid_midi_router_rule()
is meant to be used on a rule you've created but not yet added to the router.
What's your reason for not wanting to use CC7=0 to mute particular channels? I know that this can cause unwanted behavior if you also use the volume slider on your keyboard to control the volume on all channels - those muted voices will pop back on if you move the slider. The workaround is to use CC11 to mute voices when needed as discussed in FluidPatcher Lesson 4. The sound volume is the product of MIDI volume (CC7) and Expression (CC11), so an expression level of 0 is unaffected by changing the volume. This was designed into the MIDI specification for pretty much this exact reason. Here's an example bank file that would do something like you're suggesting:
patches:
Drawbars:
1: organ/Oberheim OB-3.sf2:000:001
2: organ/Oberheim OB-3.sf2:000:002
3: organ/Oberheim OB-3.sf2:000:003
router_rules:
- {type: note, chan: 1=2-3}
- {type: cc, chan: 1, par1: 13=11}
- {type: cc, chan: 1=2, par1: 14=11}
- {type: cc, chan: 1=3, par1: 15=11}
- {type; cc, chan: 1=1-16, par1: 7}
from fluidpatcher.
Hi, thank you very much for your detailed response. I wasn't aware that fluidsynth stored routing information in a r/o structure. This changes the plan for sure.
I've red in some forum (https://www.midi.org/forum/8492-is-there-a-channel-mute-message,-and-if-so-is-it-sysex-or-a-cc) some objections about using the volume control CC7 to mute a voice, but I didn't have the time to actually test if there is any issue related with their claim.
Anyway, when I see the behavior of many sequencers, it looks like the mute button doesn't affect the volume of a particular channel. Also, I didn't find a way to query the synth to tell what is the actual CC7 value for a channel before muting, in order to restore it when reactivating the voice.... Would it be a possible alternative to use fluid_synth_unset_program/fluid_synth_program_select instead?
I was thinking to add a route rule poiting to a listener which will query fluidsynth for information about the channel, then if the program is assigned it means the state is on, otherwise off.
I don't know if that could cause any lag, since the activation/deactivation of a voice needs to be immediate. Sadly I'm out of time this week to try all this but I look forward in seven days!..
Thank you again,
from fluidpatcher.
I see in that forum post that someone was worried about losing polyphony to voices that are being played at zero volume. That may or may not be true for the Roland Sound Canvas, but FluidSynth allocates only the voices it needs to produce sound, and won't use them up on channels that are at zero volume, even if those channels receive notes. If you use CC 11 to mute/unmute the channels as in my example above, it will automatically restore to the volume set by CC 7 on that channel when you umute, since the total volume is the product of CC 11 and CC 7 values. Another way to do it would be to create individual patches for each combination of organ stops and switch between them - you can use a router rule with a patch
parameter as described in the bank file doc to select patches directly with a button or key.
The functions fluid_synth_unset_program/fluid_synth_program_select are already wrapped, but they aren't really meant to be accessed through the FluidPatcher API. The whole point of FluidPatcher is to create patches with the programs you want on each channel, then switch between the patches. You could add code to one of the listener functions that would handle a message from your custom router rule to set/unset programs on a given channel, but there are already ways to accomplish the same effect using bank files, without having to go into the code.
from fluidpatcher.
Related Issues (20)
- Windows Fluidpatcher setup program fails -- and provides insufficient info to troubleshoot
- Midi Monitor on fluidpatcher_cli crashes when receiving sysex messages HOT 2
- Notes from MIDI keyboard do not produce audio HOT 2
- No sound or lcd output HOT 2
- LADSPA plugins won't work on Raspberry pi HOT 2
- Error in bank0 Elevator Jam preset HOT 1
- Unable to update squishbox from version <= 0.7.11 using menu HOT 1
- fluidpather won't install with python 11 , wxpython throws bugs while installing HOT 1
- Small security quibble HOT 1
- RFE: adding all instruments from FluidR3_GM.sf2 HOT 3
- Unable to start FluidPatcher (pyw) after running Windows installer due to failing wxpython pip install HOT 5
- MIDI messages not being received by headlesspi.py HOT 11
- Doesn't install on macOS Ventura HOT 1
- midi.autoconnect not working HOT 6
- FluidPatcher 0.7.15 isn't intaling python modules HOT 1
- squishbox-install.bash no longer works HOT 1
- Install script errors under Raspberry Pi OS Bookworm HOT 2
- Problems installing fluid-soundfont-gm! HOT 1
- Save patch issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluidpatcher.