[Csnd-dev] How do you csounders declick your bass?
Date | 2015-12-31 22:00 |
From | Peter Burgess |
Subject | [Csnd-dev] How do you csounders declick your bass? |
Hi there, I'm having a bass declicking drama, so I'm wondering how all you folks go about declicking your bass patches. I thought I'd solved it before, when I was using this: "adclk linseg 0, 0.0005, ilvl, p3 - 0.0107, ilvl, 0.01, 0\n" At 44100 sr, each sample is 0.000022676 seconds long, so i thought 0.0005 seconds should allow plenty of samples to remove the click in at this sample rate and anything higher. This worked wonderfully on my lead synths, which I assumed meant it worked on everything. I discovered the other day that my basses were still clicking though. >From my messing around today, I've found bass seems to require a much longer declick time. My first instinct as to why this might be is because each cycle of the waveform is so much longer, and I guess if you alter only the very first cycle of the waveform with a declick envelope, then you end up with a single cycle with different harmonic content and thus create the impulse we hear as a click. So my next though was that I could use the fundamental frequency of the note to decide the declick. I tried a few versions of this p4 is hz of note played ilvl is the level shift of the instrument ispc = 1/p4 adclk linseg 0, ispc, ilvl, p3 - ispc * 2, ilvl, ispc, 0 adclk linseg 0, ispc, ilvl, p3 - ispc * 4, ilvl, ispc * 2, 0 adclk linseg 0, ispc * 0.5, ilvl, p3 - ispc * 2, ilvl, ispc, 0 ... and a whole load more with different ratios of ispc per attack/sustain/release section, and different sized gaps at the end. Two problems with this: 1 - to get a ratio that works consistently, I always end up with a noticeable truncation of notes with the lower frequencies. 2 - with ratios on the cusp of working and not, some of the notes still click and others don't. I think it was usually the higher notes that clicked more (though not certain still) which would suggest that my idea isn't totally solid. So next I tried adding a constant attack/sustain/decay length to the ispc ratios, a bit like this. adclk linseg 0, ispc + 0.01, ilvl, p3 - (ispc * 2 + 0.02), ilvl, ispc + 0.01, 0 adclk linseg 0, ispc + 0.01, ilvl, p3 - (ispc * 3.5 + 0.02), ilvl, ispc * 2 + 0.01, 0 ... I think it worked better, but the results still weren't ideal. The declick UDO I found online does this: aenv linseg 0, 0.02, 1, p3 - 0.05, 1, 0.02, 0, 0.01, 0 That can be found here: http://www.csounds.com/udo/displayOpcode.php?opcode_id=9 This works, but again truncates the notes a noticeable amount. Shorter sections than 0.02 and 0.05 start to result in clicking. I thought about using exponential and logarithmic segments instead. expseg has aweful results, as you might expect. I don't think there's a specific log version. I thought I'd seen an opcode before that allowed you to set the curvature of each segment, but I might just be thinking of the similar GEN routine. So I am struggling to work out where to go from here. The best balance of click reduction vs audible impact I've achieved so far is this: "adclk linseg 0, 0.017, ilvl, p3 - 0.045, ilvl, 0.017, ilvl * 0.5, 0.008, 0\n" But it's still not ideal. So, I'm intrigued to know how you guys deal with it? Hope the essay doesn't put too many of you off reading it ;) |
Date | 2016-01-01 01:12 |
From | thorin kerr |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
I use something like this: opcode declickr, a, ajjo ain, irisetime, idectime, itype xin irisetm = (irisetime == -1 ? 0.003 : irisetime) idectm = (idectime == -1 ? 0.08 : idectime) aenv transegr 0, irisetm, itype, 1, 0, 0, 1, idectm, itype, 0 xout ain * aenv ; apply envelope and write output endop abass buthp abass, 20 abass declickr abass Thorin On Fri, Jan 1, 2016 at 8:00 AM, Peter Burgess <pete.soundtechnician@gmail.com> wrote: Hi there, I'm having a bass declicking drama, so I'm wondering how all |
Date | 2016-01-01 13:50 |
From | Peter Burgess |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
Hey, that's interesting, I thought about sticking a lowpass filter at some high frequency to see if that would catch some of the click, but didn't consider getting rid of the sub audio frequencies. I'm gonna give that a try. I'm not really fond of colouring the sound with a lowpass just for the click, but it's also just occurred to me that I could stick an envelope on a lowpass so it only filters for a short period at the beginning of the note on. I'm sure I could fiddle about with it so it's effects aren't too audible other than to remove some click. Also, I was actually meant to post this in the general csound list. I'm gonna post it again there quickly. On Fri, Jan 1, 2016 at 1:12 AM, thorin kerr |
Date | 2016-01-01 14:11 |
From | Peter Burgess |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
The highpass at 20hz makes quite a difference! It certainly gives me alot more breathing space with the envelope times. Thanks for that tip! Do you mind if I repost your answer in the general csound repost of the question? On Fri, Jan 1, 2016 at 1:50 PM, Peter Burgess |
Date | 2016-01-01 14:18 |
From | Peter Burgess |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
ah, and I've just realised that transeg is the answer to the other part of my question. Thanks again! I'll have a play with that too On Fri, Jan 1, 2016 at 2:11 PM, Peter Burgess |
Date | 2016-01-01 14:45 |
From | thorin kerr |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
Glad it worked. Yes, feel free to repost. I'll let you do the honours. I found the highpass worked better than dcblock with a super simple bass sound I had using gbuzz. Without it, the dc offset on gbuzz seemed quite severe. T On Sat, Jan 2, 2016 at 12:18 AM, Peter Burgess <pete.soundtechnician@gmail.com> wrote: ah, and I've just realised that transeg is the answer to the other |
Date | 2016-01-01 15:34 |
From | Peter Burgess |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
I haven't tried gbuzz yet, but it's on my list, so I'll bear that in mind. Is that problem prevalent with any other opcodes? I've never thought to check anything for dc offset before unless I know I've done something that will add an offset. On Fri, Jan 1, 2016 at 2:45 PM, thorin kerr |
Date | 2016-01-01 16:30 |
From | thorin kerr |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
I suspect the gbuzz clicks are peculiar to the gbuzz algorithm. The cosine doesn't start at 0 (which makes sense), and the offset seems to be in the harmonics, rather than the fundamental. Example for interest: <CsoundSynthesizer> <CsOptions> -ogbuzztest.wav --sample-rate=48000 --ksmps=64 --0dbfs=1 --nchnls=1 </CsOptions> <CsInstruments> gi_cosine ftgen 0,0,16384,11,1,1 instr 101 ares gbuzz p4, p5, p6, p7, linseg:k(p6, p3, p7), gi_cosine out ares endin </CsInstruments> <CsScore> i101 0 0.4 0.7 65.406 4 1 </CsScore> </CsoundSynthesizer> On Sat, Jan 2, 2016 at 1:34 AM, Peter Burgess <pete.soundtechnician@gmail.com> wrote: I haven't tried gbuzz yet, but it's on my list, so I'll bear that in |
Date | 2016-01-02 15:56 |
From | Peter Burgess |
Subject | Re: [Csnd-dev] How do you csounders declick your bass? |
Thanks man, I'll have a gander at that On Fri, Jan 1, 2016 at 4:30 PM, thorin kerr |