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 > Sid ADSR problem / hardrestart
2006-07-18 21:32
stunt
Account closed

Registered: Jul 2006
Posts: 48
Sid ADSR problem / hardrestart

Hey guys,

I more or less understand the hardrestart thing,
but can anyone explain to me what the exact problem
with the ADSR is? So explain what the effect is when i dont
use hard restart.

Lots of thx.

The audioarts sidproject (hardware and software pimping of c64)s:

http://www.audioarts.nl/getNews.php?ID=19
 
... 24 posts hidden. Click here to view all posts....
 
2006-07-20 09:29
stunt
Account closed

Registered: Jul 2006
Posts: 48
ok since hardly any on topic replies here in this thread (pity, am i so unclear?) , you may also explain to me what is a 'sexy note start' and how it relates to hardrestart.
2006-07-20 09:31
cadaver

Registered: Feb 2002
Posts: 1154
@Nata: it was originally requested by Jammer, in very vague way. Done mainly as a learning exercise, to see if I was able to reproduce what for example JCH playroutines produced. And the silent frame was also advantageous for rastertime.

But the short & even note start is only one of many possibilities, and once you know how it's done, it sort of loses its mystery? The main point is: many people find it useful, only you feel the need to get all fanatical about it.

@Stuntgitarist: when you manipulate ADSR in the way the example couple of posts above shows you, and always write ADSR first, waveform afterwards, it performs just that. You can also use for example ADSR 0F00 or F800 as the fixed value.
2006-07-20 09:46
Bamu®
Account closed

Registered: May 2005
Posts: 1332
Aha!
And value F800 ? Where is the difference?
2006-07-20 09:55
cadaver

Registered: Feb 2002
Posts: 1154
The SID uses the same internal counter for all of attack, decay and release. The counter itself can never be reset, so it's to cause a different kind of delay, I guess.
2006-07-20 09:56
Bamu®
Account closed

Registered: May 2005
Posts: 1332
Hmm, I can't hear any audible difference.
2006-07-20 10:27
stunt
Account closed

Registered: Jul 2006
Posts: 48
Quote: Ah, the whole time I thought these questions were in preparation to create the most amazing music for Battlestar Galactica :)

Anyway, my input would be to go for maximum configurability. For hardrestart, give options to write any ADSR value and perform gateon/gateoff some time before the note. The more accuracy you can get to the timing (more than standard 20ms PAL frame?), the better.

An example:
60 ms before: ADSR 0000 and gateoff
20 ms before: ADSR to instrument values and gateon with no waveform
0 ms: start the note

Note that because you need to know there's a note coming so that you can do gateoff/HR before it, this introduces a latency to live-playing. But if you can stomach it, with this kind of long HR, particularly if the timing stays accurate, there are like no instrument ADSR values to avoid.


Ok. Cadaver, i sent you a p.m.
hope you noticed. i'll also
respond to your helpful suggestion here:

Why 60 and 20 ms?

is that random?
why not 40 and 20?

you say "0 ms: start the note". what do you mean by that? to select the waveform? (b/c gate on (whcih is my definition of starting a note, is already on by that time).

Stunt
ps.
So for those who didn't figure yet...i'm trying to get a hold of how to create the best music routine for live(!) jamming and knobfiddling with c64. (so not a tracker, not a sequencer, not a player). But all info on how trackers and players are done is very interesting to me if it can inspire me for my thing.
2006-07-20 12:52
cadaver

Registered: Feb 2002
Posts: 1154
It's not really random, it seems at least 40ms (two 50Hz frames) of gateoff time is needed to know the next note triggers nicely, and even more without hardrestart.

To start the note = to select the waveform + gateon, initial frequency and initial pulsewidth if needed
2006-07-20 14:50
stunt
Account closed

Registered: Jul 2006
Posts: 48
Quote: It's not really random, it seems at least 40ms (two 50Hz frames) of gateoff time is needed to know the next note triggers nicely, and even more without hardrestart.

To start the note = to select the waveform + gateon, initial frequency and initial pulsewidth if needed


@ cadaver: hmm ok. Do you mean that ADSR reset has to be at least 2 frames before start of note OR do you mean that ADSR has to two frames before you init adsr with new note values?

I mean what about this , would this work?:

40ms (2frames) before - ADSR reset
0ms - put note values to adsr and wave and directly after that set gate to 'on'.

@ cadaver: i appreciate it a lot that you guys are helping a novice coder like me to find out the hardrestart stuff. I almost understand how it works now. Still 1 question: what exactly is part of the hardrestart , does HR just mean to reset the ADSR before notes, or is the way in which you trigger the notes also part of it? in other words: does it matter wether you firstly put gate on and then select waveform to trigger the note, or can you also first select waveform and then toggle the note on by putting gate to 'on' ?

Because in my application, all parameters are constantly set to the right instrument setting (pw, adsr, waveform, ringmod etc) except for pitch and gate on/off. when i play a note on my keyboard it just sets the right pitch and puts the gate to on. in the future with my wersi board and the midi, there will be sent a 'gate off' signal when keypress is released.

OFcourse for the ADSRbug i now understand to also reset adsr 2 frames before the note will play (i'll create a 2 frame-latency-live-mode that will enable tones with the problematic adsr values).

But why set the other values again each note? like waveform etc? Isn't it more cpu-efficient to change waveform etc with a command that stands loose from each individual note that is played?

Greetz,

Stunt
2006-07-20 15:06
cadaver

Registered: Feb 2002
Posts: 1154
IMO hardrestart does not involve the new note trigger itself, it's just getting the SID to a stabile enough state before the note.

Actually to answer all your questions accurately would require writing testcode, and your code would be different anyway. There comes a point when just trying out stuff is 10x more helpful than asking about it :)

You can freely select waveform at whatever point you want, only the gatebit matters for the envelope generator. However many musicroutines prefer absolute silence (just gatebit, or testbit+gatebit so that the oscillator gets reset) for the first gated on frame.

It's also possible that depending on which kind of attack you are pleased with, you can squeeze the latency time to one frame. This, for instance, is completely different from the hardrestart that was discussed above:

20ms before: gate off, ADSR to 0000 or 000F
0 ms: gate on + waveform (write those first!), ADSR to instrument values, frequency, pulsewidth etc.

It possibly bugs on full sustain.

But to answer about CPU efficiency, we usually don't care about such small things in musicroutines, but rather avoid the real costly operations like multiplication, or reading & interpreting many bytes of the musicdata at once.
2006-07-20 23:01
stunt
Account closed

Registered: Jul 2006
Posts: 48
@ cadaver:

ok thx , that was helpful.
Previous - 1 | 2 | 3 | 4 - 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
hedning/G★P
Alakran_64
Paul Bearer
iAN CooG/HVSC
jmin
syntaxerror
Guests online: 92
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.6)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.043 sec.