# Did anything change with the Piano Synthdef in 3.2?

**URL:** https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392
**Category:** Support, Help & Resources
**Created:** [March 4, 2020, 12:41am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392 "2020-03-04T00:41:51Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![MrSkeletal](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mrskeletal/32/890_2.png) [@MrSkeletal](https://in-thread.sonic-pi.net/u/MrSkeletal)
#### Post date: [March 4, 2020, 12:41am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/1 "2020-03-04T00:41:52Z")

</div>

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

---

<div class="post-metadata">

### Author: ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)
#### Post date: [March 4, 2020, 10:00am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/2 "2020-03-04T10:00:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 4, 2020, 10:50am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/3 "2020-03-04T10:50:40Z")

</div>

I don’t remember exactly what I did, but looking back at the [PR](https://github.com/samaaron/sonic-pi/pull/2041#issuecomment-475573990), 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.

---

<div class="post-metadata">

### Author: ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)
#### Post date: [March 4, 2020, 10:55am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/4 "2020-03-04T10:55:58Z")

</div>

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! 🙂

---

<div class="post-metadata">

### Author: ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)
#### Post date: [March 4, 2020, 10:57am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/5 "2020-03-04T10:57:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 4, 2020, 11:05am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/6 "2020-03-04T11:05:04Z")

</div>

Sorry, it _was_ discussed in the [PR](https://github.com/samaaron/sonic-pi/pull/2041) (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.

---

<div class="post-metadata">

### Author: ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)
#### Post date: [March 4, 2020, 11:50am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/7 "2020-03-04T11:50:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)
#### Post date: [March 4, 2020, 11:51am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/8 "2020-03-04T11:51:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)
#### Post date: [March 4, 2020, 12:35pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/9 "2020-03-04T12:35:02Z")

</div>

No worries, I should have been more observant! 🙂

---

<div class="post-metadata">

### Author: ![MrSkeletal](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mrskeletal/32/890_2.png) [@MrSkeletal](https://in-thread.sonic-pi.net/u/MrSkeletal)
#### Post date: [March 4, 2020, 2:57pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/10 "2020-03-04T14:57:47Z")

</div>

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. 😛

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

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 4, 2020, 9:02pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/11 "2020-03-04T21:02:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)
#### Post date: [March 4, 2020, 9:24pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/12 "2020-03-04T21:24:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MrSkeletal](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mrskeletal/32/890_2.png) [@MrSkeletal](https://in-thread.sonic-pi.net/u/MrSkeletal)
#### Post date: [March 4, 2020, 11:10pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/13 "2020-03-04T23:10:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 4, 2020, 11:53pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/14 "2020-03-04T23:53:03Z")

</div>

I’ve opened a PR [here](https://github.com/samaaron/sonic-pi/pull/2274) 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).

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 9, 2020, 2:58pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/15 "2020-03-09T14:58:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)
#### Post date: [March 19, 2020, 11:39am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/16 "2020-03-19T11:39:28Z")

</div>

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

```ruby
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.

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 19, 2020, 2:40pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/17 "2020-03-19T14:40:24Z")

</div>

Oh no ☹  
I’ve added a [comment](https://github.com/samaaron/sonic-pi/issues/2294#issuecomment-601163434) on your github issue, and I’ll look into it myself when I get some time.

---

<div class="post-metadata">

### Author: ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)
#### Post date: [March 19, 2020, 3:15pm UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/18 "2020-03-19T15:15:10Z")

</div>

Thanks emlyn. Needs sorting before 3.2.1 is released.

---

<div class="post-metadata">

### Author: ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)
#### Post date: [March 21, 2020, 1:59am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/19 "2020-03-21T01:59:52Z")

</div>

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](https://github.com/samaaron/sonic-pi/pull/2297) should fix it.

---

<div class="post-metadata">

### Author: ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)
#### Post date: [March 21, 2020, 10:39am UTC](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392/20 "2020-03-21T10:39:22Z")

</div>

Thanks. I’ll try it out later today.

[Next page](https://in-thread.sonic-pi.net/t/did-anything-change-with-the-piano-synthdef-in-3-2/3392.md?page=2)
