Csound Csound-dev Csound-tekno Search About

[Csnd] Smoothing continuous midi data

Date2009-07-02 14:57
FromCharles Gran
Subject[Csnd] Smoothing continuous midi data
If I hold a note on this test instrument and I move the volume slider
quickly I get pronounced crackling, this is less noticeable when I
move the slider more slowly.
On my XP PC with ASIO drivers this goes away when I set the sampling
rate to 88200.  In the lower sampling rate, 44100, is there some kind
of stepping that is happening?
On my IMAC the crackling doesn't seem to improve much with the sampling rate.

-Charles



-M0  -odac -b100 -B256



sr = 88200
kr = 8820
ksmps = 10
nchnls = 1

initc7 1,7,.5

instr   1
  ifqc cpsmidi
  iamp ampmidi 5000
  kenv linenr  iamp, .01, .1, .01 ;gain
  kamp ctrl7 1, 7, 0, 1
 a1 oscili kenv*kamp, ifqc, 1
out a1
endin



; Sine wave
f1 0 16384 10 1
i1 0 3600



Date2009-07-02 17:05
FromIain McCurdy
Subject[Csnd] RE: Smoothing continuous midi data
Hi Charles you are experiencing 7-bit quantization (zipper) noise. You need to apply some sort of 'lag' or portamento to the variable in order to smooth changes between values. I use portk. Don't use too high a value for portamento time or you will get a sluggish response.
Here's an example:

<CsoundSynthesizer>

<CsOptions>
-M0 -odac -b100 -B256
</CsOptions>

<CsInstruments>

sr    =    44100
ksmps    =    10
nchnls    =    2
0dbfs    =    1

gisine    ftgen 0,0,1024,10,1

instr 1
kamp ctrl7 1,1,0,1
;PORTAMENTO TIME
iporttime = 0.05
;kporttime QUICKLY RAMPS UP TO DESIRED PORTAMENTO TIME VALUE
kporttime linseg 0,0.01,iporttime,1,iporttime
;APPLY PORTAMENTO
kamp portk kamp, kporttime
a1 oscili kamp, 400, gisine
outs a1,a1
endin
   
</CsInstruments>

<CsScore>
i 1 0 3600 ;i1, A LONG NOTE
</CsScore>

</CsoundSynthesizer>





























> Date: Thu, 2 Jul 2009 08:57:48 -0500
> From: chasgran@gmail.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Smoothing continuous midi data
>
> If I hold a note on this test instrument and I move the volume slider
> quickly I get pronounced crackling, this is less noticeable when I
> move the slider more slowly.
> On my XP PC with ASIO drivers this goes away when I set the sampling
> rate to 88200. In the lower sampling rate, 44100, is there some kind
> of stepping that is happening?
> On my IMAC the crackling doesn't seem to improve much with the sampling rate.
>
> -Charles
>
> <CsoundSynthesizer>
> <CsOptions>
> -M0 -odac -b100 -B256
> </CsOptions>
>
> <CsInstruments>
> sr = 88200
> kr = 8820
> ksmps = 10
> nchnls = 1
>
> initc7 1,7,.5
>
> instr 1
> ifqc cpsmidi
> iamp ampmidi 5000
> kenv linenr iamp, .01, .1, .01 ;gain
> kamp ctrl7 1, 7, 0, 1
> a1 oscili kenv*kamp, ifqc, 1
> out a1
> endin
> </CsInstruments>
>
> <CsScore>
> ; Sine wave
> f1 0 16384 10 1
> i1 0 3600
> </CsScore>
> </CsoundSynthesizer>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Insert movie times and more without leaving Hotmail®. See how.

Date2009-07-03 15:30
FromCharles Gran
Subject[Csnd] Re: RE: Smoothing continuous midi data
On Thu, Jul 2, 2009 at 11:05 AM, Iain McCurdy wrote:

> sr    =    44100
> ksmps    =    10
> nchnls    =    2
> 0dbfs    =    1

I've seen a lot of variations on setting/not setting these values.
Why has kr not been set?  Also, what is the advantage of 0dbfs    =
1 (I don't see this very often)?


Date2009-07-03 16:12
Fromfrancibal
Subject[Csnd] Re: RE: Smoothing continuous midi data
Hi,
csound can infer kr value by sr/ksmps, then you can omit it.
About 0 dbfs = 1 is only a convention, many peolpe uses amplitude value in
range 0-1, and some other software like pd.
You can read in manual.

just a little bit.

ciao,

fran.
-- 
View this message in context: http://www.nabble.com/Smoothing-continuous-midi-data-tp24307199p24324701.html
Sent from the Csound - General mailing list archive at Nabble.com.