Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user shad0wfax ! (Registered 2025-06-17) You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > ADSR vs Volume
2020-12-24 14:26
Laurent

Registered: Apr 2004
Posts: 40
ADSR vs Volume

SID doesn't have a "voice volume" register, but it has the sustain level of its ADSR envelope.
However it's not like we can freely adjust it since it's part of the complex (and buggy) ADSR state machine.
Decreasing sustain level (at the decay rate) works well, but to increase we have to start attacking again, always shooting to max volume and then decaying to desired sustain level.
If one want to make a quiet instrument (with low sustain value), it will pop at each new note due to attack-decay cycles, unless we always stay in sustain phase and don't really make use of the envelope.

Has it ever been a limitation to you that voice level control is not freely controllable ?

Another volume question, can you hear a difference between max sustain level $F (0db) and $E (-0.59db) or even with $D (-1.24dB) and maybe even $C (-1.93dB)?
2020-12-24 14:32
chatGPZ

Registered: Dec 2001
Posts: 11510
can't you abort the attack early so it never reaches max. volume?
2020-12-24 14:39
Laurent

Registered: Apr 2004
Posts: 40
sure you can, by going to release phase, so you will tend to 0 unless maybe you use the slowest release rate to attempt holding.
Then that "sustain" level depends very much on the timing, I don't know how easy it is to control
2020-12-24 14:44
chatGPZ

Registered: Dec 2001
Posts: 11510
will surely need some precise timing :)
2020-12-24 15:16
Conrad

Registered: Nov 2006
Posts: 856
What Groepaz said. You'll have to set bit gate off at the right cycle.

This is from the AAY64 / Dreams documents on SID ADSR, showing the milliseconds for when the voice "volume" goes from 0 to $f via the attack method:
 SID-ADR-Table:

     VALUE    ATTACK    DECAY/RELEASE
   +-------+----------+---------------+
   |   0   |    2 ms  |      6 ms     |
   |   1   |    8 ms  |     24 ms     |
   |   2   |   16 ms  |     48 ms     |
   |   3   |   24 ms  |     72 ms     |
   |   4   |   38 ms  |    114 ms     |
   |   5   |   56 ms  |    168 ms     |
   |   6   |   68 ms  |    204 ms     |
   |   7   |   80 ms  |    240 ms     |
   |   8   |  100 ms  |    300 ms     |
   |   9   |  240 ms  |    720 ms     |
   |   10  |  500 ms  |    1.5 s      |
   |   11  |  800 ms  |    2.4 s      |
   |   12  |    1 s   |      3 s      |
   |   13  |    3 s   |      9 s      |
   |   14  |    5 s   |     15 s      |
   |   15  |    8 s   |     24 s      |
   +-------+----------+---------------+

 This chart represents the 16 rates for ATTACK, DECAY and RELEASE.
2020-12-24 15:36
Jammer

Registered: Nov 2002
Posts: 1343
I cannot stress enough how badly picked these values actually were :(
2020-12-24 15:52
chatGPZ

Registered: Dec 2001
Posts: 11510
I doubt they were "picked" at all... They came up with the logic and the value happend =P
2020-12-24 15:56
Laurent

Registered: Apr 2004
Posts: 40
Quote: I cannot stress enough how badly picked these values actually were :(

And what about the level of a voice ? did you ever have any trouble in changing/set the over level the way you wanted ? Did you have to compromise ?

It's more a qualitative question than technical, I am well aware of the inner working of the SID chip, but I have never composed a tune ;)
2020-12-24 21:59
Mixer

Registered: Apr 2008
Posts: 460
ADSR Example

Above is a small demonstration of how to control voice ADSR just by switching between A and R (gate on/off and suitable values). The voice volume follows a sine curve.

Basically one can use voice 3 adsr read back register to "generate" the sequence of gate on/off and then apply the sequence on other channels.
2020-12-24 23:01
Jammer

Registered: Nov 2002
Posts: 1343
Quoting Laurent
And what about the level of a voice ? did you ever have any trouble in changing/set the over level the way you wanted ? Did you have to compromise ?)

Of course I had to compromise many times ;) Biggest problem is that many ADR values are wasted for quite similar short periods, whereas longer ones are few to pick from. But it can be tamed after all ;)
2020-12-25 14:14
4mat

Registered: May 2010
Posts: 66
In this fUJi I had to emulate the AY chip's rapid volume changes.

Basically it keeps the gate on at all times except when the new volume is lower than the existing one. At that point it briefly switches the gate off and resets the AD value. The only downside is you get some clicks with the lower sustain values, but I saw that as a trade-off for rock solid volume changes.

The source code for that bit is in the docs, it was mostly trial and error getting it working so there's probably bits that aren't needed to get the same effect.
 
... 9 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
cba
Merman/People of Lib..
iAN CooG/HVSC
Durandal
Seytan/Reflex
Mike
CopAss/Leader
theK/ATL
Guests online: 397
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 Irata  (9.7)
4 hedning  (9.7)
5 MWS  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.076 sec.