| |
Bregalad Account closed
Registered: Jul 2008 Posts: 42 |
Direct control over volume
Is there a way to trick the SID so that we can have direct control over the volume of each channel ?
By setting attack, decay and release to 0 and directly manipulate the 4 bits of sustain, by key-ing off then on again, the enveloppe should imediately release to 0, attack back to maximum and decay to the new sustain in an instant so that we can effectively bypass the limited ADSR and implement our own volume control.
Under Vice which claims to be extremely accurate, this seems to work as long as the new sustain value is smaller than the old, but the channel silent if the new sustain is greater. Any clue why ? |
|
| |
Mindcooler
Registered: Nov 2006 Posts: 28 |
Quote: Is there a way to trick the SID so that we can have direct control over the volume of each channel ?
By setting attack, decay and release to 0 and directly manipulate the 4 bits of sustain, by key-ing off then on again, the enveloppe should imediately release to 0, attack back to maximum and decay to the new sustain in an instant so that we can effectively bypass the limited ADSR and implement our own volume control.
Under Vice which claims to be extremely accurate, this seems to work as long as the new sustain value is smaller than the old, but the channel silent if the new sustain is greater. Any clue why ?
1. attack 0 is not immediate, it's more like 2 millisecons.
2. You can only lower the sustain value on the sid between gates. |
| |
Jammer
Registered: Nov 2002 Posts: 1343 |
i confirm that trick works. tried it quite some time ago :) |
| |
Bregalad Account closed
Registered: Jul 2008 Posts: 42 |
OK so the only way to have a channel less loud than the others is to set attack=0, decay=0 and set a sustain value lower than 15 right ? You can only achieve effects by lowering the sustain. Or else you have to wait unless the enveloppe is fully released before enabling it again (with a higer sustain value), right ? |
| |
A Life in Hell Account closed
Registered: May 2002 Posts: 204 |
Quote: Is there a way to trick the SID so that we can have direct control over the volume of each channel ?
By setting attack, decay and release to 0 and directly manipulate the 4 bits of sustain, by key-ing off then on again, the enveloppe should imediately release to 0, attack back to maximum and decay to the new sustain in an instant so that we can effectively bypass the limited ADSR and implement our own volume control.
Under Vice which claims to be extremely accurate, this seems to work as long as the new sustain value is smaller than the old, but the channel silent if the new sustain is greater. Any clue why ?
I do this to implement envelopes in my current player, and it does work, however there is an audiable click whenever changing the volume of a channel up, due to the attack not being instant, as jammer pointed out. The only way around this that I found so far is to pay weird tricks with AD in order to try and keep the volume at a level, but I havn't got this accurate yet. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
Quote: OK so the only way to have a channel less loud than the others is to set attack=0, decay=0 and set a sustain value lower than 15 right ? You can only achieve effects by lowering the sustain. Or else you have to wait unless the enveloppe is fully released before enabling it again (with a higer sustain value), right ?
use attack/sustain |
| |
Bregalad Account closed
Registered: Jul 2008 Posts: 42 |
OK thanks.
I'd like to make a graphic enveloppe meter, but unfortunately only the enveloppe of one of the channels can be read :(
I guess the only solution is to "guess" the enveloppe of other channels by "emulating" the ADSR enveloppe with my code ? |
| |
Oswald
Registered: Apr 2002 Posts: 5127 |
Quote: OK thanks.
I'd like to make a graphic enveloppe meter, but unfortunately only the enveloppe of one of the channels can be read :(
I guess the only solution is to "guess" the enveloppe of other channels by "emulating" the ADSR enveloppe with my code ?
yes. its already done though including "emulating" the waveforms: Cubic Player |
| |
Bregalad Account closed
Registered: Jul 2008 Posts: 42 |
I don't see where it's done but it doesn't matter anyway. I have the official C64 docs where there is tables for time that each enveloppe phase (attack, decay and release) takes, and it shouldn't be hard to emulate them based on that. I don't need to be very accurate, it's just for a cool graphical effect. I can still use the hardware for channel 3, and play the same data with all channels and compare the results. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
If someone would just code an editor where you can write:
01 07 G#3
01, instrument
07, volume
Then we dont care how its made, but the player should make sure the volume of that note becomes 7, and thats it.
sound simple to me.. ? |
| |
ice00
Registered: Apr 2002 Posts: 54 |
I implemented this in JIIT64 with the Gate Sustain/Release command (the ticks come out from Cybertracker as Stephen Parth found out).
Putting gate off just before setting all the other sid registers (and so even gate on again), the volume can be increased and not only decreased (there can be just the problem about "click" just pointed out upper) . |