Thanks JJC - That's all very helpful!
Adding the two channels seems like the straightforward and more natural thing to do. All the best, Ien On Thu, May 14, 2015 at 9:32 AM, CERESA Jean-Jacques ENAC/ENAC < jean-jacques.cer...@enac.fr> wrote: > Hi, > > >If this is the correct way to generate mono output ? > When any audio device (i.e the fluid_synth_write_s16() or another device) > supplies a stereo (left,right) signal, the right way to transfort this > signal in a mono signal with the same level is to sum left and right > part.: Mono signal = left + right > > >Could this explain why the volume is low? Because each channel is at half > volume? > Let a stereo signal with panoramic at 0 (i.e centered) (Left = 50% level, > Right= 50 % level). > If you overwrite left channel by right channel (or the reverse) you lost > 50% of the initial level > > Let a stereo signal with panoramic at -25 % . (Left = 75% level, Right= 25 > % level) > If you overwrite left channel by right channel you lost 75% of the level > !!! > > >what other reasons could there be for the volume to be low? > 1) Of course, the main gain must be at 1 to get a full level of the > soundfont sample used to synthesize your sound. > 2)To get a full stero level, not only Velocity must be full (127) but also > both MIDI CC Expression and Volume need to be full. Both have correct > initial default value (127 and 100). > > >If so, is there another way to general full-volume mono output? , > Here tow distincts ways: > 1)If you want to use your way (i.e. the right channel overwriting the > left channel), you can do this workaround: > Set a stereo signal with panoramic at +50 % . (Left = 0% level, Right= 100 > % level), for alls voices of the preset used to synthesize your sound. > > 2)After calling fluid_synth_write_s16() , for each sample you can do: > left = left + right. > > Which do you prefer ? > > jjc > > Le 14/05/15, *Ien Cheng *<i...@alum.mit.edu> a écrit : > > Hi fluidsynth-dev: > > I've got fluidsynth working nicely in an Android app. What I'm doing is > using the fluid_synth_write_s16 API to generate PCM data that I feed into > Android's OpenSL ES audio system. > > However, I'm running into an odd problem where the volume level is low, > even with all MIDI velocities set to the max of 127. > > I wonder if this is due to the way I'm trying to generate mono output. In > the parameters to to fluid_synth_write_s16, I've set lout = rout, loff and > roff to both be 0, and lincr and rincr to both be 1 -- i.e. the right > channel is overwriting the left channel. > > Could this explain why the volume is low? Because each channel is at half > volume? > > If so, is there another way to general full-volume mono output? If this is > the correct way to generate mono output, what other reasons could there be > for the volume to be low? > > Thanks! > > --Ien > > p.s. Aere Greenway, if you are reading this, THANKS for your reply to my > question about SF2/DLS/iOS the other day -- I got the mailing list digest > and can't reply to your reply directly. > > > _______________________________________________ > fluid-dev mailing list > fluid-dev@nongnu.org > https://lists.nongnu.org/mailman/listinfo/fluid-dev > >
_______________________________________________ fluid-dev mailing list fluid-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/fluid-dev