You are here

Not using all MIDI Channels

Hello there,
I want to use qsynth and other software that uses MIDI like bristol or ZynnAddSubFX at the same Time.
I have configured bristol to use MIDI Channel 2 and I want a Piano Sound on MIDI Channel 1, so I have loaded a collection of sound fonts into qsynth. Qsynth automatically assigns the fonts to all the 16 Channels, so if I want just the sound of bristol there is also the soundfont, assignt to Channel 2.
I tried to tell qsynth just to use one MIDI Channnel, but neither "qsynth --midi-channels 1" (I am not sure about the proper syntax at the moment) nor setting the number of channels in the configuration dialog changes the number of channels.

Is there an other way to tell qsynth just to use some special midi channels?

Forums: 
rncbc's picture

You seem to be quite right. The MIDI channels setup setting doesn't seem to work as one would expect. No matter what, it always sticks to 16 channels. I suspect this is a (lib)fluidsynth issue, as qsynth just uses the synth.midi-channels fluidsynth engine property to setup the number of MIDI channels.

We'll see...

[UPDATE] It is qsynth setup dialog which is at fault here. The MIDI channels spin-box DO NOT allow any number of channels less than 16. Blame me who never thought of it eventually being ever necessary. Guess I was wrong :)

It is very simple to fix that though: just fire up src/qsynthSetupForm.ui into your favorite text editor and change the following (line 288 to be precise)
...

280        <widget class="QSpinBox" name="MidiChannelsSpinBox" >
281         <property name="toolTip" >
282          <string>Number of MIDI channels</string>
283         </property>
284         <property name="maximum" >
285          <number>256</number>
286         </property>
287         <property name="minimum" >
288          <number>16</number>
289         </property>
290         <property name="singleStep" >
291          <number>16</number>
292         </property>
293        </widget>

...
just change the 16 into 1, save and rebuild. I'll try to remember to get that right on CVS ASAP.

[UPDATE2] I've made the changes to CVS (qsynth 0.3.4.1). However it's now evident that this change is pretty irrelevant: internally, libfluidsynth just rounds up the number of MIDI channels to the nearest multiple of 16. In fact that's exactly what was implicit in the MIDI channels spin-box minimum value property, before this change was taken. I should have figure it out in the first place :)

IOW, you'll get this messages on the console/stderr if you look closer:

fluidsynth: warning: Requested number of MIDI channels is not a multiple of 16. I'll increase the number of channels to the next multiple.

I guess you'll have to pest the fluid-dev guys now.

Cheers

Hey, thanks for the fast reply!
I was thinking about two quick n dirty ways to fix the problem...

1. Creating/Using a soundfont that does not do anything and putting it on all channels that i want to "mute". How to make or get it?
2. There are settings in qsynth that allow to create multiple output channels for jack. I dont know exactly how it works, but would it not be possible to tell qsynth to rout the sound produced by midi channel 2 on this jack channel. But instead of connecting it to the system, I just leave them unconnected.

However,
you are doing a great job on qsynth and qjackctl. Keep on rockin'! ;-)

rncbc's picture

I have no idea atm. but I'll be looking in a way to disable or leave a MIDI channel unassigned, that is having no soundfont preset assigned. Maybe that can come to your help.

Seeya

[UPDATE] After a cursory look into fluidsynth code I'm not sure how one can reset a MIDI channel as having NO preset assigned. Ok, there's one hacky way: select a bogus bank number, however that doesn't seem to work at all on MIDI channel 10 (GM Drums channel incidentally) and overall it just doesn't seem a Good-Thing-To-Do(tm).

I guess all this needs is a brand new fluidsynth API call...

Hi there,
so you've tried to assign a bank number that has no soundfont? Or is it something else you ment? I'm sorry, my english is not that good.
You said it doesn't work on channel 10, that means it works on all the other channels? How did you do that? Is it possible to do that in qsynth or did you try to do it in the CLI of fluidsynth?

Well atm I'm thinking about creating a soundfont that doesn't do anything, if I find time I'll learn how to do that, I'll tell you my results.

However, its strange that noone ever had this idea of using more than one programm for midi processing.

[edit]
created that file but didnt test it. http://intertrigo.de/DATENAUSTAUSCH/silence.sf2 But I can't beleve it's that easy.

rncbc's picture

The way I've found hacky was issuing the fluid_synth_bank_select(synth, channel, bank) programmatic call with a negative bank number. Besides that, which is not garanteed to work on all cases nor in the future, there's no other way, documented or not, that I could find.

Cheers

Add new comment