levels and more

10 views
Skip to first unread message

Atte Jensen

unread,
Jun 20, 2014, 11:04:14 AM6/20/14
to synthclo...@googlegroups.com
Hi

I cloned my Yamaha P60. When trimming I noticed that the lower velocity samples were cut shorter than the high velocity samples. Makes sense, since the tail must be below the threshold. However this is not what I expected and I think it's a very good idea. But this made me think about levels of samples, here goes:

Supposed I want to sample in two velocity levels. I set up two zones in synthclone, one with velocity 127 and one with 64. These velocities are send to the clonee (in this case the P60). Naturally the gain of the 64 velocity sample is lower than the 127 velocity. When they are played back, the engine will (and I tested in renoise and SFZ/sforzando/reaper) play back at lower levels at low velocity (obviously). However if the mapping is using strict switching (as opposed to crossfade) as I really think it should (more on that later) the 64 velocity sample is much lower than the 127 velocity samples because it's softer in the origin sample AND is played softer due to the softer velocity. The attached png + xrns showes four notes in renoise at 3F, 40, 41 and 42 (renoise hex speak for 63, 64, 65 and 66). That's two notes jusst below the switch and two notes just above the switch. As it's obvious both from looking at the png and even more when playing back the renoise file, instead of four notes that are gradually getting a tiny bit louder, there's a sudden jump in gain when playing the 3rd and 4th note. The problem is basically the same in SFZ, however since synth clone writes crossfades in the sfz, the problem is masked. I'm not sure exactly how crossfades in sfz works, but I assume at some velocities both samples would be heard. Although crossfades could potentially even out the sudden change when different velocities select samples from different samples, having both playing at the same time is something I would never hear when playing the origin instrument. What if the origin instrument were dramatically different at different velocities (for instance the classic 80's slap bass, that plays pulled string at high velocities and slapped string at lower velocities), I will never be interested in hearing both slap and pull, but with xfading I will. Not good. After modifying the sfz to do strict switching and no crossfade, the problem with sfz is (naturally) exactly the same as in renoise. Attached are also the original sfz and my modified version + reaper project.

So to sum it up:

1) I think samples should be normalized *before* the trimmer.
2) I think switching is preferred instead of crossfades (at least as an option, maybe default)
3) There seems to be a bug in the generated renoise instrument, the zones go from 00-5F and 5F-7F. So besides the are both played at 5F the range should switch round 40 (hex for 64) and not 6F

Hope it all makes sense.

If I'm completely off track here, I apologize, However I'm pretty sure something is not right :-)

Edit: The renoise file was too big to attach, its here https://dl.dropboxusercontent.com/u/4343030/level_bug.xrns

Regards
Atte
synthclone_levelbug_renoise.png
synth_clone_levels.RPP
modified_no_xfade.sfz
synth_clone.sfz

Devin Anderson

unread,
Jun 20, 2014, 2:36:03 PM6/20/14
to synthclo...@googlegroups.com
Hi Atte,

On Fri, Jun 20, 2014 at 8:04 AM, Atte Jensen <atte....@gmail.com> wrote:

> --snip--
> So to sum it up:
>
> 1) I think samples should be normalized *before* the trimmer.

I'm not exactly sure what you mean here, but I'm going to take a stab
at a solution. If there was a normalizer effect that took some
threshold value as a parameter, and normalized all of the samples
depending upon the difference between the loudest sample and the
threshold, would that be sufficient for what you need?

> 2) I think switching is preferred instead of crossfades (at least as an
> option, maybe default)

You can configure an SFZ target to not use crossfades. Right-click on
the targets pane to get a context menu that gives you options for
editing targets. Let me know if disabling crossfades is sufficient.

> 3) There seems to be a bug in the generated renoise instrument, the zones go
> from 00-5F and 5F-7F. So besides the are both played at 5F the range should
> switch round 40 (hex for 64) and not 6F

I've created an issue here:

https://code.google.com/p/synthclone/issues/detail?id=22

I don't know when I'll have time to take a look, but the issue does
seem pretty trivial, so it shouldn't take long to fix.

Thanks for the bug report!

> Hope it all makes sense.
>
> If I'm completely off track here, I apologize, However I'm pretty sure
> something is not right :-)

I think you're likely correct.

--
Devin Anderson
surfacepatterns (at) gmail (dot) com

blog - http://surfacepatterns.blogspot.com/
midisnoop - http://midisnoop.googlecode.com/
psinsights - http://psinsights.googlecode.com/
synthclone - http://synthclone.googlecode.com/

Atte Jensen

unread,
Jun 23, 2014, 5:53:56 AM6/23/14
to synthclo...@googlegroups.com
Hi Devin!

 
> 1) I think samples should be normalized *before* the trimmer.

I'm not exactly sure what you mean here, but I'm going to take a stab
at a solution.  If there was a normalizer effect that took some
threshold value as a parameter, and normalized all of the samples
depending upon the difference between the loudest sample and the
threshold, would that be sufficient for what you need?

Not sure exactly what you mean here either :-)

I thought about it a bit more, and it simply normalizing all samples would mess up the differences in loudness across the keyboard. So there are two normalizations that would *both* make sense:

1) Normalize so that the relative loudness of each zone is preserved. This would make up for a too low recording level. Should come with a "normalize to level", 0db might be too hot.
2) Normalize all samples in the same zone to the loudness as the loudest sample. This would fix the jump in loudness at the switching point between two velocity layers.

Example, two zones, two velocities (4 samples in all), in db:

Before normalize
C4, velocity 127: -4db
C4, velocity 64: -12db
C5, velocity 127: -5db
C5, velocity 64: -13db

After normalize 1):
C4, velocity 127: 0db
C4, velocity 64: -8db
C5, velocity 127: -1db
C5, velocity 64: -9db

After normalize 2):
C4, velocity 127: -4db
C4, velocity 64: -4db
C5, velocity 127: -5db
C5, velocity 64: -5db


After normalize 1) + 2) or 2) + 1), the order doesn't matter:
C4, velocity 127: 0db
C4, velocity 64: 0db
C5, velocity 127: -1db
C5, velocity 64: -1db

I assume effects are run "in order", right? So if we get these normalize effects, either as one or two separate effects, they could (should) be placed before the trimmer...

Let me know if you think this should be implemented and when there's something to test!

> 2) I think switching is preferred instead of crossfades (at least as an
> option, maybe default)

You can configure an SFZ target to not use crossfades.  Right-click on
the targets pane to get a context menu that gives you options for
editing targets.  Let me know if disabling crossfades is sufficient.

Seems enough. What's the difference between "Note crossfade curve" and "Velocity crossfade curve"?

> 3) There seems to be a bug in the generated renoise instrument, the zones go
> from 00-5F and 5F-7F. So besides the are both played at 5F the range should
> switch round 40 (hex for 64) and not 6F

I've created an issue here:

    https://code.google.com/p/synthclone/issues/detail?id=22

Great, thanks!

Atte

Devin Anderson

unread,
Jun 27, 2014, 1:16:59 AM6/27/14
to synthclo...@googlegroups.com
Hi Atte,

On Mon, Jun 23, 2014 at 2:53 AM, Atte Jensen <atte....@gmail.com> wrote:

> Not sure exactly what you mean here either :-)
>
> I thought about it a bit more, and it simply normalizing all samples would
> mess up the differences in loudness across the keyboard. So there are two
> normalizations that would *both* make sense:
>
> 1) Normalize so that the relative loudness of each zone is preserved. This
> would make up for a too low recording level. Should come with a "normalize
> to level", 0db might be too hot.
> 2) Normalize all samples in the same zone to the loudness as the loudest
> sample. This would fix the jump in loudness at the switching point between
> two velocity layers.
>
> Example, two zones, two velocities (4 samples in all), in db:
> --snip--

The hard part here is keeping state, such that the normalization after
the trimmer is back at its original value. Maybe a post-trimmer
normalizer could look at the dry sample and normalize back to the
loudest sample in the dry sample, or maybe it could normalize based on
the MIDI velocity. I would guess that the former is probably more
reasonable and useful than the latter.

> I assume effects are run "in order", right? So if we get these normalize
> effects, either as one or two separate effects, they could (should) be
> placed before the trimmer...

The pre-normalizer effect could have some sort of method to set the
normalization value either by hand or by looking at the samples in the
currently available zones. This way, one effect is sufficient.

> Let me know if you think this should be implemented and when there's
> something to test!

I have no idea when I'll get around to doing this, but, as I mentioned
before, it seems totally reasonable.

> Seems enough. What's the difference between "Note crossfade curve" and
> "Velocity crossfade curve"?

The velocity crossfade curve is used to crossfade between two samples
of different velocities. The note crossfade curve does the same with
two samples of different notes by pitch-shifting the samples and
adjusting the volume levels.

>> > 3) There seems to be a bug in the generated renoise instrument, the
>> > zones go
>> > from 00-5F and 5F-7F. So besides the are both played at 5F the range
>> > should
>> > switch round 40 (hex for 64) and not 6F
>>
>> I've created an issue here:
>>
>> https://code.google.com/p/synthclone/issues/detail?id=22
>
>
> Great, thanks!

NP. I'll fix it when I can.

Thanks,
Reply all
Reply to author
Forward
0 new messages