Csound Csound-dev Csound-tekno Search About

[Csnd] Csound 6 behavior of timeinsts within UDO

Date2014-03-28 16:51
Fromcognition
Subject[Csnd] Csound 6 behavior of timeinsts within UDO
I wondered if some of you on the list might be able to have a look at the code I've written, and perhaps provide an explanation of why it doesn't work the way I expect it to with Csound 6. For some reason, when I use timeinsts in a user defined opcode, it gives an output of zero. I've copied the csd file below. Thanks for the help!

<CsoundSynthesizer>

<CsOptions>

-n    ; NO SOUND

</CsOptions>

<CsInstruments>

; HEADER

sr    =    44100
kr    =    4410
ksmps    =    10
nchnls    =    2


; USER DEFINED OPCODES

opcode testtime, 0, kk

    kinput, kthresh    xin

    ktime timeinsts

    if (kinput > kthresh) then

        printk2 ktime

    endif

endop


instr 1

    kthresh = 0.9999

    knoise    rand    1, 4      

    ktime timeinsts            ; COMMENT THESE LINES TO TEST USER DEFINED OPCODE
                            ;  
    if (knoise > kthresh) then    ;  
                            ;  
        printk2 ktime            ;  
                            ;  
    endif                    ;  


;            testtime    knoise, kthresh        ; USER DEFINED OPCODE

endin

</CsInstruments>

<CsScore>

i 1 0 120    ; RUN instr 1 FOR 2 MINUTES

</CsScore>

</CsoundSynthesizer>


Date2014-03-28 17:40
FromVictor Lazzarini
SubjectRe: [Csnd] Csound 6 behavior of timeinsts within UDO
With the current develop code I get (by commenting in the UDO code, and commenting out the instrument code)

 i1     3.47868
 i1    12.49320
 i1    13.54875
 i1    18.33946
 i1    27.35397
 i1    28.40952
 i1    33.20023
 i1    42.21474
 i1    43.27029
 i1    48.06100
 i1    57.07551
 i1    58.13107
 i1    62.92177
 i1    71.93628
 i1    72.99184
 i1    77.78254
 i1    86.79705
 i1    87.85261
 i1    92.64331
 i1   101.65782
 i1   102.71338
 i1   107.50408
 i1   116.51859
 i1   117.57415



========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 28 Mar 2014, at 16:51, cognition  wrote:

> I wondered if some of you on the list might be able to have a look at the code I've written, and perhaps provide an explanation of why it doesn't work the way I expect it to with Csound 6. For some reason, when I use timeinsts in a user defined opcode, it gives an output of zero. I've copied the csd file below. Thanks for the help!
> 
> 
> 
> 
> 
> -n    ; NO SOUND
> 
> 
> 
> 
> 
> ; HEADER
> 
> sr    =    44100
> kr    =    4410
> ksmps    =    10
> nchnls    =    2
> 
> 
> ; USER DEFINED OPCODES
> 
> opcode testtime, 0, kk
> 
>     kinput, kthresh    xin
> 
>     ktime timeinsts
> 
>     if (kinput > kthresh) then
> 
>         printk2 ktime
> 
>     endif
> 
> endop
> 
> 
> instr 1
> 
>     kthresh = 0.9999
> 
>     knoise    rand    1, 4       
> 
>     ktime timeinsts            ; COMMENT THESE LINES TO TEST USER DEFINED OPCODE
>                             ;   
>     if (knoise > kthresh) then    ;   
>                             ;   
>         printk2 ktime            ;   
>                             ;   
>     endif                    ;   
> 
> 
> ;            testtime    knoise, kthresh        ; USER DEFINED OPCODE
> 
> endin
> 
> 
> 
> 
> 
> i 1 0 120    ; RUN instr 1 FOR 2 MINUTES
> 
> 
> 
> 
> 



Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2014-03-29 17:06
Fromcognition
SubjectRe: [Csnd] Csound 6 behavior of timeinsts within UDO
That fixed it - I still had version 6.00. Should have thought of that. :P Thanks!


On Fri, Mar 28, 2014 at 10:40 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
With the current develop code I get (by commenting in the UDO code, and commenting out the instrument code)

 i1     3.47868
 i1    12.49320
 i1    13.54875
 i1    18.33946
 i1    27.35397
 i1    28.40952
 i1    33.20023
 i1    42.21474
 i1    43.27029
 i1    48.06100
 i1    57.07551
 i1    58.13107
 i1    62.92177
 i1    71.93628
 i1    72.99184
 i1    77.78254
 i1    86.79705
 i1    87.85261
 i1    92.64331
 i1   101.65782
 i1   102.71338
 i1   107.50408
 i1   116.51859
 i1   117.57415



========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 28 Mar 2014, at 16:51, cognition <fixation.cognition@gmail.com> wrote:

> I wondered if some of you on the list might be able to have a look at the code I've written, and perhaps provide an explanation of why it doesn't work the way I expect it to with Csound 6. For some reason, when I use timeinsts in a user defined opcode, it gives an output of zero. I've copied the csd file below. Thanks for the help!
>
> <CsoundSynthesizer>
>
> <CsOptions>
>
> -n    ; NO SOUND
>
> </CsOptions>
>
> <CsInstruments>
>
> ; HEADER
>
> sr    =    44100
> kr    =    4410
> ksmps    =    10
> nchnls    =    2
>
>
> ; USER DEFINED OPCODES
>
> opcode testtime, 0, kk
>
>     kinput, kthresh    xin
>
>     ktime timeinsts
>
>     if (kinput > kthresh) then
>
>         printk2 ktime
>
>     endif
>
> endop
>
>
> instr 1
>
>     kthresh = 0.9999
>
>     knoise    rand    1, 4
>
>     ktime timeinsts            ; COMMENT THESE LINES TO TEST USER DEFINED OPCODE
>                             ;
>     if (knoise > kthresh) then    ;
>                             ;
>         printk2 ktime            ;
>                             ;
>     endif                    ;
>
>
> ;            testtime    knoise, kthresh        ; USER DEFINED OPCODE
>
> endin
>
> </CsInstruments>
>
> <CsScore>
>
> i 1 0 120    ; RUN instr 1 FOR 2 MINUTES
>
> </CsScore>
>
> </CsoundSynthesizer>
>



Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"