Csound Csound-dev Csound-tekno Search About

[Csnd] bug in granule in csound 5.08

Date2008-05-30 03:49
FromSuper Pija
Subject[Csnd] bug in granule in csound 5.08
hi all,
when the .orc and .sco that follows are run with the 220sine.aif and 1 in pshift, just silence is created when it should be created a wav with one voice (as written in pshift).
2 in pshift creates a wav with 1 voice.
3 in pshift creates a wav with 2 voice.
4 in pshift creates a wav with 3 voice.

the 220sine.aif is in the csound book cd

thanks in advance,
                             Spija

;ORC:

instr 1301    ;    SIMPLE GRANULAR WITH GRANULE OPCODE

kl linseg 0, 0.05*p3, 1, 0.9*p3, 1, 0.05*p3, 0


;ar    granule    xamp,    ivoice,    iratio,    imode,    ithd,    ifn,    ipshift,    igskip,igskip_os,ilength,kgap,    igap_os,kgsize,igsize_os,iatt,    idec [,iseed]    [,ipitch1]    [,ipitch2] [,ipitch3] [,ipitch4]    [,ifnenv]

a1    granule    p4*kl,    p5,    p6,    p7,    p8,    p9,    p10,        p11,    p12,    p13,    p14,    p15,    p16,    p17,    p18,    p19,    p20,    p2l,        p22,        p23,    p24,        p25
out a1

endin

SCO:

; SOURCE FILE IS A 220 HZ SINE WAVE
f 1    0    524288    1    "sine220.aif"  0 4 0

;            p4,    p5,    p6,    p7,    p8,    p9,    p10,    p11,    p12,    p13,    p14,    p15,    p16,    p17,    p18,    p19,    p20,    p2l,    p22,    p23,    p24,    p25
;    granule        xamp,    ivoice,    iratio,    imode,    ithd,    ifn,    ipshift,igskip,igskip_os,ilength,kgap,    igap_os,kgsize,igsize_os,iatt,    idec,    iseed,    ipitch1,ipitch2,ipitch3,ipitch4,ifnenv
; GRAIN SIZE IS SET TO 5 MS, GAP SET TO    50 MS
;i1301    0    10    1000    12    1    1    0    1    0    0    0    10    .01    0    .001    40    20    50    .1    1    1    0.3    .5    0
i1301    0    10    6000    12    1    1    0    1    4    0    0    10    .01    0    .005    40    20    50    .1    1    6    10    15    0


      

Date2008-05-30 15:15
FromIain McCurdy
Subject[Csnd] RE: bug in granule in csound 5.08
Hi Spija,
I played around with your code and it seems to work now. (see below)
You can clearly hear the 4 voices being added cumulatively across the four notes. Notice that the first note come in 1 second after performance begins - if you set this to time zero the note doesn't sound! Maybe this is the problem you encountered. Perhaps someone else can suggest why this might be.
Iain

;ORC:

instr 1301    ;    SIMPLE GRANULAR WITH GRANULE OPCODE

kl linseg 0, 0.05*p3, 1, 0.9*p3, 1, 0.05*p3, 0


;ar    granule    xamp,    ivoice,    iratio,    imode,    ithd,    ifn,    ipshift,    igskip, igskip_os, ilength, kgap,  igap_os, kgsize, igsize_os, iatt,    idec [,iseed]    [,ipitch1]    [,ipitch2] [,ipitch3] [,ipitch4]    [,ifnenv]
a1    granule    p4*kl,     p5,         p6,       p7,       p8,     p9,       p10,        p11,     p12,      p13,   p14,     p15,     p16,     p17,     p18,    p19,    p20,        p2l,          p22,        p23,      p24;,          p25
out a1

endin



SCO:

; SOURCE FILE IS A 220 HZ SINE WAVE
f 1    0    524288    1    "sine220.aif"  0 4 0

; P1     P2   P3    P4     P5   P6   P7   P8   P9   P10  P11  P12   P13    P14   P15   P16    P17   P18   P19   P20   P21  P22  P23   P24   P25
i1301    1    3    6000    4     1    1    0    1     1    0    0    10    .005  20    .05    40    20    50    .1     1     2     3     4;    0
i1301    5    3    6000    4     1    1    0    1     2    0    0    10    .005  20    .05    40    20    50    .1     1     2     3     4;    0
i1301    9    3    6000    4     1    1    0    1     3    0    0    10    .005  20    .05    40    20    50    .1     1     2     3     4;    0
i1301   13    3    6000    4     1    1    0    1     4    0    0    10    .005  20    .05    40    20    50    .1     1     2     3     4;    0










> Date: Thu, 29 May 2008 19:49:29 -0700
> From: superpija2@yahoo.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] bug in granule in csound 5.08
>
> hi all,
> when the .orc and .sco that follows are run with the 220sine.aif and 1 in pshift, just silence is created when it should be created a wav with one voice (as written in pshift).
> 2 in pshift creates a wav with 1 voice.
> 3 in pshift creates a wav with 2 voice.
> 4 in pshift creates a wav with 3 voice.
>
> the 220sine.aif is in the csound book cd
>
> thanks in advance,
> Spija
>
> ;ORC:
>
> instr 1301 ; SIMPLE GRANULAR WITH GRANULE OPCODE
>
> kl linseg 0, 0.05*p3, 1, 0.9*p3, 1, 0.05*p3, 0
>
>
> ;ar granule xamp, ivoice, iratio, imode, ithd, ifn, ipshift, igskip,igskip_os,ilength,kgap, igap_os,kgsize,igsize_os,iatt, idec [,iseed] [,ipitch1] [,ipitch2] [,ipitch3] [,ipitch4] [,ifnenv]
>
> a1 granule p4*kl, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p2l, p22, p23, p24, p25
> out a1
>
> endin
>
> SCO:
>
> ; SOURCE FILE IS A 220 HZ SINE WAVE
> f 1 0 524288 1 "sine220.aif" 0 4 0
>
> ; p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p2l, p22, p23, p24, p25
> ; granule xamp, ivoice, iratio, imode, ithd, ifn, ipshift,igskip,igskip_os,ilength,kgap, igap_os,kgsize,igsize_os,iatt, idec, iseed, ipitch1,ipitch2,ipitch3,ipitch4,ifnenv
> ; GRAIN SIZE IS SET TO 5 MS, GAP SET TO 50 MS
> ;i1301 0 10 1000 12 1 1 0 1 0 0 0 10 .01 0 .001 40 20 50 .1 1 1 0.3 .5 0
> i1301 0 10 6000 12 1 1 0 1 4 0 0 10 .01 0 .005 40 20 50 .1 1 6 10 15 0
>
>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Give to a good cause with every e-mail. Join the i’m Initiative from Microsoft.