image-et-son / p600fw

GliGli based Prophet 600 firmware upgrade
10 stars 4 forks source link

The exponential decay and release curves of the envelopes are considered too short #64

Closed image-et-son closed 2 years ago

image-et-son commented 2 years ago

envelope_decay.xlsx

image-et-son commented 2 years ago

The same graph as above, just with a shorter time scale to better see if there´s maybe also a linear portion at the beginning. But to my eyes it´s a completely exponential shape from beginning to end for CEM3310:

To me also. I can check by matching it. But pretty sure it hasn't got that obvious linear part.

el-folie commented 2 years ago

Haha, it feels like team work in a science lab, it´s great! :)

matrix12x commented 2 years ago

@el-folie To me this graph looks identical to the P600 Exponential curve. (which is good) Per @image-et-son 's comments way above (when I added the function for the CEM3310), when it is scaled correctly, it matches the P600's Expo curve exactly.

Also, here is the .syx using the new table to replace the old table just for testing purposes (I didn't get to test yet): p600firmware.syx.zip

@image-et-son If I am correct, by replacing the table, this would replace slow and fast EXP with the new Linear into Expo curve, accessible by selecting slow and fast exp.

image-et-son commented 2 years ago

Yes

el-folie commented 2 years ago

Thank you for providing the test compile for SSM first test.

Using the new EXP SLO mode I tried to get as close as possible to Starsky´s b-note decay comparison in his video at 02:20.

Audio attached, I think it is quite close, with the Prophet5rev4 SSM at the end still decaying somewhat slower/smoother to zero. Starsky_rev1_decay_match_p600-SSM1_test.zip

matrix12x commented 2 years ago

Here is the graph using Audacity of the note you played above: image

el-folie commented 2 years ago

A more musical audio example, it´s nice how the SSM style linear decay makes for a thicker sound before the release. For demonstration the release phase at the end of audio. SSM1_test_chords_p600firmware.zip

matrix12x commented 2 years ago

I have also been testing it and I really like it. :-) Great work guys.

This "SSM" shape is the envelope that "linear" (P600) should have been. @el-folie good examples.

matrix12x commented 2 years ago

@image-et-son so, assuming this table is cool, I assume we will be adding 2 new env shape options SSM Fast and SSM Slow, instead of replacing linear.

I guess the next steps are modifying ADSR_lookup to have 2 tables (EXP and SSM), update UI.c to include the fast and slow SSM, and tweak synth.c to incorporate this.

image-et-son commented 2 years ago

Thank you for providing the test compile for SSM first test.

Using the new EXP SLO mode I tried to get as close as possible to Starsky´s b-note decay comparison in his video at 02:20.

Audio attached, I think it is quite close, with the Prophet5rev4 SSM at the end still decaying somewhat slower/smoother to zero. Starsky_rev1_decay_match_p600-SSM1_test.zip

I will create one more variant to make it smoother.

el-folie commented 2 years ago

@image-et-son

Great - looking forward to it. 👍

image-et-son commented 2 years ago

Hi, I am not getting the results am aiming for. I found out something which I found irritating: I implemented the third waveform for the next alpha. But testing it I found that all 3 waveforms are killed in the end when I set the speed to "slow". In "fast" they sound fine (rolling off at least smoothly, even if I am not yet totally happy with the SSM variant). I think it has nothing to do with the DEADBAND because 1) it is only present in slow-mode and 2) I found the same behaviour in the decay: the decay drops to below sustain level and then entering the sustain phase the volume goes up a little bit. I have tested this on 2.1 RC3 and it is qualitatively the same. Can you reproduce this? Seems like a bug to me.

matrix12x commented 2 years ago

Oh, this is interesting. I'll have to check it out. I do not recall noticing this in particular.

@image-et-son any chance you could post an audio file and/or an image of a single note the audio?

Also, under Slow, what are your decay and release values (approximately)? e.g., is it anywhere over the knob range, or, for example everything over 50?

image-et-son commented 2 years ago

let me check this again before you invest time. I had a bug in the code, sorry.

el-folie commented 2 years ago

Tested that shortly anyway and couldn´t reproduce it by listening to a high filter sine traveling along a slooow decay transition to the sustain value. Also on volume env Slo EXP no such behaviour here. Hopefully just the bug.

matrix12x commented 2 years ago

I also tested and could not reproduce.

image-et-son commented 2 years ago

Yes, it was MY bug, sorry for the false alarm. I do have that behaviour in the linear shape only (like the cutaway in the linear graphs we have seen. Interestingly I can hear that in the transition from decay to sustain, but maybe that is "psychoacoustics"). What I think now: I have made the roll-off a bit longer and I will do so a little more. I am just amazed on how accurate the human ear is. You can hear that the exponential is cut away linearly at the very end, even through we're talking about really small amplitudes. Nevertheless, I think that the best thing would be replace linear shape completely and to make it the default. One problem is, that I cannot easily calculate the transformation linear --> "new shape" for old patches because the transformation time-pot --> decay time is a complex lookup. I could try to estimate it using a function. Or do you think there will be people who will not accept it? Btw: hat should it be called? I used "hybrid" so far, but that doesn't really have a ring to it...

matrix12x commented 2 years ago

That is good news. I would replace the linear shape completely. I would estimate it using a function.

image-et-son commented 2 years ago

@matrix12x : yes, you suggested it first, that we should replace the existing linear shape. I think the linear shape sounds bad. When I do the rescale (I found that the exact function of the lookup is, again, an exponential, so easy to remap) I am confronted with the fact, that I loose the last 12% of pot range for the linear decay, because the new shape is shorter in the main/linear decay phase (it has to be because I need parts of the lookup for the smooth decay in the end). It seems that I have to remap the entire phase lookup to create the necessary headroom. Otherwise the longest ringing user patches with linear decay will be 3 times shorter in the new OS.

el-folie commented 2 years ago

Just as a general thought from a user perspective:

I always found it to be weird to have seperate "Fast" and "Slow" env modes, I never use fast as slow can be set to fast times too. When I switch on a synthesizer I want to turn a decay knob and expect the short times to be on the left side of the dial and the fast times on the right. A prophet-5 or Jupiter-4, for example, only has one decay knob and it´s enough for every use case. So, to me, I´d rather have a simple but nice sounding choice between SSM or CEM envelopes than having to choose between 10 variants of slopes with fast and slow modes.

I do understand the wish for backwards patch compatibility - whereas I also think that imogen´s OS is such a better OS as a whole due to it´s performance alone that it could be seen as a new upgrade to the gligli OS. And in that I would feel totally satisfied with having only SSM and CEM choices, even without additional slow/fast modes, if the decay and release times are at least as long as on the original machines. But that´s only me and my perspective of course.

So, keeping it nice and simple would be my proposal. (But I know some people love menue diving and that´s okay ;-))

matrix12x commented 2 years ago

@el-folie I think the idea behind fast and slow is resolution. I primarily use the fast EXP envelopes for the types of sounds that I make and I like being able to dial in a precise amount of decay. Although I do agree, I think this is the only synth where I have seen this.

@image-et-son is there anything I can do to help with remapping the phase lookup table? I didn't quite understand the phase lookup and how it works. I originally saw it in the electric druid code that this env code comes from. I tried understanding it back then, but was not 100% sure I got it. https://electricdruid.net/voltage-controlled-adsr-envelope-generator-vc-adsr-7b/

el-folie commented 2 years ago

@matrix12x: Yeah, of course, it´s only user preference on my side for simple, fast, easy solutions. I can totally understand and embrace the need for more options...

el-folie commented 2 years ago

I still feel/hear the LIN shape after saturation of the curve to be falling to zero too linear/fast. Would it be possible to let the second halve of the shape (after saturation) sound more like an exponential release? (That´s what I hear on the P5rev4 in Starsky´s Video)

image-et-son commented 2 years ago

The second half is an exponential. But I fit it to the slope of the linear part and that determines how fast it drops. I need a different function for a different behaviour, though. Interesting. BTW: the saturation point will determine at what level the ring out will be. Is that OK for you, e.g. only the speed of vol drop is too fast, but the level is OK?

el-folie commented 2 years ago

Yes exactly, level ok, just too fast dropping to silence at the end, it just sounds like a cut off at the very end instead of like a long reverb would decay. The P5rev4 sounds more like a decaying reverb at the end to my ears, extremely smooth and airy.

image-et-son commented 2 years ago

I think that compared to the old linear shape it is already rolling off nicely. And it did some arpeggios with it with short sounds, which felt good. It think in that range it makes a real difference. But I want to get it right. So just to make sure we're talking about the same effects I have yet another plot. The orange line is our new curve. I have three regimes: 1) before saturation, 2) between saturation and cut-off and 3) after cut-off (cut-off is needed in software lookup envelopes). I have scaled the whole thing so that I think you cannot hear the cut-off as it's already too quiet, right? Then your observation is in my interpretation that the drop in the second phase is too strong. You can see log plot in blue with the scale on the left. Humans perceive that logarithmically. It's a straight line (= the curve is exponential) and this would need to be flatter.

image

el-folie commented 2 years ago

You are right with everything! The first part sounds absolutely beautiful, no question! Just the drop from the second phase too fast reaches zero. But you know what? I compared to EXP SLO and it drops too fast too at the very end. So, no wonder I thought there´s something missing, because it´s missing in both shapes still and I never listened closely enough until now, my bad! What I think/hear to be still missing is the behaviour of a discharging capacitor, that gets extremely exponential at the very end of discharging, like almost never reaching zero. With two oscillators detuned this extremely exponential ending phase makes for that sweet sounding airy decay.

I tried to modify the graph to show what I mean, not taking into account the cutoff point of course, my ears are listening through that point in time on the graph to achieve the airy decay: modded graph for 'airy' decay

image-et-son commented 2 years ago

Hi el-folie, please find enclosed the syx for a special envelope testing version. It has: on "LIN": my revision 4 of the envelope curve which is intended for alpha 12 and - for direct testing purposes - on "EXP the same shape but rescaled (shorter) so that the lookup table has more space to model the exponential fade out. To compare the two 1:1 you need to make "EXP" a little longer. I would like to know: do you hear the difference at the very end? And if so, how much is it worth? Generally are we getting closer to what you'd expect?

p600firmware_alpha_env_special_20220116.zip

The best would be to throw away that version afterwards as it is for tests only, misusing the exp shape option to that end.

el-folie commented 2 years ago

Wow, thanks! Will test and report back...

el-folie commented 2 years ago

Okay, did a few comparisons with Repro and the sound "in my head". The new LIN shape is a tiny bit slower dropping to zero and def better than the old LIN but still not as sweet sounding as Repro5, which of course has exponential shape (and is still lacking at behaving like a discharging capacitor, the ending phase to zero is just not decaying long enough).

Audio file of comparing similar decay times of 1. P600_new_LIN_shape, then 2. Repro5 decay.

For the sound in my head (like a discharging cap) I´d need to prolong the decay time on LIN shape, like in the last phase, shortly before reaching zero I´d turn the decay knob slowly but steadily to the right to prolong the decay until finally reaching zero. And reaching zero would not be like a sudden drop but dissolving to nothingness like a long lush Lexicon reverb.

I´l see if I can record something like that from other synths I have and report back.

In short: The new LIN shape def IS better than the old LIN shape, but there´s still room for improvement.

P600_experimental-LIN-decay_vs_Repro5_EXP.zip

el-folie commented 2 years ago

Important: It´s actually the release time I tested for shape comparisons, so I hope decay and release shapes are the same on the LIN_experimental_shape. Sorry, forgot to say this.

Here is a comparison between P600-new_LIN_shape and SH-101 EXP shape. Left-Right recording to concentrate on each one after another. At the very end one can hear how smoothly the SH-101 drops to zero. Are we maybe just reaching the end of resolution for the P600 envelope tables?

Left-P600_experimental-LIN-decay_vs_Right-SH-101_EXP_decay.zip

(Also, the SH-101 shows its brutal thick short "attack max level hold time", even with attack/decay on zero and sustain all up. That´s the reason for issue #65)

matrix12x commented 2 years ago

Here is the (top) P600 left channel in line with the SH-101 right channel (bottom), both from the above audio file provided by @el-folie :

image

el-folie commented 2 years ago

Thanks Matrix12x, looking great! I´m aware we´re talking about minute but still perceivable details of beauty here. ;-)

el-folie commented 2 years ago

Added some info to the graph for explanation: 149665479-d41de829-f415-460c-ad5c-49514ede102c

matrix12x commented 2 years ago

I ended up lining them up mostly because I could not hear too much of a difference in the fade out. I think I have bludgeoned my ear with too much industrial music and heavy metal over the years. lol I think the visual helps.

Looking at the tail at a huge zoom in Audacity, the SH101's tail is slightly larger amplitude as it fades. But the P600 definitely does not drop to zero suddenly, it just fades slightly faster.

image-et-son commented 2 years ago

Hi, in the "special envelope testing" version above, I implemented a LIN shape under the EXP option with an extended resolution. Technically it is very important for me to know if you hear a difference between LIN and EXP in that version!? The reason is, if it is about resolution I need to do another rescaling. So at least I will be able to make a decision either way. (ONLY: the exp option is shorter but the same shape).

el-folie commented 2 years ago

Okay, back to listening!

el-folie commented 2 years ago

Okay, I did this test to compare to the "extended resolution under the EXP shape":

First note is decay of experimental_LIN shape at value 62. (Finger stays on key) Second note is release of "extended resolution LIN" under EXP shape at value 66. (Finger released after key press) The values needed to be different to approximate the decay to the release length.

Result: I don´t hear much if any difference at all concerning the dropping to zero behaviour (listening with headphones).

decay_value62_experimental LIN-SLO vs. release_value66_EXP-SLO.wav.zip

matrix12x commented 2 years ago

First note (top LIN) second note (bottom EXP) image

el-folie commented 2 years ago

Looking quite identical to me... like my ears told me ;-)

matrix12x commented 2 years ago

me too.

image-et-son commented 2 years ago

Good, so it's not about resolution in the end phase. Thanks for listening.

el-folie commented 2 years ago

Of course - glad to help.

image-et-son commented 2 years ago

OK, another check. What I did: I made the master tune button adjust the DEADBAND offset of the VCA. But iteratively adjusting just right I ended up just a little above the GliGli value of 768 on mine, concretely: 771. May also depend on instrument. But I found that is make a big difference in the very end of the tail. Can you check to see if I'm just getting carried away? Test firmware below. The exp decay is the correct one again, that test is concluded.

p600firmware_alpha_env_special_20220116_2.zip

It could be that in your instrument another value is better. If the value is too high then you get the sudden drop. If it is too low then the tail turns out a little shorter than intended,

el-folie commented 2 years ago

You mean that this OS version exactly calibrates the deadband on every P600 to its best offset? That´d be like a "holy cow" moment to me ;-) Or did you figure out a better deadband offset by testing it out?

Anyway, did a new comparison with EXP-SLO shape vs. my old and trusty SH-101, release times matched, panned L-R again to also hear the volume L-R traveling for hearing the difference in the slope. To my ears in this audio file the SH-101 still drops more smoothly down to zero. But maybe it´s really dependent on the deadband offset and my P600 may need a different one?!?

L-P600-R-SH101_release_comparison.zip

When I listen to the left channel only and at the end raise the volume to my headphones to max I can clearly hear the fast drop to zero for the P600. On the other hand, the SH-101 drops more slowly and smoothly before the level is buried by noise and mains hum.

el-folie commented 2 years ago

Another question: Does the VCA deadband rely on the exact DAC gain 4.9v calibration point? I definitely fine-tuned the DAC afterwards to get exactly 0-99 from all knobs, instead of only 0-98 on some knobs before, maybe that also influences the deadband offset?

matrix12x commented 2 years ago

The tune button sent my P600 to hell. lol. I had this happen once before. I had to refresh 2.0 by hex, Tune, then I could update to sone of the newer ones via .syx.

OK, I'm tuned and back for more testing....

image-et-son commented 2 years ago

And I just had the condition you described a few days back, when the PWM pot did nothing at >50 and the sound was strange...

image-et-son commented 2 years ago

Another question: Does the VCA deadband rely on the exact DAC gain 4.9v calibration point? I definitely fine-tuned the DAC afterwards to get exactly 0-99 from all knobs, instead of only 0-98 on some knobs before, maybe that also influences the deadband offset?

I guess the voltage that comes out as a result of the offset depends on the operation voltage. What I can say is, that I did a very careful calibration, always listening to the fade out below and above to find the right spot, then narrowed down the range of the pot and compiled again until I was only deciding between two values. And I can say that in my case it makes the difference between hearing a decisive end of the tone vs. hearing it fading away to the point where I can no longer tell if it's there or not.

el-folie commented 2 years ago

Thank you - then I will experiment with the DAC gain a bit and see what comes out after calibration concering deadband offset/envelope decay shortly before zero. Maybe my machine or the 3160D chips just need a different voltage setup.