Smoothing continuous midi data

View: New views
5 Messages — Rating Filter:   Alert me  

Smoothing continuous midi data

by Charles Gran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... with body "unsubscribe csound"

RE: Smoothing continuous midi data

by Iain McCurdy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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@...
> To: csound@...
> 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@... with body "unsubscribe csound"


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

Re: RE: Smoothing continuous midi data

by Art Hunkins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Iain is right on.
 
I use port or portk for amplitude smoothing routinely.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 02, 2009 12:05 PM
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@...
> To: csound@...
> 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@... with body "unsubscribe csound"


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

Re: RE: Smoothing continuous midi data

by Charles Gran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 2, 2009 at 11:05 AM, Iain McCurdy<i_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)?


Send bugs reports to this list.
To unsubscribe, send email sympa@... with body "unsubscribe csound"

Re: RE: Smoothing continuous midi data

by francibal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.