Csound Csound-dev Csound-tekno Search About

resetting in comb opcode

Date2006-01-12 17:33
From"Robson Cozendey"
Subjectresetting in comb opcode
Hello,

In the comb opcode examples, an additional instrument is made separately for 
the reverb. Below is an archive .csd with the manual example written. What I 
dont understand is why after using "comb", whe have to reset the global 
variable "gamix" to 0, since in the next pass it is assigned again with the 
same gamix = a1? Why one initialization and no reset don´t work?

Thanks in advance,
Robson





-o comb.wav





; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Initialize the audio mixer.
gamix init 0

; Instrument #1.
instr 1
  ; Generate a source signal.
  a1 oscili 30000, cpspch(p4), 1
  ; Output the direct sound.
  out a1

  ; Add the source signal to the audio mixer.
  gamix = a1
endin

; Instrument #99 (highest instr number executed last)
instr 99
  krvt = 1.5
  ilpt = 0.1

  ; Comb-filter the mixed signal.
  a99 comb gamix, krvt, ilpt
  ; Output the result.
  out a99

  ; Empty the mixer for the next pass.
  gamix = 0
endin





; Table #1, a sine wave.
f 1 0 128 10 1

; p4 = frequency (in a pitch-class)
; Play Instrument #1 for a tenth of a second, p4=7.00
i 1 0 0.1 7.00
; Play Instrument #1 for a tenth of a second, p4=7.02
i 1 1 0.1 7.02
; Play Instrument #1 for a tenth of a second, p4=7.04
i 1 2 0.1 7.04
; Play Instrument #1 for a tenth of a second, p4=7.06
i 1 3 0.1 7.06

; Make sure the comb-filter remains active.
i 99 0 5
e




_________________________________________________________________
Facilite sua vida: Use o Windows Desktop Search e encontre qualquer arquivo 
ou e-mail em seu PC. Acesse:  http://desktop.msn.com.br

Date2006-01-12 17:39
FromIstvan Varga
SubjectRe: resetting in comb opcode
AttachmentsNone  

Date2006-01-12 18:12
From"Robson Cozendey"
SubjectRe: resetting in comb opcode
But exactly as it is written here (i.e. gamix=a1 withou adding) it works 
only if at the end we have gamix=0. If there is no gamix = 0 then there are 
samples out of range. Another example, if comb is in the same instument, 
i.e.,

instr 1
  krvt = 1.5
  ilpt = 0.1
  a1 oscili 30000, 440, 1
  a99 comb a1, krvt, ilpt
  out a1+a99
endin

then the in-signal is repeated only once, i.e. just one echo. So if we dont 
have gamix=0 there is too much strange reverberation, and if it is in the 
same instrument there is too little reverb.

It seems like a strange need in the inner workings of k-pass to have gamix 
reassigned to a1 and to 0 alternately in different instruments, anh?

>From: Istvan Varga 
>Reply-To: csound@lists.bath.ac.uk
>To: csound@lists.bath.ac.uk
>Subject: Re: [Csnd] resetting in comb opcode
>Date: Thu, 12 Jan 2006 18:39:41 +0100
>
>On Thursday 12 January 2006 18:33, Robson Cozendey wrote:
> > Hello,
> >
> > In the comb opcode examples, an additional instrument is made separately 
>for
> > the reverb. Below is an archive .csd with the manual example written. 
>What I
> > dont understand is why after using "comb", whe have to reset the global
> > variable "gamix" to 0, since in the next pass it is assigned again with 
>the
> > same gamix = a1?
>
>That should probably be gamix = gamix + a1 (or vincr gamix, a1), so that
>with multiple instances of instr 1 the output is mixed. Then, with
>accumulating the output, it should really be reset to zero.
>--
>Send bugs reports to this list.
>To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

_________________________________________________________________
Você sabia que com o seu MSN Messenger você faz ligações de PC-papa- PC, 
grátis e para qualquer lugar do mundo? É só acessar   
http://imagine-msn.com/messenger/default2.aspx?locale=pt-br

Date2006-01-12 18:21
FromIstvan Varga
SubjectRe: resetting in comb opcode
AttachmentsNone  

Date2006-01-12 19:22
From"Robson Cozendey"
SubjectRe: resetting in comb opcode
Thanks Istvan!
I think now I understood


>From: Istvan Varga 
>Reply-To: csound@lists.bath.ac.uk
>To: csound@lists.bath.ac.uk
>Subject: Re: [Csnd] resetting in comb opcode
>Date: Thu, 12 Jan 2006 19:21:11 +0100
>
>On Thursday 12 January 2006 19:12, Robson Cozendey wrote:
>
> > But exactly as it is written here (i.e. gamix=a1 withou adding) it works
> > only if at the end we have gamix=0. If there is no gamix = 0 then there 
>are
> > samples out of range.
>
>Yes, you do in fact need to reset even with the original example,
>as otherwise the last output would be repeated when instr 1 is not
>active. However, in general, you should both add and reset.
>
> > Another example, if comb is in the same instument,
> > i.e.,
> >
> > instr 1
> >   krvt = 1.5
> >   ilpt = 0.1
> >   a1 oscili 30000, 440, 1
> >   a99 comb a1, krvt, ilpt
> >   out a1+a99
> > endin
> >
> > then the in-signal is repeated only once, i.e. just one echo. So if we 
>dont
> > have gamix=0 there is too much strange reverberation, and if it is in 
>the
> > same instrument there is too little reverb.
>
>That is because instr 1 is turned off before you could get more
>reverberation. That is why there is a separate instrument that is
>always on.
>--
>Send bugs reports to this list.
>To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

_________________________________________________________________
  http://imaginemsn.com/messenger/default2.aspx?locale=pt-br