Sinewave Primer .sf2 file ( fluidsynth)

I think @wyleu and I are about twice as many miles as we are Hertz apart :hear_no_evil:. (This isn’t the first HG2TG reference in my day! BTW - can you think of any TV programmes that have been shamelessly stolen by radio? Observe that audio is the superior medium.)

Did you get anywhere with this plan to add a reference test tone to each engine (or any engine)? It would be useful in testing various bits, including the new, much acclaimed audio level meters. (Now that was a shameless plug :blush:.) I have been learning a bit about PD today so could probably add a PD test tone patch.

How about defining a reference level, e.g. each patch should give peak programme level of -18dBFS with MIDI controller volume set to 71 and expression set to 80. (This should map correctly for soundfonts with expression at 127 (100%) resulting in output peaking at -10dBFS which is a reasonable peak value with headroom. Other engines may scale differently but we need to start somewhere.) Or if expression has no effect, volume set to 45.

Volume Expression DPM value
45 127 -18dBFS
71 80 -18dBFS
71 127 -10dBFS
127 127 0dBFS

(I don’t know whether there is an advantage going to 11, i.e. scaling so that we can drive the sinewave into saturation in which case the MIDI controller values would be lower.)
This is based on the formula:

Gain in dB = (40 * log10(cc7/127)) + (40 * log10(cc11/127))

[Edit]

Having created a Pure Data test tone I am now of the opinion that we should not insist on implementing Expression and use a value of 127 if unavailable. I also think the formula is wrong. The ‘40’ should be replaced by ‘20’. Maybe the formula is suitable for Soundfont but not for PD (and possibly other engines). I also think that we shouldn’t bother with a -18dBFS reference tone. It is nice for lining up tape machines but that isn’t actually what we want to do. I reckon we should use -10dBFS as out reference which represents the maximum level we would want an engine (or combination of engines) to reach. We should allow gain to be applied to push this level into saturation, i.e. have more than 10dB of gain available from our reference level. A bit more experimenting with actual instruments may be required before redrawing the table.

[Edit]

And another thing… Let’s not get hung up on frequency. If we use MIDI note on / off + sustain to trigger and hold the tone and use twelve tone equal temperament tuning then C6 is 1046.502Hz but A4 at 440Hz is probably more pleasing.

If we want our army knife to be a standards compliant signal generator then I am sure someone can knock up a PD patch for that. (Surely someone already has? One break on the left, two breaks on the right.)

I’ve just been reading up on expression,
To quote from elesewhere
A little-known MIDI fact is that there are TWO controllers reserved for expression: #11 (coarse) and #43 (fine).

The default value for expression you suggest would seem eminently sensible.

But I LIKE tape machines… :smiley:

Go with -10dBFS. There should be one and only one in our world !

So volume 71 is the new 96!

Again as long as we have one standard in the zynth world I’m not fussy. Making it pitched at a useful music pitch within an environment seems a sensible thing.
It means that people could tune to it whilst the signal chains are adjusted for levels.

440Hz or 880Hz & -10dBFS . . .

… With a webconf setting for 440/442 . . . :thinking:

I have just implemented an OVER (0dBFS) indication in the level meters (currently a PR under review) from which I immediately observed that many instruments are encoded really loud, e.g. the two SF2 pianos I tried needed to be set to volume 64 to avoid saturating the output. (This is with expression set to 127. Expression controller is supposed to provide performance (or mixing) dynamics hence one might expect it to be set mid-range by default to allow both amplification and attenuation but you want to be able to use expression to increase gain so the maximum level needs to be set with the volume control.)

It concerns me that the out-of-box experience may be adversely affected if the standard sounds distort easily. A typical sample player (like our sf2 / sfz engines) would scale its samples so that they played at full velocity, full volume and full expression without (or just) reaching 0dBFS, i.e. without digital distortion.

I wonder if we (I) have strayed in to the realms of a new topic?

That seems simple enough, but polyphony complicates it.

I think the issue of saturating output may be significantly improved by the implementation of feature request 103 whereby we could have an output bus that is non-saturating (floating point) plus a final level control to tame the output to below 0dBFS.