--
--
You received this message because you are subscribed to the Google
Groups "music-synthesizer-for-android" group.
To post to this group, send email to
music-synthesi...@googlegroups.com
To unsubscribe from this group, send email to
music-synthesizer-fo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/music-synthesizer-for-android?hl=en
Or visit the project homepage at http://code.google.com/p/music-synthesizer-for-android/
---
You received this message because you are subscribed to the Google Groups "music-synthesizer-for-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to music-synthesizer-fo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Dear Raph,
thanks for your reply.
i am still confusing, i have read the article https://code.google.com/p/music-synthesizer-for-android/wiki/Dx7Envelope and seen the program at the wiki.
is it possible to make a chat with you (when you have a free time) so i can ask you directly?
thanks,
Ali
Have you read the description at https://code.google.com/p/music-synthesizer-for-android/wiki/Dx7Envelope ?That also contains a pointer to a JavaScript emulation http://wiki.music-synthesizer-for-android.googlecode.com/git/img/env.html . The code is not that complicated, so if you're comfortable reading that, it should tell you everything you want to know.But let me try to give you a quick answer. The output level is in units of .75db (8 units is one doubling of level = 6dB). This is strictly true for output levels >= 20, and for values less than that there is a nonlinear curve (this is var outputlevel = [...] in the JS source) with a more rapid falloff (thus, level 0 is -95.5dB from level 99, where with a linear curve it would be 74.5dB). Another detail is that levels L1...L4 (as opposed to output level) are actually quantized to steps of 1.5dB. This helps the post-lut levels fit in 6 bits.The rates are in terms of dB/s - so the amount of time that it takes is proportional to the dB level difference between L_i and L_(i+1). The exact formula is in the wiki page, but a passable approximation is 0.2819 * 2^(rate * 0.16) dB/s. So a rate of 0 is 0.2819dB/s, meaning that it takes about 10 minutes to decay from full to minimum level. A rate of 99 is 16165dB/s, meaning that it takes about 6ms. (Note: I need to update the equation in the wiki to 0.2819, the old version said 0.014095 which is off by a factor of 20.)Attacks are faster than decays, and have a nonlinear curve (again, explained precisely but tersely on the wiki, and easy to visualize).Plugging in your data, L2 is 14.25dB down from L1, and L3 is 18.75 dB from L1. It will reach L3 (the sustain level) in 495 samples, almost exactly 10ms. Then, after key-up it will take about 43 seconds for your note to go entirely silent (76dB at 1.75dB/s).I hope this answers your questions.Raph
On Wed, May 8, 2013 at 11:00 AM, <ali.al...@kommunikationstechnik.org> wrote:
Dear All,i am new with this topic. I have a question regarding the dx7 Yamaha.my question is: what is the relation between the output level operator and the envelope generator levels (L1, L2, L3, L4)? for example if the output levet is 99 and the envelope generator is L1= 99, L2=80, L3=74, L4=0, what is the actual output level? there is any equation for that?the second question is about the Envelope rates(R1,R2,R3,R4), for example if R1= 99,R2=84,R3=74,R4=20, how can i calculate the time in second form the attack to the release stage?thanks in advance,Ali--
--
You received this message because you are subscribed to the Google
Groups "music-synthesizer-for-android" group.
To post to this group, send email to
music-synthesi...@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/music-synthesizer-for-android?hl=en
Or visit the project homepage at http://code.google.com/p/music-synthesizer-for-android/
---
You received this message because you are subscribed to the Google Groups "music-synthesizer-for-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to music-synthesizer-for-android+unsub...@googlegroups.com.
Dear Raph,okay, i just want to get the answer faster because i am a new at this field and have many questions.I appreciate if you can help me. Thanks in advance,
A. Regarding the JavaScript program:1. what is the frequency sampling? ist it like in yamaha dx7 (fs= 60 KHz)?
B. Regarding the description at https://code.google.com/p/music-synthesizer-for-android/wiki/Dx7Envelope :1. The conversion from level parameter (L1, L2, L3, L4 in the patch) to actual level is as follows:Level 0..5 -> actual level = 2 * lLevel 5..16 -> actual level = 5 + lLevel 17..20 -> actual level = 4 + lLevel 20..99 -> actual level = 14 + (l >> 1)what is this symbol "l" mean? is it the envelope level for example 99.2. the total level is 64 * actual level + 32 * output level, and this total level is in units of approx 0.0235 dB.- is it mean that i multiply the total level by 0.0235 to get the result at dB?- for example if the total level is 120 than it will 120*0.0235 in dB?- the total level means the result of the interaction between the output level and the envelop level, is that correct?- for example during the attack time, the level is 80 and the output level is 90, what is the result of the total level?
3. From measurement of timing, the minimum level seems to be clipped at 3824 counts from full scale -> 14.9375 doublings. Note, however, that velocity values > 100 can cause amplitudes greater than full scale. Full scale means both L and output level set to 99 in the patch, and no additional scaling.- what are these numbers stands for "3824", "14.9375 doublings" , "velocity values > 100" ?- i did not understand, what is the relation between these numbers and how you are calculated these numbers?
4. As mentioned above, the decay shape is simpler than the attack. An exponential decay corresponds to a linear change in dB units. First, the R parameter in the patch (range 0..99) is converted to a 6 bit value (0..63), by the formula qrate = (rate * 41) / 64. The rate of decay is then 0.014095 * 2(qrate / 4) * (1 + 0.25 * (qrate mod 4)) dB/s. This is a reasaonably good approximation to 0.014 * 2(qrate *0.25).- the rate of decay is calculated by: qrate = rate*0.6406, rate of decay= .014 * 2(qrate *0.25) . is that correct?- what is the 6 bit value ?
5. Attack is based on decay, multiplying it by a factor dependent on the current level. In .0235 dB units, this factor is 2 + floor((full scale - current level) / 256). Also, level immediately rises to 39.98 dB (1700 steps) above the minimum level, which helps create a crisper attack.- do you mean the rate of attack at this paragraph?- factor = 2 + floor((full scale - current level) / 256), what are the full scale, current level? ist ist full scale = 99, and the current scale for example 70?
- how these numbers ( 39.98 dB (1700 steps) ) are calculated ?
- what do you mean "Attack is based on decay, multiplying it by a factor dependent on the current level" ? ist ist the rate of attack = factor * current attack rate.
- this number ".0235 dB", where can i use it?- what about the rate of sustain and release, how are they calculated?
6. The output level is computed once, at the beginning of the note, and affects both the overall amplitude of the operator and also the timing. In addition to the "output level" setting in the patch, output level is also affected by velocity and scaling. The output level in the patch is in the range 0..99, and this is scaled in units of 0.7526 dB (ie 32 steps).- for example if the output level = 90, then i will multiply it with 0.7526 dB to convert to the dB scale, output level in dB = 90* 0.7526;- what do you mean by this number "32 steps", how do you calculated?
7. Careful measurement of the DX7 reveals quite rich detail on how envelopes are actually computed. Clearly the resolution for amplitude is .0235 dB, and there are 12 bits total (for a maximum dynamic range of 72.25 dB).- what is the relation between "resolution for amplitude is .0235 dB" and the "12 bits" and the "maximum dynamic range of 72.25 dB"?- how the "maximum dynamic range of 72.25 dB" is has been caculated?
8. At a qrate of 0, the amplitude decreases by one step every 4096 samples, in other words halves every 220 samples. Each increase of 4 doubles the clock rate. Careful examination reveals that fractional multiples of qrate (ie qrate is not a multiple of 4) are clocked out using a pattern:- do you speak about the decay rate? if that is correct, what is the relation with step number 4 (it is also speaks about the rate of decay)? which one i need to use to calculate the decay rate?
- how is the amplitude decreases by one step every 4096 samples if the qrate = 0 ?, what is halves every 220 samples?
- what is "clock rate", is it equal R2?- could you please explain the last paragraph? can you give example?9. For attacks, instead of decrementing by 1, the factor is added (thus, no actual multiplication is needed). When the clock rate increases to the point where the increment would be needed more than once per sample clock (ie for qrate >= 48), the increment value is shifted left by (qrate / 4) - 11 instead, and the increment (masked by the bit pattern above) is applied every single sample clock.- what is relation between number 8 and number 5? which one i need to use to calculate the attack rate- is the clock rate = R1?- what do you mean by " the point where the increment would be needed more than once per sample clock" ?- increment value is shifted left by (qrate / 4) - 11 instead, and the increment (masked by the bit pattern above) is applied every single sample clock, what is this? can give example?
C- Regarding your email:1. The output level is in units of .75db (8 units is one doubling of level = 6dB). This is strictly true for output levels >= 20, and for values less than that there is a nonlinear curve (this is var outputlevel = [...] in the JS source) with a more rapid falloff (thus, level 0 is -95.5dB from level 99, where with a linear curve it would be 74.5dB). Another detail is that levels L1...L4 (as opposed to output level) are actually quantized to steps of 1.5dB. This helps the post-lut levels fit in 6 bits.- are you using the follwoing information to calculate the output level:Level 0..5 -> actual level = 2 * lLevel 5..16 -> actual level = 5 + lLevel 17..20 -> actual level = 4 + lLevel 20..99 -> actual level = 14 + (l >> 1)
- do you mean that "Level 0..5 -> actual level = 2 * l, Level 5..16 -> actual level = 5 + l, Level 17..20 -> actual level = 4 + l " are nonlinear curveand "Level 20..99 -> actual level = 14 + (l >> 1) " is linear curve?
- if output level = 99, then it will equal to 99 * 0.75 = 74.2500 dB, ist that correct? it is almost equal to 74.5dB.
- how do calculate the "level 0 is -95.5dB from level 99"?
- what do you mean by "levels L1...L4 (as opposed to output level) are actually quantized to steps of 1.5dB" ? can you give example? how is it reduced by a step of 1.5 dB?- This helps the post-lut levels fit in 6 bits, what is "post-lut" and how it can be fit in 6 bit?
2. The rates are in terms of dB/s - so the amount of time that it takes is proportional to the dB level difference between L_i and L_(i+1). The exact formula is in the wiki page, but a passable approximation is 0.2819 * 2^(rate * 0.16) dB/s. So a rate of 0 is 0.2819dB/s, meaning that it takes about 10 minutes to decay from full to minimum level. A rate of 99 is 16165dB/s, meaning that it takes about 6ms. (Note: I need to update the equation in the wiki to 0.2819, the old version said 0.014095 which is off by a factor of 20.)- which equation i will use "0.2819 * 2^(rate * 0.16)" or i will use last step 4 & 5 at B section?
- how is the "10 minutes to decay from full (99) to minimum level (0)" calculated?- how is the "6 ms to decay from full (99) to minimum level (0)" calculated?
3. Attacks are faster than decays, and have a nonlinear curve (again, explained precisely but tersely on the wiki, and easy to visualize).can you please give an example?
4. Plugging in your data, L2 is 14.25dB down from L1, and L3 is 18.75 dB from L1. It will reach L3 (the sustain level) in 495 samples, almost exactly 10ms. Then, after key-up it will take about 43 seconds for your note to go entirely silent (76dB at 1.75dB/s).i hope after answering all the question, i will understand how you have calculated the above values?
thanks in advance,Ali
2013/5/10 Raph Levien <ra...@google.com>Actually I'd prefer to answer in email - part of my goal is to create a record of this for the open source community.Raph
For more options, visit this group at
http://groups.google.com/group/music-synthesizer-for-android?hl=en
Or visit the project homepage at http://code.google.com/p/music-synthesizer-for-android/
---
You received this message because you are subscribed to the Google Groups "music-synthesizer-for-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to music-synthesizer-fo...@googlegroups.com.
Dear Raph,
Thanks a lot for your help. It is very helpful.
I just want to be sure that I have understood everything because I could not get the same result for same of them ( L2 is 14.25dB down from L1, and L3 is 18.75 dB from L1. It will reach L3 (the sustain level) in 495 samples, almost exactly 10ms. Then, after key-up it will take about 43 seconds for your note to go entirely silent (76dB at 1.75dB/s).) . So please could you check my calculation for the following example?
With my regardss,
Ali
Ex1:
Output level = 99;
Envelope generator levels;
L1= 99, L2=80, L3=74, L4=0;
Envelope Generator Rates:
R1=99, R2=84, R3=74, R4=20;
What is the difference between A and B sections?
A. A. Total level
Total level = 64*actual level+ 32*output level;
For level ( 0 to 5), actual level = 2* level;
For level ( 0 to 16), actual level = 5+ level;
For level ( 17 to 20), actual level = 4+ level;
For level ( 20 to 99), actual level = 14 + floor(level/2);
I have question: why we need to add 28 to output level (99+28)? Why we not use the output level directly (99)?
Max Total level = 8096
Total level (during the attack) = 64*(14+(99/2)) + 32*(99+28) = 64*63+4064 = 8096
- The reduction at dB down from 0 = (8096 – MAX) * 0.0235 = 0;
- What about the increase at dB, is there any equation?
- Can I say: increase at dB = (8096 – 0) * 0.0235 = 190.2560; I put zero because it starts with zero. Is this correct?
Total level (during the decay) = 64*(14+(80/2)) + 32*(99+28) = 64*54+4064 = 7520
- The reduction at dB down from the attack= (8096 – 7520) * 0.0235 = 13.5360;
Total level (during the sustain) = 64*(14+(74/2)) + 32*(99+28) = 64*37+4064 = 7328
- The reduction at dB down from the decay = (7520 – 7328) * 0.0235 = 4.5120;
Total level (during the release) = 64*(2*0) + 32*(99+28) = 64*0+4064 = 4064
- The reduction at dB down from the sustain= (7328– 4960) * 0.0235 = 55.6480;
I will use the result form section C.
The attack time = 190.2560/ Attack rate. I could not calculate the attack rate, please see section C.
The time from L1 to L2 = 13.5360/3.1328e+03 = 0.0043 second
The time from L2 to L3 = 4.5120/1.0335e+03 = 0.0044 second
The time after the key is up until silent = 55.6480/2.5905 = 21.4816second
B. B. Envelope
B.1 Envelop level
Why we need to convert the level from ( from 0 to 99) to (from 127 to 0)?
- Increased at dB from 0 (L4) to L1 (during the attack) = (127 - 0) * 32*0.0235 = 95.5040
- Reduction at dB down from L1 to L2 (during the decay) = (19 - 0) * 32*0.0235 = 14.2880
- Reduction at dB down from L2 to L3 (during the sustain) = (25 – 19) * 32*0.0235 = 4.5120
- Reduction at dB down from L3 to L4 (during the release) = (127 - 25) * 32*0.0235 = 76.7040
B.2 Envelop Rates
1. Attack rate = decay rate * factor
Decay rate = 0.2819*(2^(rate*0.16)) = 0.2819*(2^(99*0.16)) = 1.6535e+04
Factor = 2+floor((full scale – current level)/265)
-What is the full scale? Is the current level = L1? Could you please calculate the factor for this case?
So the Attack rate = 1.6535e+04 * factor
And the attack time = 95.5040/ Attack rate.
2. Decay rate for the R2= 0.2819*(2^(84*0.16)) = 3.1328e+03;
The time from L1 to L2 = 14.2880/3.1328e+03 = 0.0046 second
3. sustain rate for the R3= 0.2819*(2^(74*0.16)) = 1.0335e+03
The time from L2 to L3 = 4.5120/1.0335e+03= 0.0044 second
4. release rate for the R4= 0.2819*(2^(20*0.16)) = 2.5905
The time after the key is up until silent = 76.7040/2.5905= 29.6097 second
Ex2:
Output level = 65;
Envelope generator levels;
L1= 99, L2=80, L3=74, L4=0;
Envelope Generator Rates:
R1=99, R2=84, R3=74, R4=20;
For example 2, the results for section B and C are same as the example 1, is this correct?
Only section A, the result is changed because the output level is changed, is this correct?
Dear Raph,
Thanks a lot for your help. It is very helpful.
I just want to be sure that I have understood everything because I could not get the same result for same of them ( L2 is 14.25dB down from L1, and L3 is 18.75 dB from L1. It will reach L3 (the sustain level) in 495 samples, almost exactly 10ms. Then, after key-up it will take about 43 seconds for your note to go entirely silent (76dB at 1.75dB/s).) . So please could you check my calculation for the following example?
With my regardss,
Ali
Ex1:
Output level = 99;
Envelope generator levels;
L1= 99, L2=80, L3=74, L4=0;
Envelope Generator Rates:
R1=99, R2=84, R3=74, R4=20;
What is the difference between A and B sections?
A. A. Total level
Total level = 64*actual level+ 32*output level;
For level ( 0 to 5), actual level = 2* level;
For level ( 0 to 16), actual level = 5+ level;
For level ( 17 to 20), actual level = 4+ level;
For level ( 20 to 99), actual level = 14 + floor(level/2);
I have question: why we need to add 28 to output level (99+28)? Why we not use the output level directly (99)?
Max Total level = 8096
Total level (during the attack) = 64*(14+(99/2)) + 32*(99+28) = 64*63+4064 = 8096
- The reduction at dB down from 0 = (8096 – MAX) * 0.0235 = 0;
- What about the increase at dB, is there any equation?
- Can I say: increase at dB = (8096 – 0) * 0.0235 = 190.2560; I put zero because it starts with zero. Is this correct?
Total level (during the decay) = 64*(14+(80/2)) + 32*(99+28) = 64*54+4064 = 7520
- The reduction at dB down from the attack= (8096 – 7520) * 0.0235 = 13.5360;
Total level (during the sustain) = 64*(14+(74/2)) + 32*(99+28) = 64*37+4064 = 7328
- The reduction at dB down from the decay = (7520 – 7328) * 0.0235 = 4.5120;
Total level (during the release) = 64*(2*0) + 32*(99+28) = 64*0+4064 = 4064
- The reduction at dB down from the sustain= (7328– 4960) * 0.0235 = 55.6480;
I will use the result form section C.
The attack time = 190.2560/ Attack rate. I could not calculate the attack rate, please see section C.
The time from L1 to L2 = 13.5360/3.1328e+03 = 0.0043 second
The time from L2 to L3 = 4.5120/1.0335e+03 = 0.0044 second
The time after the key is up until silent = 55.6480/2.5905 = 21.4816second
B. B. Envelope
B.1 Envelop level
Why we need to convert the level from ( from 0 to 99) to (from 127 to 0)?
Dear Raph,
Thanks a lot for your reply. It was very helpful.
You have recommended me to use the Javascript code linked from the wiki. I am using this program (interactive JavaScript), but can I get the code so I will understand it better because I will see the actuale calculation.
You have missed three questions, could you please answer them? May be these question is simple, I am confusing and I want to be sure that I understand it well.
1. At the beginning of example 1, I asked: What is the difference between A and B sections? Or what is the relation between section A and B?
Section A is about Total level and Total level time or Total level Rate.
Section B is about Envelope level and Envelope Rate.
What is the difference or the relation between the Total level (A) and Envelope level (B)?
What is the difference or the relation between the Total level time (A) or Total level Rate and Envelope Rate (B)?
2. At example 1, section B.2:
Attack rate = decay rate * factor
Decay rate = 0.2819*(2^(rate*0.16)) = 0.2819*(2^(99*0.16)) = 1.6535e+04
Factor = 2+floor((full scale – current level)/265)
- What is the full scale? Is the current level = L1 (attack level)? Could you please calculate the factor for this case?
So the Attack rate = 1.6535e+04 * factor
And the attack time = 95.5040/ Attack rate.
3. For example 2:
The results for Envelope level and Rates are same as the example 1 section B, is this correct?
The result for the Total level are different from example 1 section A because the output level for example 2 has been changed, is this correct?
Dear Raph,
If I have a cine wave signal and the Peak amplitude is 225 mv and the energy at the dB = -2.9563 dbm.
U = 225e-3 volt ; R = 50 ohm;
Energy at db = 10*log10( ((U/sqrt(2))^2/R) / 1e-3)= -2.9563 dBm.
What will happen when i apply the following the last example (ex.1):
Output level = 99;
Envelope generator levels;
L1= 99, L2=80, L3=74, L4=0;
Envelope Generator Rates:
R1=99, R2=84, R3=74, R4=20;
Thanks in advance,
Ali