Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > Direct control over volume
2009-01-23 23:16
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 ?
2009-01-24 00:47
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.
2009-01-24 02:00
Jammer

Registered: Nov 2002
Posts: 1343
i confirm that trick works. tried it quite some time ago :)
2009-01-24 10:32
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 ?
2009-01-24 11:00
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.
2009-01-24 16:28
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
2009-01-24 17:45
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 ?
2009-01-24 18:05
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
2009-01-24 20:09
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.
2009-04-04 04:12
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.. ?
2009-04-04 07:31
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) .
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
Mason/Unicess
ΛΛdZ
REBEL 1/HF
aegis/ascraeus/r3turn
VIC/Camelot
Jammer
Clown
megasoftargentina
Guests online: 335
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 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (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 Cover Designers
1 Duce  (9.8)
2 Electric  (9.8)
3 Junkie  (9.6)
4 The Elegance  (9.5)
5 Mermaid  (9.3)

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