Help with setting volume control

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with setting volume control

scott andrew franco
Hi,
 
I am using Fluidsynth library in my program (Petit_ami on sourceforge). It is working well, but
my result is very low volume output.
 
A search found many other references to low volume, and the standard answer I found was to turn up
the gain on the command line version of fluidsynth (I believe -g or "gain" option). Of course that does not
apply to users of fluidsynth as a library.
 
I have had good luck finding various parameters via the settings call. The
"synth.gain" parameter should do it:
 
"The gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when many notes are played."
 
It is 0-10, but is defaulted to 0.2.
 
However, changing this parameter had no effect on the output volume, I tried all the way up to 10.
 
Other details: I am using alsa device. The device it is using (by examining "audio.alsa.device") shows as "default".
 
Any help appreciated.
 
Scott A. Franco
San Jose, CA
 
 

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting volume control

scott andrew franco
So running a program to research the issue:
 

/* show the device fluidsynth connects to (usually "default") */
r = fluid_settings_copystr(settings, "audio.alsa.device", buff, 200);
printf("r: %d\n", r);
printf("The alsa PCM device for Fluidsynth is: %s\n", buff);

r = fluid_settings_copystr(settings, "synth.gain", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

r = fluid_settings_setstr(settings, "synth.gain", "10");
printf("r: %d\n", r);

r = fluid_settings_copystr(settings, "synth.gain", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

r = fluid_settings_copystr(settings, "nonsense", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

 

Result:

 

./test
fluidsynth: warning: Failed to set thread to high priority
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
r: 1
The alsa PCM device for Fluidsynth is: default
r: 0
The gain for Fluidsynth is:
r: 0
r: 0
The gain for Fluidsynth is:
r: 0
The gain for Fluidsynth is:

 

So "synth.gain" does not appear to exist. I got this name from:

http://www.fluidsynth.org/api/fluidsettings.xml

?

 
--------- Original Message ---------
Subject: [fluid-dev] Help with setting volume control
From: "scott andrew franco" <[hidden email]>
Date: 7/30/19 6:58 pm
To: [hidden email]

Hi,
 
I am using Fluidsynth library in my program (Petit_ami on sourceforge). It is working well, but
my result is very low volume output.
 
A search found many other references to low volume, and the standard answer I found was to turn up
the gain on the command line version of fluidsynth (I believe -g or "gain" option). Of course that does not
apply to users of fluidsynth as a library.
 
I have had good luck finding various parameters via the settings call. The
"synth.gain" parameter should do it:
 
"The gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when many notes are played."
 
It is 0-10, but is defaulted to 0.2.
 
However, changing this parameter had no effect on the output volume, I tried all the way up to 10.
 
Other details: I am using alsa device. The device it is using (by examining "audio.alsa.device") shows as "default".
 
Any help appreciated.
 
Scott A. Franco
San Jose, CA
 
 
_______________________________________________ fluid-dev mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/fluid-dev

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting volume control

scott andrew franco
Actually, going through the .xml list, quite a few of the values don't appear to be defined
(return nothing from fluid_settings_copystr()).
 
--------- Original Message ---------
Subject: Re: [fluid-dev] Help with setting volume control
From: "scott andrew franco" <[hidden email]>
Date: 7/30/19 11:35 pm
To: [hidden email]

So running a program to research the issue:
 

/* show the device fluidsynth connects to (usually "default") */
r = fluid_settings_copystr(settings, "audio.alsa.device", buff, 200);
printf("r: %d\n", r);
printf("The alsa PCM device for Fluidsynth is: %s\n", buff);

r = fluid_settings_copystr(settings, "synth.gain", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

r = fluid_settings_setstr(settings, "synth.gain", "10");
printf("r: %d\n", r);

r = fluid_settings_copystr(settings, "synth.gain", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

r = fluid_settings_copystr(settings, "nonsense", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

 

Result:

 

./test
fluidsynth: warning: Failed to set thread to high priority
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
r: 1
The alsa PCM device for Fluidsynth is: default
r: 0
The gain for Fluidsynth is:
r: 0
r: 0
The gain for Fluidsynth is:
r: 0
The gain for Fluidsynth is:

 

So "synth.gain" does not appear to exist. I got this name from:

http://www.fluidsynth.org/api/fluidsettings.xml

?

 
--------- Original Message ---------
Subject: [fluid-dev] Help with setting volume control
From: "scott andrew franco" <[hidden email]>
Date: 7/30/19 6:58 pm
To: [hidden email]

Hi,
 
I am using Fluidsynth library in my program (Petit_ami on sourceforge). It is working well, but
my result is very low volume output.
 
A search found many other references to low volume, and the standard answer I found was to turn up
the gain on the command line version of fluidsynth (I believe -g or "gain" option). Of course that does not
apply to users of fluidsynth as a library.
 
I have had good luck finding various parameters via the settings call. The
"synth.gain" parameter should do it:
 
"The gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when many notes are played."
 
It is 0-10, but is defaulted to 0.2.
 
However, changing this parameter had no effect on the output volume, I tried all the way up to 10.
 
Other details: I am using alsa device. The device it is using (by examining "audio.alsa.device") shows as "default".
 
Any help appreciated.
 
Scott A. Franco
San Jose, CA
 
 
_______________________________________________ fluid-dev mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/fluid-dev
_______________________________________________ fluid-dev mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/fluid-dev

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting volume control

scott andrew franco
Got it, you have to use a routine appropriate to the field type, ie, fluid_settings_setnum(settings, "synth.gain", 2.0);
 
Sorry to bother you all,
 
Scott Franco
 
--------- Original Message ---------
Subject: Re: [fluid-dev] Help with setting volume control
From: "scott andrew franco" <[hidden email]>
Date: 7/30/19 11:45 pm
To: [hidden email]

Actually, going through the .xml list, quite a few of the values don't appear to be defined
(return nothing from fluid_settings_copystr()).
 
--------- Original Message ---------
Subject: Re: [fluid-dev] Help with setting volume control
From: "scott andrew franco" <[hidden email]>
Date: 7/30/19 11:35 pm
To: [hidden email]

So running a program to research the issue:
 

/* show the device fluidsynth connects to (usually "default") */
r = fluid_settings_copystr(settings, "audio.alsa.device", buff, 200);
printf("r: %d\n", r);
printf("The alsa PCM device for Fluidsynth is: %s\n", buff);

r = fluid_settings_copystr(settings, "synth.gain", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

r = fluid_settings_setstr(settings, "synth.gain", "10");
printf("r: %d\n", r);

r = fluid_settings_copystr(settings, "synth.gain", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

r = fluid_settings_copystr(settings, "nonsense", buff, 200);
printf("r: %d\n", r);
printf("The gain for Fluidsynth is: %s\n", buff);

 

Result:

 

./test
fluidsynth: warning: Failed to set thread to high priority
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
r: 1
The alsa PCM device for Fluidsynth is: default
r: 0
The gain for Fluidsynth is:
r: 0
r: 0
The gain for Fluidsynth is:
r: 0
The gain for Fluidsynth is:

 

So "synth.gain" does not appear to exist. I got this name from:

http://www.fluidsynth.org/api/fluidsettings.xml

?

 
--------- Original Message ---------
Subject: [fluid-dev] Help with setting volume control
From: "scott andrew franco" <[hidden email]>
Date: 7/30/19 6:58 pm
To: [hidden email]

Hi,
 
I am using Fluidsynth library in my program (Petit_ami on sourceforge). It is working well, but
my result is very low volume output.
 
A search found many other references to low volume, and the standard answer I found was to turn up
the gain on the command line version of fluidsynth (I believe -g or "gain" option). Of course that does not
apply to users of fluidsynth as a library.
 
I have had good luck finding various parameters via the settings call. The
"synth.gain" parameter should do it:
 
"The gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when many notes are played."
 
It is 0-10, but is defaulted to 0.2.
 
However, changing this parameter had no effect on the output volume, I tried all the way up to 10.
 
Other details: I am using alsa device. The device it is using (by examining "audio.alsa.device") shows as "default".
 
Any help appreciated.
 
Scott A. Franco
San Jose, CA
 
 
_______________________________________________ fluid-dev mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/fluid-dev
_______________________________________________ fluid-dev mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/fluid-dev
_______________________________________________ fluid-dev mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/fluid-dev

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev