Page 2 of 2

Re: Some beginner questions concerning YM2612

Posted: Mon Apr 29, 2019 2:15 am
by TmEE co.(TM)
Most of the info is found in this post and this thread in general : viewtopic.php?p=5716#p5716

Re: Some beginner questions concerning YM2612

Posted: Mon Apr 29, 2019 8:53 am
by tryphon
THANK YOU !

I knew this thread, but since it's very technical (and, as I said before, I have absolutely no knowledge in music nor FM synthesis - and generally speaking very few when it comes to hardware), I progressed slowly in reading it and hadn't come to this post. I have to digest all the informations, but it seems to answer most of my questions about Envelope (envelop? enveloppe ?) Generator !

Re: Some beginner questions concerning YM2612

Posted: Wed May 01, 2019 8:35 am
by tryphon
Something I can't find in the above thread (but it may have overlooked it) :

In the Envelop Generator, how is the attenuation initialized in the attack phase ?

is it 1023 ? if so it means that if TL isn't 0 dB (maximal volume), then operator will remain silent for some time ?

or is it initialized at TL ?

Re: Some beginner questions concerning YM2612

Posted: Wed May 01, 2019 8:46 am
by TmEE co.(TM)
There is no initialization, the attack begins wherever last state left off. Only way to get maximum attenuation is to wait out the envelope, using fastest release to reduce the time needed. Only on chip reset the internal attenuation is at max attenuation, once first note begins all bets are off.

Re: Some beginner questions concerning YM2612

Posted: Wed May 01, 2019 9:50 am
by tryphon
Stupid me. Of course it makes sense ! Thanks :)

Re: Some beginner questions concerning YM2612

Posted: Thu May 02, 2019 4:03 pm
by tryphon
Another question : when I translate decibel coordinates to linear ones (whatever they are), I did :

attenuation_in_dB = 10*log(I_max/I)

where I is my linear amplitude and I_max the maximum amplitude (since I use 16 bits integer, I_max = 32767), which led to :

I = I_max*10^(-attenuation_in_dB/10) = I_max*10^(-attenuation*9.6/1024)

where attenuation is the attenuation computed by the envelope generator.

Am I right ? Because if so, it means that any value of attenuation >= 482 results in an amplitude of 0...

Re: Some beginner questions concerning YM2612

Posted: Thu May 02, 2019 4:15 pm
by Sik
Isn't decibels-to-linear something like pow(2,dB/6)? (in the case of attenuation the decibels would be negative) That returns a multiplier (in floating point), mind you, but should give you a clue of where to go.

I may or may not be misunderstanding your question.

Re: Some beginner questions concerning YM2612

Posted: Thu May 02, 2019 4:40 pm
by tryphon
Your formula is an approximation of mine (with a division by 3 rather than 6, unless I missed something, like efficace value or something like that, which is quite possible).

10^(db/10) = (2^1/log(2))^(db/10) = 2^(db/(10log(2))

and 10log(2) = 3.0103...

Unless the true formula is 10^(db/20) ?

Re: Some beginner questions concerning YM2612

Posted: Thu May 02, 2019 8:08 pm
by Chilly Willy
This page seems pretty good to me.

Re: Some beginner questions concerning YM2612

Posted: Thu May 02, 2019 8:31 pm
by tryphon
So, according to this page, it seems that in audio we use the dB for tensions (why ?), which is different (why ?).

So it's indeed 10^(dB/20), which indeed equals roughly 2^(dB/6).

Thanks :)