Csound Csound-dev Csound-tekno Search About

[Csnd] pycalln

Date2013-05-19 20:30
FromOeyvind Brandtsegg
Subject[Csnd] pycalln

I'm puzzled over the pycalln opcode,
it seems not to work as expected.
Could perhaps someone else test the csd (below) and report?
best
Oeyvind

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

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

    pyinit
    pyruni "def getNum(one, two):return float(one),float(two),float(3)"
   
    instr 1
   
    k1        init 0
    k2        init 0
    k3        init 0

; Works fine
;    k1,k2,k3        pycall3 "getNum", 1, 2

; The following give a Python error:
; TypeError: getNum() takes exactly 2 arguments (3 given)
;            pycalln "getNum", 3, k1, k2, k3, 1, 2   
           
; When trying to use only one input argument (even if I expect the python function to need 2),
; it seems to run fine, but the input argument seems to be lost,
; as it returns 0.0, 0.0, 3.0
            pycalln "getNum", 3, k1, k2, k3, 1
           
    printk2 k1
    printk2 k2
    printk2 k3
    endin

</CsInstruments>
<CsScore>
;    start    dur   
i1    0    1   
e
</CsScore>
</CsoundSynthesizer>
--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

Date2013-05-20 00:54
Frompeiman khosravi
SubjectRe: [Csnd] pycalln
I get this on Csound6. Seems to work:

SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     0.00000
 i1     3.00000
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
Score finished in csoundPerformKsmps().
inactive allocs returned to freespace
end of score.              overall amps:  0.00000  0.00000
           overall samples out of range:        0        0
0 errors in performance







www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 May 2013 20:30, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:

I'm puzzled over the pycalln opcode,
it seems not to work as expected.
Could perhaps someone else test the csd (below) and report?
best
Oeyvind

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

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

    pyinit
    pyruni "def getNum(one, two):return float(one),float(two),float(3)"
   
    instr 1
   
    k1        init 0
    k2        init 0
    k3        init 0

; Works fine
;    k1,k2,k3        pycall3 "getNum", 1, 2

; The following give a Python error:
; TypeError: getNum() takes exactly 2 arguments (3 given)
;            pycalln "getNum", 3, k1, k2, k3, 1, 2   
           
; When trying to use only one input argument (even if I expect the python function to need 2),
; it seems to run fine, but the input argument seems to be lost,
; as it returns 0.0, 0.0, 3.0
            pycalln "getNum", 3, k1, k2, k3, 1
           
    printk2 k1
    printk2 k2
    printk2 k3
    endin

</CsInstruments>
<CsScore>
;    start    dur   
i1    0    1   
e
</CsScore>
</CsoundSynthesizer>
--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


Date2013-05-20 12:06
FromOeyvind Brandtsegg
SubjectRe: [Csnd] pycalln
Thanks for testing, but it does not seem to work on your setup either,
it should have returned
 i1     1.00000
 i1     0.00000
 i1     3.00000
or preferably
 i1     1.00000
 i1     2.00000
 i1     3.00000
(if it would accept both arguments)

I get the same as you
 i1     0.00000
 i1     0.00000
 i1     3.00000
which indicates that the arguments are not passed from csound to the python function

best
Oeyvind


2013/5/20 peiman khosravi <peimankhosravi@gmail.com>
I get this on Csound6. Seems to work:

SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     0.00000
 i1     3.00000
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
Score finished in csoundPerformKsmps().
inactive allocs returned to freespace
end of score.              overall amps:  0.00000  0.00000
           overall samples out of range:        0        0
0 errors in performance







www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 May 2013 20:30, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:

I'm puzzled over the pycalln opcode,
it seems not to work as expected.
Could perhaps someone else test the csd (below) and report?
best
Oeyvind

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

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

    pyinit
    pyruni "def getNum(one, two):return float(one),float(two),float(3)"
   
    instr 1
   
    k1        init 0
    k2        init 0
    k3        init 0

; Works fine
;    k1,k2,k3        pycall3 "getNum", 1, 2

; The following give a Python error:
; TypeError: getNum() takes exactly 2 arguments (3 given)
;            pycalln "getNum", 3, k1, k2, k3, 1, 2   
           
; When trying to use only one input argument (even if I expect the python function to need 2),
; it seems to run fine, but the input argument seems to be lost,
; as it returns 0.0, 0.0, 3.0
            pycalln "getNum", 3, k1, k2, k3, 1
           
    printk2 k1
    printk2 k2
    printk2 k3
    endin

</CsInstruments>
<CsScore>
;    start    dur   
i1    0    1   
e
</CsScore>
</CsoundSynthesizer>
--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp




--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

Date2013-05-20 12:20
Frompeiman khosravi
SubjectRe: [Csnd] pycalln
Ah sorry, I didn't look at the csd properly. 






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 20 May 2013 12:06, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Thanks for testing, but it does not seem to work on your setup either,
it should have returned
 i1     1.00000
 i1     0.00000
 i1     3.00000
or preferably
 i1     1.00000
 i1     2.00000
 i1     3.00000
(if it would accept both arguments)

I get the same as you
 i1     0.00000
 i1     0.00000
 i1     3.00000
which indicates that the arguments are not passed from csound to the python function

best
Oeyvind


2013/5/20 peiman khosravi <peimankhosravi@gmail.com>
I get this on Csound6. Seems to work:

SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     0.00000
 i1     3.00000
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
Score finished in csoundPerformKsmps().
inactive allocs returned to freespace
end of score.              overall amps:  0.00000  0.00000
           overall samples out of range:        0        0
0 errors in performance







www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 19 May 2013 20:30, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:

I'm puzzled over the pycalln opcode,
it seems not to work as expected.
Could perhaps someone else test the csd (below) and report?
best
Oeyvind

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

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

    pyinit
    pyruni "def getNum(one, two):return float(one),float(two),float(3)"
   
    instr 1
   
    k1        init 0
    k2        init 0
    k3        init 0

; Works fine
;    k1,k2,k3        pycall3 "getNum", 1, 2

; The following give a Python error:
; TypeError: getNum() takes exactly 2 arguments (3 given)
;            pycalln "getNum", 3, k1, k2, k3, 1, 2   
           
; When trying to use only one input argument (even if I expect the python function to need 2),
; it seems to run fine, but the input argument seems to be lost,
; as it returns 0.0, 0.0, 3.0
            pycalln "getNum", 3, k1, k2, k3, 1
           
    printk2 k1
    printk2 k2
    printk2 k3
    endin

</CsInstruments>
<CsScore>
;    start    dur   
i1    0    1   
e
</CsScore>
</CsoundSynthesizer>
--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp




--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp