Did anything change with the Piano Synthdef in 3.2?

I was working on a song back in the previous version that I just loaded up into 3.2. It was still in progress when I upgraded.

I was using the vel parameter to control the velocity of it, and if it had the default of 0.2, that it was fine. I found out something was wrong because I had a few notes that didn’t have the velocity on them. They blended well in the previous verison, but stick out now.

The original default was 0.2, so how is it that a default run(the second one), so much louder then ones with a vel > 0.2

{run: 49, time: 3.2927}
└─ synth :piano, {note: 51.0, sustain: 0.2439, release: 0.2439, vel: 0.2052}

{run: 49, time: 3.2927}
└─ synth :piano, {note: 79.0, sustain: 1.9512, release: 1.9512}

{run: 49, time: 3.4146}
└─ synth :piano, {note: 51.0, sustain: 0.4878, release: 0.4878, vel: 0.2036}

I’m about to dig in now but I thought I would ask first, to see if anyone know off the top of their head.

If it has changed, that might explain why everything sound so soft now

The piano synth has been updated to allow for fractional tuning, ie you can now play 72.3 with the piano synth. I’m not sure if this would have affected the behaviour of the vel parameter.
the mods were done by user emlyn

EDIT I think th default vel value is now 0.8

I don’t remember exactly what I did, but looking back at the PR, it looks like the original version had a superfluous scaling by a factor of 4 that seemed like a bug. That was removed, and the default velocity scaled up by a factor of 4 to compensate.

That probably wasn’t a bug. I added a scale factor to all synths to help get them to be a similar amp.

I didn’t notice you had modified that. I thought you had just changed the pitch capabilities. In the future, it would always be beneficial to check to see if an assumption about something being a bug was true before acting on it! :slight_smile:

Sadly we now have an undocumented breaking chance in the piano amplitude :frowning:

Sorry, it was discussed in the PR (with @ethancrawford), so I guess I just assumed you were OK with the resolution, but I should have been more careful to bring it to your attention specifically.

1 Like

Yes, I think at the time we left it the way it ended up as we didn’t see any further review comments @samaaron

Also, good point about checking with you over unclear implementation details. Thanks.

3 Likes

No worries, I should have been more observant! :slight_smile:

2 Likes

Ok cool. That’s all I needed to know, I can work with the default being .8 for this one, and go from there.

That explains the quiet part too. :stuck_out_tongue:

Thanks everyone for the update. Glad I could help find a bug. :slight_smile:

1 Like

Would it be useful if I sent a PR setting it back to the previous value? It would of course be another breaking change, but only compared to 3.2.0, not earlier versions, and at least it would be consistent with the other synths again.

1 Like

I think reverting the amp to how it was would be a good move :slight_smile:

2 Likes

Can y’all update here if anything changes? I will make this song using the 0.8 for now, and can go back and fix it later when it changes back

I’ve opened a PR here with a potential fix. It doesn’t behave identically to how it did before version 3.2.0, as I think there was a bug in the old behaviour (or maybe it was doing something I don’t understand), but it should have the same output volume (at least for velocities up to 0.25).

My PR was just merged, so the next release should have the default velocity back at 0.2, with the scaling factor of 4 on the output of the synth (instead of on the velocity parameter, which would have allowed setting out-of-range values before) so that the volume is back in sync with earlier versions.

3 Likes

Hmm. Not sure this is right yet.
try this on 3.2.1 beta

live_loop :test do
  8.times do
    n=scale(:c4,:major).tick
    synth :piano,note: n,release: 0.2#,vel: 0.6
    sleep 0.2
  end
  8.times do
    n=scale(:c4,:major).tick
    synth :tri,note: n,release: 0.2
    sleep 0.2
  end
end

The piano synth is incredibly quiet with the default vel opt =0.2
It needs to be much higher, or , if it is to remain there, then adjustments need to be made elsewhere in the synth definitiion.

Compare what it sounds like in version 3.1 or 3.2
Also uncomment the #,vel: 0.6 and see the difference… experiment with other values for the vel opt.

Oh no :frowning:
I’ve added a comment on your github issue, and I’ll look into it myself when I get some time.

Thanks emlyn. Needs sorting before 3.2.1 is released.

I think I’ve tracked down the problem. Changing vel doesn’t affect the volume linearly, so when it was reduced by a factor of 4, the signal had to be amplified by a much larger factor to compensate. This PR should fix it.

Thanks. I’ll try it out later today.