Help me w/ maths for decelerating attack curves + predicting durations, i.e. I am noob and what curve is this, how it relates to a basal dBU/s 
Help me w/ maths for decelerating attack curves + predicting durations, i.e. I am noob and what curve is this, how it relates to a basal dBU/s 
Apr 29 2013, 12:42
Post
#1


Group: Super Moderator Posts: 5275 Joined: 23June 06 Member No.: 32180 
Preface: As tends to happen whenever I start writing, this got out of control quite quickly. I’m going to refrain from deleting much lest I make my core thoughts even more difficult to follow, but I’ve emboldened what I think are my key points – if I can be said to have any at all…
I’ve started quantifying parameters of a hardware synthesiser for reference and comparison, and just maybe the future design of an emulator. What is baking my brain is the attack phase of the envelope. Decay was easy to quantify and proceeds by a constant number of dBU/s that scales exponentially with the rate chosen; in other words, decay is linear on a scale of dBU. Attack, on the other hand, is apparently modelled on observations that natural instruments often have exponential attacks. Accordingly, attack is claimed to follow an inverted version of the decay curve but multiplied by a factor that depends upon the instantaneous distance between (current level) and (target level). In other words, on a logarithmic scale, the curve initially rises quite steeply but then progressively becomes shallower as the level approaches its final value. My lack of skill with mathematics probably means I’m confusing things with a lot of vague descriptions and inconsistent/misnamed terminology, but I did manage to mess around enough to obtain something that resembles the curve I’m talking about. It looks like this: CODE y = x * (1 + (1  x)) Which gives this:0 <= x <= 1 0 <= y <= 1 Which looks similar enough, at least for now, to the curve formed by the amplitude of the attacking waveform when the latter is viewed on a logarithmic scale. This is probably some bogstandard type of curve/formula/relationship, but my novice Googlin’ didn’t reveal anything except the logarithmic curve, which seems to decelerate more slowly and asymptotically, rather than finally reaching 1 as this formula does. I presume this formula, or perhaps its more conventional representation if there is one, can easily be adapted for differing scales of the variables on both axes. At the moment, I’m most interested in predicting the mean rate of amplification and hence the duration. This would be more immediately useful for reference and, probably, would also be beneficial for later attempts to model the curve accurately. Perhaps predicting the mean dB/s specifically requires such a model, which is where these questions come in! So, as I confess to not being mathematically minded at all (at least that I’m aware), I need advice from those who are. Given that the curve representing the attack is likely to be a transformation of decay, which is based on some multiplication of the decay rate with deceleration as (current level) approaches (final level), is there a way to calculate a factor by which (mean rate of decelerating attack over a given range of dBU) will = (some mystical factor) × (measured rate of linear decay)? Maybe it’s as simple as substituting in the relevant starting and finishing values on the yaxis and deriving from there, but I’m already out of my depth as it stands, as you can probably tell. Or does deriving the mean change in dBU between any given pair of points (also in dBU) require consideration of the entire curve, e.g. calculus or something baffling like that? My tests so far suggest that, unlike with the decay, the distance in dBU between (starting level) and (final level) factors into the rate of attack. I can’t see any obvious relationship in the numbers between (distance in dB) and (factor by which to multiply the corresponding rate of decay), at least to a mathematical layman such as myself. I guess the bulk of my question is – assuming the rate of a decelerating curve can be converted to a mean value, which is a proposition I can’t possibly evaluate as a novice – how/whether the (hypothetical) mean rate of increase can be derived from the defined distance in dBU, given the basal unit of change in amplitude per second of the decay. Excuse the lack of specifics, but I’m proceeding on the basis, or just hope, that the relationship is based solely upon the shape of the curve (yet to be confirmed) and the basal unit of dB/s (from the decay of the ‘same’ [but, obviously, actually not] rate), so I presumed a tonne of measurements in seconds would not be useful here. Summary: Assuming the attack is vaguely reminiscent of a decelerating curve like the above (the hardware probably approximates it in a peculiar way, if previous findings are anything to go by), is there a way to calculate the factor by which it relates to the underlying linear decay upon which it is apparently based? In other words (I think ), I want to be able to calculate the mean rate of attack that corresponds to a given rate of decay (and hence the duration of said attack phase, etc.). Thanks a lot to anyone who has the mental power and/or masochism to have read this far! Guidance for a hopeless nonmathematician will be greatly appreciated. This post has been edited by db1989: Apr 29 2013, 14:04 


May 2 2013, 17:31
Post
#2


Group: Super Moderator Posts: 5275 Joined: 23June 06 Member No.: 32180 
I would love to try to help, but I'm having a very hard time understanding your problem. You are talking about this https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope, correct? Decay and attack can be set to values in the same range, and there are indications elsewhere (from similar but not equivalent synths) that the rate of attack is a transformation of the rate of decay. I’ve pretty much characterised the rate of decay, which was fairly trivial, although I haven’t worked out the underlying logic (yet?). Anyway, decay is a linear decrease on a logarithmic scale (i.e. always n dBU/s), whereas an attack of the corresponding setting is supposedly based upon the rate for the equivalent decay but starting out more rapidly and then decelerating. So, the rate for the decay is multiplied by some high factor to begin with, then that factor decreases as the level approaches the final level (which isn’t constrained to 0 dBU).Your question seems to concern the attack part, but then you mention decay. In what way are those two related? Do you set the decay on the synth and it automatically sets the attack? Are they connected by some ratio? I'm aware of the first statement in bold, but I can't make sense of it, mainly due to relationship to the decay. QUOTE The rest sort of sounds like you are describing a linear differential equation... the solution to which involves exponential functions. I thought something like that might provide a usable means to estimate the duration, if not the underlying mechanism, but as I mentioned in my last post, it seems to work less smoothly than that.QUOTE Is any of this helping you at all? That’s fine: this one is digital. P.S.: note that I have no idea of the actual inner workings of classic analog synthesizers. Just take the derivative It might work as a basis of estimation, at least. Of course, the overall shape and time of the attack depend upon the nominal rate, the distance between the starting and ending levels, and the particular range of steps by which the rate is scaled over specific portions of the attacking distance.[…] Hope that helps! I think this is a bit beyond me at the moment… I started out just wanting to compile a table of durations in seconds, but that was painstaking and boring (maybe there’s an editor that can somewhat automate things like this; I don’t know), and I would inevitably end up wanting to have a more accurate—and fast!—way of doing things. Plus, an unrealistic part of me wants to start writing an emulator… :S Haha. is K( 1  e ^ (at)) the function you were looking for? I have no idea! What does that do? I can speculate about the curve slightly, but not much without knowing the identities of the variables. Thanks anyway, I guess. Thanks to everyone who replied. I guess I might need to do more boring recording and measuring, heh. 


May 7 2013, 19:25
Post
#3


Group: Members Posts: 1418 Joined: 9January 05 From: In the kitchen Member No.: 18957 
is K( 1  e ^ (at)) the function you were looking for? I have no idea! What does that do? I can speculate about the curve slightly, but not much without knowing the identities of the variables. Thanks anyway, I guess. Thanks to everyone who replied. I guess I might need to do more boring recording and measuring, heh. K is gain constant. A is a positive number. t is time. e is, well, 'e'. I would suggest you plot it. If you're doing this kind of work, you need to be very familiar with that particular function, it is the natural attack envelope function of a resonant system.  
J. D. (jj) Johnston 


LoFi Version  Time is now: 30th March 2015  01:42 