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


Forums > C64 Composing > Sid ADSR problem / hardrestart
2006-07-18 21:32
stunt
Account closed

Registered: Jul 2006
Posts: 47
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: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: 47
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: 1121
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: 47
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: 1121
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: 47
@ cadaver:

ok thx , that was helpful.
2006-07-22 11:44
Bamu®
Account closed

Registered: May 2005
Posts: 1332
*by the way*

@cadaver
Are there any HR/ADSR values that can prevent ADSR-Bugs? It seems that 0F00 (GT, Jch..) is the best, but what is with other values?
Ok, F800 is quite a good mix (IMHO F000 would sounds too hard), but the A/S value seems to have no audible function.

Ok, here some sceners that use different HR values:

0F00 : - (standard value of some editors)

FF00 : Jeff
0FF0 : Randall/Jammer
0F20 : GRG

FFF0 : maybe a mix of all is the best? :)
2006-07-22 14:28
stunt
Account closed

Registered: Jul 2006
Posts: 47
I think nata's question is interesting.
I notice that you guys seem to mock him sometimes,
(just new to this forum makes me wonder how he
did deverse that position:P), but i can relate to
nata's question very much.

Also i'd really like to see a table of different ADSR settings that bug/dont bug under different circumstances.
I hear peeps saying that it's different for each player/tracker, but as far as i know understand there's a
limited amount of adsrbug approaches, so why not create a table, that describes symptoms of adsrbug under all of them.
To me the different HRcircumstances are (please extend this list if it's not complete yet):

-no HR
-20 ms HR
-40 ms HR
-60 ms HR

Or correct me if i'm (once a gain) summarizing stuff in a way that's too simple :P

cul8rallig8rs

STunt - coder with a typically non-coder mindset
2006-07-22 17:34
cadaver

Registered: Feb 2002
Posts: 1121
@Nata: I would say that 0000, the hardest one, is theoretically best, as the internal counters are left counting the smallest possible cycle. Still there can be some bugs depending how the timing between playroutine's successive frames changes. Something worth trying is to always write last frame's buffered SID values at the beginning of the next frame.

@Stuntgitarist: there are as many timing possibilities as there are CPU cycles between the end of the last note and the beginning of the new :) Only you can tell how ADSRbugs will behave for you, when you test your own routine.

(something very educational would be to modify reSID to display its envelope generator value & internal counter value on each CPU cycle, then you see how even swapping some instructions around may have a different effect)
2006-07-22 18:23
Laxity

Registered: Aug 2005
Posts: 427
"And we're back in the loop again".. Yihaa! ;)
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
Yogibear/Protovision
Powerslave/ΤRIΛD
Guests online: 289
Top Demos
1 Uncensored  (9.7)
2 Unboxed  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.7)
5 Comaland 100%  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.6)
8 C=Bit 18  (9.5)
9 Wonderland XII  (9.5)
10 Old Men in Used Cars  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Smile to the Sky  (9.5)
3 Pandemoniac Part 5 o..  (9.5)
4 The Tuneful Eight [u..  (9.5)
5 Crystal Gazer  (9.5)
6 Daah, Those Acid Pil..  (9.5)
7 Rewind  (9.5)
8 Instinct  (9.5)
9 Innervasion  (9.4)
10 Bad Boy  (9.4)
Top Groups
1 PriorArt  (9.7)
2 Fossil  (9.6)
3 Performers  (9.6)
4 Oxyron  (9.5)
5 Censor Design  (9.4)
Top Fullscreen Graphicians
1 Facet  (10)
2 Joe  (9.9)
3 Veto  (9.9)
4 Mirage  (9.7)
5 Jailbird  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2019
Page generated in: 0.057 sec.