Csound Csound-dev Csound-tekno Search About

[Csnd] Short question about initialization

Date2014-04-08 14:14
Fromhlolli
Subject[Csnd] Short question about initialization
I'm trying to build a counter loop. But I want it to be kind of a stopwatch,
that kndx will intialize once at the beginning but will never reintialize
again. In that way Im hoping to get a stopwatch on different frequency than
normal clock (60BPM). I hope someone will understand this question :)

kndx init 0 ;???
if (kMetro == 1) then
kndx += 1
endif



--
View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-08 15:04
FromRory Walsh
SubjectRe: [Csnd] Short question about initialization
Your use of init is correct, but I'm not sure the "+=" syntax works in
Csound. Try with kndx=kndx+1. Apart from that however, I'm not quite
sure what you are trying to achieve? You can use a "metro" opcode with
whatever frequency you like?

kndx init 0 ;???
kMetro metro myFreq
if (kMetro == 1) then
kndx = kndx+1
endif

On 8 April 2014 14:14, hlolli  wrote:
> I'm trying to build a counter loop. But I want it to be kind of a stopwatch,
> that kndx will intialize once at the beginning but will never reintialize
> again. In that way Im hoping to get a stopwatch on different frequency than
> normal clock (60BPM). I hope someone will understand this question :)
>
> kndx init 0 ;???
> if (kMetro == 1) then
> kndx += 1
> endif
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2014-04-08 15:36
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-04-08 15:42
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-04-08 16:13
Frommskala@ansuz.sooke.bc.ca
SubjectRe: [Csnd] Re:
On Tue, 8 Apr 2014, jpff@cs.bath.ac.uk wrote:
> > kndx init 0 ;???
> > if (kMetro == 1) then
> > kndx += 1
> > endif
>
> So you initialise kndx to zero, and if it ever reaches 1 you make it 2.  But
> it will remain at 0 for ever.....  What are you trying to do?

kMetro isn't kndx, and presumably comes from a metronome opcode.  It looks
like kndx is intended to count the metronome pulses.
-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                 People before principles.
http://ansuz.sooke.bc.ca/

Date2014-04-08 16:36
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-04-08 22:55
Fromhlolli
Subject[Csnd] Re: Re:
Yes Im counting metronome pulses. That way I'm hoping to get integer numbers.
So metronome sends the number 1 on 1 k-rate cycle on a given frequency. This
is just my way of trying to get "stopwatch" sending 1,2,3,4.... etc on a
given metronome frequency. (That way I can define schedkwhen events with my
own conditionals.) But I think an stopwatch opcode would be cool. So it
would almost work identically as times but you would be able to set
different speed. Maybe a stupid idea if it's possible to do that with other
easier methods.

Thanks

-Hlolli



--
View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734027.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-08 23:12
FromRory Walsh
SubjectRe: [Csnd] Re: Re:
Now I get it! This can be done with a line opcode or a phasor. If you
cast to int you can do this:

k1 line 0, p3, p3;
k1 = int(k1)
kTrig changed k1
if(kTrig==1) then
;at every one second interval do something...
enif

Here's some code I use that counts 16 beats per measure using a phasor
set to a user defined tempo(p4). You can probably adapt too your own
needs:

instr 100

kcnt phasor p4
kcnt = int(kcnt*16)     ;16 steps per bar
ktrig changed kcnt     ;notify of change

;on beat 1, 4, 7, and 11 trigger kick instrument
if(ktrig==1 && (kcnt==1 || kcnt==4 || kcnt == 7 || kcnt ==11)) then
event "i", 3, 0, .5, 20000, 100, 1 ;Kick
endif

;on beats 1, 3, 5, 7, 9, 11, and 15 trigger hihat
if(ktrig==1 && (kcnt==1 || kcnt==3 || kcnt == 5 || kcnt ==7 || kcnt
==9 || kcnt ==11 || kcnt ==15)) then
event "i", 1, 0, .5, 10 ;Hihat
endif

;on beat 1 5 and 13 trigger snare
if(ktrig==1 && (kcnt==5 || kcnt ==13)) then
event "i", 2, 0, .5, 10000, 5000, 140, 1 ;Snare
endif

endin

On 8 April 2014 22:55, hlolli  wrote:
> Yes Im counting metronome pulses. That way I'm hoping to get integer numbers.
> So metronome sends the number 1 on 1 k-rate cycle on a given frequency. This
> is just my way of trying to get "stopwatch" sending 1,2,3,4.... etc on a
> given metronome frequency. (That way I can define schedkwhen events with my
> own conditionals.) But I think an stopwatch opcode would be cool. So it
> would almost work identically as times but you would be able to set
> different speed. Maybe a stupid idea if it's possible to do that with other
> easier methods.
>
> Thanks
>
> -Hlolli
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734027.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2014-04-08 23:24
Fromhlolli
Subject[Csnd] Re: Re:
Very cleaver, good solution. I think this is exactly what I'm looking for,
great solution for doing exactly what you did, repetitive beats. But an
opcode for beats would be good. So having opcode fields for how long beat
loop to set(4-8-12 maybe) and how fast to read trough it. I know it's
possible graphically in Blue, an opcode might be nice also, but not
necessary. 

thanks again Rory.



--
View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-08 23:46
FromRory Walsh
SubjectRe: [Csnd] Re: Re:

That would be a relatively easy udo to write. Glad it helped you out.

On 8 Apr 2014 23:24, "hlolli" <hlolli@gmail.com> wrote:
Very cleaver, good solution. I think this is exactly what I'm looking for,
great solution for doing exactly what you did, repetitive beats. But an
opcode for beats would be good. So having opcode fields for how long beat
loop to set(4-8-12 maybe) and how fast to read trough it. I know it's
possible graphically in Blue, an opcode might be nice also, but not
necessary.

thanks again Rory.



--
View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2014-04-11 15:41
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
One thing annoying about phasor is that it doesn't reach the number one on high ksmps rate. On ksmps = 128 the highest value for phasor is  0.99733 so doing == 1 conditional will not trigger. So my workaround is 

if (kPasor > 0.997 ) then

..... etc


(This is a comment but not a question)




2014-04-08 22:46 GMT+00:00 Rory Walsh <rorywalsh@ear.ie>:

That would be a relatively easy udo to write. Glad it helped you out.

On 8 Apr 2014 23:24, "hlolli" <hlolli@gmail.com> wrote:
Very cleaver, good solution. I think this is exactly what I'm looking for,
great solution for doing exactly what you did, repetitive beats. But an
opcode for beats would be good. So having opcode fields for how long beat
loop to set(4-8-12 maybe) and how fast to read trough it. I know it's
possible graphically in Blue, an opcode might be nice also, but not
necessary.

thanks again Rory.



--
View this message in context: http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 15:57
Fromjoachim heintz
SubjectRe: [Csnd] Re: Re:
and if you asked whether the current phasor value is less than the 
previous one?
would this not give you a more reliable answer?


Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
> One thing annoying about phasor is that it doesn't reach the number one
> on high ksmps rate. On ksmps = 128 the highest value for phasor is
>   0.99733 so doing == 1 conditional will not trigger. So my workaround is
>
> if (kPasor > 0.997 ) then
>
> ..... etc
>
>
> (This is a comment but not a question)
>
>
>
>
> 2014-04-08 22:46 GMT+00:00 Rory Walsh  >:
>
>     That would be a relatively easy udo to write. Glad it helped you out.
>
>     On 8 Apr 2014 23:24, "hlolli"      > wrote:
>
>         Very cleaver, good solution. I think this is exactly what I'm
>         looking for,
>         great solution for doing exactly what you did, repetitive beats.
>         But an
>         opcode for beats would be good. So having opcode fields for how
>         long beat
>         loop to set(4-8-12 maybe) and how fast to read trough it. I know
>         it's
>         possible graphically in Blue, an opcode might be nice also, but not
>         necessary.
>
>         thanks again Rory.
>
>
>
>         --
>         View this message in context:
>         http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
>         Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>         Send bugs reports to
>         https://github.com/csound/csound/issues
>         Discussions of bugs and features can be posted here
>         To unsubscribe, send email sympa@lists.bath.ac.uk
>          with body "unsubscribe csound"
>
>
>
>
>
>
> --
> Hlöðver Sigurðsson

Date2014-04-11 16:06
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
Sorry I didn't get it, if the current phasor value is less than what value?


2014-04-11 14:57 GMT+00:00 joachim heintz <jh@joachimheintz.de>:
and if you asked whether the current phasor value is less than the previous one?
would this not give you a more reliable answer?


Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
One thing annoying about phasor is that it doesn't reach the number one
on high ksmps rate. On ksmps = 128 the highest value for phasor is
  0.99733 so doing == 1 conditional will not trigger. So my workaround is

if (kPasor > 0.997 ) then

..... etc


(This is a comment but not a question)




2014-04-08 22:46 GMT+00:00 Rory Walsh <rorywalsh@ear.ie
<mailto:rorywalsh@ear.ie>>:


    That would be a relatively easy udo to write. Glad it helped you out.

    On 8 Apr 2014 23:24, "hlolli" <hlolli@gmail.com
    <mailto:hlolli@gmail.com>> wrote:

        Very cleaver, good solution. I think this is exactly what I'm
        looking for,
        great solution for doing exactly what you did, repetitive beats.
        But an
        opcode for beats would be good. So having opcode fields for how
        long beat
        loop to set(4-8-12 maybe) and how fast to read trough it. I know
        it's
        possible graphically in Blue, an opcode might be nice also, but not
        necessary.

        thanks again Rory.



        --
        View this message in context:
        http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
        Sent from the Csound - General mailing list archive at Nabble.com.


        Send bugs reports to
        https://github.com/csound/csound/issues
        Discussions of bugs and features can be posted here
        To unsubscribe, send email sympa@lists.bath.ac.uk
        <mailto:sympa@lists.bath.ac.uk> with body "unsubscribe csound"






--
Hlöðver Sigurðsson


Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 16:12
FromRory Walsh
SubjectRe: [Csnd] Re: Re:
You could also use a metro with a k-counter starting on 1 instead of
0(untested code):

kcnt init 1
kPulse metro p4
if(kPulse==1) then
   kcnt = (kcnt<17 ? knct+1 : 1)
endif

ktrig changed kcnt     ;notify of change

On 11 April 2014 16:06, Hlöðver Sigurðsson  wrote:
> Sorry I didn't get it, if the current phasor value is less than what value?
>
>
> 2014-04-11 14:57 GMT+00:00 joachim heintz :
>>
>> and if you asked whether the current phasor value is less than the
>> previous one?
>> would this not give you a more reliable answer?
>>
>>
>> Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
>>>
>>> One thing annoying about phasor is that it doesn't reach the number one
>>> on high ksmps rate. On ksmps = 128 the highest value for phasor is
>>>   0.99733 so doing == 1 conditional will not trigger. So my workaround is
>>>
>>> if (kPasor > 0.997 ) then
>>>
>>> ..... etc
>>>
>>>
>>> (This is a comment but not a question)
>>>
>>>
>>>
>>>
>>> 2014-04-08 22:46 GMT+00:00 Rory Walsh >> >:
>>>
>>>
>>>     That would be a relatively easy udo to write. Glad it helped you out.
>>>
>>>     On 8 Apr 2014 23:24, "hlolli" >>     > wrote:
>>>
>>>         Very cleaver, good solution. I think this is exactly what I'm
>>>         looking for,
>>>         great solution for doing exactly what you did, repetitive beats.
>>>         But an
>>>         opcode for beats would be good. So having opcode fields for how
>>>         long beat
>>>         loop to set(4-8-12 maybe) and how fast to read trough it. I know
>>>         it's
>>>         possible graphically in Blue, an opcode might be nice also, but
>>> not
>>>         necessary.
>>>
>>>         thanks again Rory.
>>>
>>>
>>>
>>>         --
>>>         View this message in context:
>>>
>>> http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
>>>         Sent from the Csound - General mailing list archive at
>>> Nabble.com.
>>>
>>>
>>>         Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>>         Discussions of bugs and features can be posted here
>>>         To unsubscribe, send email sympa@lists.bath.ac.uk
>>>          with body "unsubscribe csound"
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Hlöðver Sigurðsson
>>
>>
>>
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
>
> --
> Hlöðver Sigurðsson


Date2014-04-11 16:22
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
Yes brilliant. It's much more stable this way. Thanks!


2014-04-11 15:12 GMT+00:00 Rory Walsh <rorywalsh@ear.ie>:
You could also use a metro with a k-counter starting on 1 instead of
0(untested code):

kcnt init 1
kPulse metro p4
if(kPulse==1) then
   kcnt = (kcnt<17 ? knct+1 : 1)
endif

ktrig changed kcnt     ;notify of change

On 11 April 2014 16:06, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> Sorry I didn't get it, if the current phasor value is less than what value?
>
>
> 2014-04-11 14:57 GMT+00:00 joachim heintz <jh@joachimheintz.de>:
>>
>> and if you asked whether the current phasor value is less than the
>> previous one?
>> would this not give you a more reliable answer?
>>
>>
>> Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
>>>
>>> One thing annoying about phasor is that it doesn't reach the number one
>>> on high ksmps rate. On ksmps = 128 the highest value for phasor is
>>>   0.99733 so doing == 1 conditional will not trigger. So my workaround is
>>>
>>> if (kPasor > 0.997 ) then
>>>
>>> ..... etc
>>>
>>>
>>> (This is a comment but not a question)
>>>
>>>
>>>
>>>
>>> 2014-04-08 22:46 GMT+00:00 Rory Walsh <rorywalsh@ear.ie
>>> <mailto:rorywalsh@ear.ie>>:
>>>
>>>
>>>     That would be a relatively easy udo to write. Glad it helped you out.
>>>
>>>     On 8 Apr 2014 23:24, "hlolli" <hlolli@gmail.com
>>>     <mailto:hlolli@gmail.com>> wrote:
>>>
>>>         Very cleaver, good solution. I think this is exactly what I'm
>>>         looking for,
>>>         great solution for doing exactly what you did, repetitive beats.
>>>         But an
>>>         opcode for beats would be good. So having opcode fields for how
>>>         long beat
>>>         loop to set(4-8-12 maybe) and how fast to read trough it. I know
>>>         it's
>>>         possible graphically in Blue, an opcode might be nice also, but
>>> not
>>>         necessary.
>>>
>>>         thanks again Rory.
>>>
>>>
>>>
>>>         --
>>>         View this message in context:
>>>
>>> http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
>>>         Sent from the Csound - General mailing list archive at
>>> Nabble.com.
>>>
>>>
>>>         Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>>         Discussions of bugs and features can be posted here
>>>         To unsubscribe, send email sympa@lists.bath.ac.uk
>>>         <mailto:sympa@lists.bath.ac.uk> with body "unsubscribe csound"
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Hlöðver Sigurðsson
>>
>>
>>
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
>
> --
> Hlöðver Sigurðsson


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 16:29
FromRory Walsh
SubjectRe: [Csnd] Re: Re:
Please post any improvements you make back to the list so others can
learn about this stuff too ;)

On 11 April 2014 16:22, Hlöðver Sigurðsson  wrote:
> Yes brilliant. It's much more stable this way. Thanks!
>
>
> 2014-04-11 15:12 GMT+00:00 Rory Walsh :
>
>> You could also use a metro with a k-counter starting on 1 instead of
>> 0(untested code):
>>
>> kcnt init 1
>> kPulse metro p4
>> if(kPulse==1) then
>>    kcnt = (kcnt<17 ? knct+1 : 1)
>> endif
>>
>> ktrig changed kcnt     ;notify of change
>>
>> On 11 April 2014 16:06, Hlöðver Sigurðsson  wrote:
>> > Sorry I didn't get it, if the current phasor value is less than what
>> > value?
>> >
>> >
>> > 2014-04-11 14:57 GMT+00:00 joachim heintz :
>> >>
>> >> and if you asked whether the current phasor value is less than the
>> >> previous one?
>> >> would this not give you a more reliable answer?
>> >>
>> >>
>> >> Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
>> >>>
>> >>> One thing annoying about phasor is that it doesn't reach the number
>> >>> one
>> >>> on high ksmps rate. On ksmps = 128 the highest value for phasor is
>> >>>   0.99733 so doing == 1 conditional will not trigger. So my workaround
>> >>> is
>> >>>
>> >>> if (kPasor > 0.997 ) then
>> >>>
>> >>> ..... etc
>> >>>
>> >>>
>> >>> (This is a comment but not a question)
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> 2014-04-08 22:46 GMT+00:00 Rory Walsh > >>> >:
>> >>>
>> >>>
>> >>>     That would be a relatively easy udo to write. Glad it helped you
>> >>> out.
>> >>>
>> >>>     On 8 Apr 2014 23:24, "hlolli" > >>>     > wrote:
>> >>>
>> >>>         Very cleaver, good solution. I think this is exactly what I'm
>> >>>         looking for,
>> >>>         great solution for doing exactly what you did, repetitive
>> >>> beats.
>> >>>         But an
>> >>>         opcode for beats would be good. So having opcode fields for
>> >>> how
>> >>>         long beat
>> >>>         loop to set(4-8-12 maybe) and how fast to read trough it. I
>> >>> know
>> >>>         it's
>> >>>         possible graphically in Blue, an opcode might be nice also,
>> >>> but
>> >>> not
>> >>>         necessary.
>> >>>
>> >>>         thanks again Rory.
>> >>>
>> >>>
>> >>>
>> >>>         --
>> >>>         View this message in context:
>> >>>
>> >>>
>> >>> http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
>> >>>         Sent from the Csound - General mailing list archive at
>> >>> Nabble.com.
>> >>>
>> >>>
>> >>>         Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>>         Discussions of bugs and features can be posted here
>> >>>         To unsubscribe, send email sympa@lists.bath.ac.uk
>> >>>          with body "unsubscribe csound"
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Hlöðver Sigurðsson
>> >>
>> >>
>> >>
>> >> Send bugs reports to
>> >>        https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Hlöðver Sigurðsson
>>
>>
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
>
> --
> Hlöðver Sigurðsson


Date2014-04-11 16:41
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
Ok so I drown you with questions, and yes I don't know how many millions of times I've learned from other peoples question, so I hope this conversation will help someone.

Im having phase problems with metro, Im using a repeat loop (r{}) in score and on new initialization I get WARNING: init phase truncation and the rythmpattern "coughs", the reason Im doing this is that Im trying to see where I can go with evaluation(live coding).  I'm sure its due to the fact that the phase is forced to 1 or 0(depending what is chosen in metro) every 8 bars. What I want csound to do, is not to reintialize things like phase, to have the last phase value the beginning value of the new phase on new initalization. Is that possible?

(Here's the score.)

{9999 LOOP

i 1 [0+8*$LOOP] 8

}



2014-04-11 15:29 GMT+00:00 Rory Walsh <rorywalsh@ear.ie>:
Please post any improvements you make back to the list so others can
learn about this stuff too ;)

On 11 April 2014 16:22, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> Yes brilliant. It's much more stable this way. Thanks!
>
>
> 2014-04-11 15:12 GMT+00:00 Rory Walsh <rorywalsh@ear.ie>:
>
>> You could also use a metro with a k-counter starting on 1 instead of
>> 0(untested code):
>>
>> kcnt init 1
>> kPulse metro p4
>> if(kPulse==1) then
>>    kcnt = (kcnt<17 ? knct+1 : 1)
>> endif
>>
>> ktrig changed kcnt     ;notify of change
>>
>> On 11 April 2014 16:06, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>> > Sorry I didn't get it, if the current phasor value is less than what
>> > value?
>> >
>> >
>> > 2014-04-11 14:57 GMT+00:00 joachim heintz <jh@joachimheintz.de>:
>> >>
>> >> and if you asked whether the current phasor value is less than the
>> >> previous one?
>> >> would this not give you a more reliable answer?
>> >>
>> >>
>> >> Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
>> >>>
>> >>> One thing annoying about phasor is that it doesn't reach the number
>> >>> one
>> >>> on high ksmps rate. On ksmps = 128 the highest value for phasor is
>> >>>   0.99733 so doing == 1 conditional will not trigger. So my workaround
>> >>> is
>> >>>
>> >>> if (kPasor > 0.997 ) then
>> >>>
>> >>> ..... etc
>> >>>
>> >>>
>> >>> (This is a comment but not a question)
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> 2014-04-08 22:46 GMT+00:00 Rory Walsh <rorywalsh@ear.ie
>> >>> <mailto:rorywalsh@ear.ie>>:
>> >>>
>> >>>
>> >>>     That would be a relatively easy udo to write. Glad it helped you
>> >>> out.
>> >>>
>> >>>     On 8 Apr 2014 23:24, "hlolli" <hlolli@gmail.com
>> >>>     <mailto:hlolli@gmail.com>> wrote:
>> >>>
>> >>>         Very cleaver, good solution. I think this is exactly what I'm
>> >>>         looking for,
>> >>>         great solution for doing exactly what you did, repetitive
>> >>> beats.
>> >>>         But an
>> >>>         opcode for beats would be good. So having opcode fields for
>> >>> how
>> >>>         long beat
>> >>>         loop to set(4-8-12 maybe) and how fast to read trough it. I
>> >>> know
>> >>>         it's
>> >>>         possible graphically in Blue, an opcode might be nice also,
>> >>> but
>> >>> not
>> >>>         necessary.
>> >>>
>> >>>         thanks again Rory.
>> >>>
>> >>>
>> >>>
>> >>>         --
>> >>>         View this message in context:
>> >>>
>> >>>
>> >>> http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
>> >>>         Sent from the Csound - General mailing list archive at
>> >>> Nabble.com.
>> >>>
>> >>>
>> >>>         Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>>         Discussions of bugs and features can be posted here
>> >>>         To unsubscribe, send email sympa@lists.bath.ac.uk
>> >>>         <mailto:sympa@lists.bath.ac.uk> with body "unsubscribe csound"
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Hlöðver Sigurðsson
>> >>
>> >>
>> >>
>> >> Send bugs reports to
>> >>        https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Hlöðver Sigurðsson
>>
>>
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
>
> --
> Hlöðver Sigurðsson


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 17:01
FromRory Walsh
SubjectRe: [Csnd] Re: Re:
I've never used any of those score functions. I usually do all my
driving in the orchestra section. Perhaps others can advise on that
particular problem.

On 11 April 2014 16:41, Hlöðver Sigurðsson  wrote:
> Ok so I drown you with questions, and yes I don't know how many millions of
> times I've learned from other peoples question, so I hope this conversation
> will help someone.
>
> Im having phase problems with metro, Im using a repeat loop (r{}) in score
> and on new initialization I get WARNING: init phase truncation and the
> rythmpattern "coughs", the reason Im doing this is that Im trying to see
> where I can go with evaluation(live coding).  I'm sure its due to the fact
> that the phase is forced to 1 or 0(depending what is chosen in metro) every
> 8 bars. What I want csound to do, is not to reintialize things like phase,
> to have the last phase value the beginning value of the new phase on new
> initalization. Is that possible?
>
> (Here's the score.)
>
> {9999 LOOP
>
> i 1 [0+8*$LOOP] 8
>
> }
>
>
>
> 2014-04-11 15:29 GMT+00:00 Rory Walsh :
>
>> Please post any improvements you make back to the list so others can
>> learn about this stuff too ;)
>>
>> On 11 April 2014 16:22, Hlöðver Sigurðsson  wrote:
>> > Yes brilliant. It's much more stable this way. Thanks!
>> >
>> >
>> > 2014-04-11 15:12 GMT+00:00 Rory Walsh :
>> >
>> >> You could also use a metro with a k-counter starting on 1 instead of
>> >> 0(untested code):
>> >>
>> >> kcnt init 1
>> >> kPulse metro p4
>> >> if(kPulse==1) then
>> >>    kcnt = (kcnt<17 ? knct+1 : 1)
>> >> endif
>> >>
>> >> ktrig changed kcnt     ;notify of change
>> >>
>> >> On 11 April 2014 16:06, Hlöðver Sigurðsson  wrote:
>> >> > Sorry I didn't get it, if the current phasor value is less than what
>> >> > value?
>> >> >
>> >> >
>> >> > 2014-04-11 14:57 GMT+00:00 joachim heintz :
>> >> >>
>> >> >> and if you asked whether the current phasor value is less than the
>> >> >> previous one?
>> >> >> would this not give you a more reliable answer?
>> >> >>
>> >> >>
>> >> >> Am 11.04.2014 16:41, schrieb Hlöðver Sigurðsson:
>> >> >>>
>> >> >>> One thing annoying about phasor is that it doesn't reach the number
>> >> >>> one
>> >> >>> on high ksmps rate. On ksmps = 128 the highest value for phasor is
>> >> >>>   0.99733 so doing == 1 conditional will not trigger. So my
>> >> >>> workaround
>> >> >>> is
>> >> >>>
>> >> >>> if (kPasor > 0.997 ) then
>> >> >>>
>> >> >>> ..... etc
>> >> >>>
>> >> >>>
>> >> >>> (This is a comment but not a question)
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> 2014-04-08 22:46 GMT+00:00 Rory Walsh > >> >>> >:
>> >> >>>
>> >> >>>
>> >> >>>     That would be a relatively easy udo to write. Glad it helped
>> >> >>> you
>> >> >>> out.
>> >> >>>
>> >> >>>     On 8 Apr 2014 23:24, "hlolli" > >> >>>     > wrote:
>> >> >>>
>> >> >>>         Very cleaver, good solution. I think this is exactly what
>> >> >>> I'm
>> >> >>>         looking for,
>> >> >>>         great solution for doing exactly what you did, repetitive
>> >> >>> beats.
>> >> >>>         But an
>> >> >>>         opcode for beats would be good. So having opcode fields for
>> >> >>> how
>> >> >>>         long beat
>> >> >>>         loop to set(4-8-12 maybe) and how fast to read trough it. I
>> >> >>> know
>> >> >>>         it's
>> >> >>>         possible graphically in Blue, an opcode might be nice also,
>> >> >>> but
>> >> >>> not
>> >> >>>         necessary.
>> >> >>>
>> >> >>>         thanks again Rory.
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>         --
>> >> >>>         View this message in context:
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> http://csound.1045644.n5.nabble.com/Short-question-about-initialization-tp5734004p5734031.html
>> >> >>>         Sent from the Csound - General mailing list archive at
>> >> >>> Nabble.com.
>> >> >>>
>> >> >>>
>> >> >>>         Send bugs reports to
>> >> >>>         https://github.com/csound/csound/issues
>> >> >>>         Discussions of bugs and features can be posted here
>> >> >>>         To unsubscribe, send email sympa@lists.bath.ac.uk
>> >> >>>          with body "unsubscribe
>> >> >>> csound"
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> Hlöðver Sigurðsson
>> >> >>
>> >> >>
>> >> >>
>> >> >> Send bugs reports to
>> >> >>        https://github.com/csound/csound/issues
>> >> >> Discussions of bugs and features can be posted here
>> >> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> >> "unsubscribe
>> >> >> csound"
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Hlöðver Sigurðsson
>> >>
>> >>
>> >> Send bugs reports to
>> >>         https://github.com/csound/csound/issues
>> >> Discussions of bugs and features can be posted here
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Hlöðver Sigurðsson
>>
>>
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
>
> --
> Hlöðver Sigurðsson


Date2014-04-11 17:06
Fromjoachim heintz
SubjectRe: [Csnd] Re: Re:
Attachmentstest.csd  
i meant something like the code below. maybe it is not your case, but it 
should detect phasor zero crossings at any ksmps.
	joachim






sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

opcode zero_transition, k, kk
;reports if kCurr is lower than kPrev
kCurr, kPrev xin
if kCurr < kPrev then
kOut = 1
else
kOut = 0
endif
xout kOut
endop

instr 1
kPrev init 0
kPhas phasor 1
kPing zero_transition kPhas, kPrev
if kPing == 1 then
printks "Zero crossing detected!\n", 0
endif
kPrev = kPhas
endin



i 1 0 100



Date2014-04-11 17:18
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
Attachmentshlolli.csd  
You could try running this Joachim and see if you know why it is "coughing"?

thanks!


2014-04-11 16:06 GMT+00:00 joachim heintz <jh@joachimheintz.de>:
i meant something like the code below. maybe it is not your case, but it should detect phasor zero crossings at any ksmps.
        joachim


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

opcode zero_transition, k, kk
;reports if kCurr is lower than kPrev
kCurr, kPrev xin
if kCurr < kPrev then
kOut = 1
else
kOut = 0
endif
xout kOut
endop

instr 1
kPrev init 0
kPhas phasor 1
kPing zero_transition kPhas, kPrev
if kPing == 1 then
printks "Zero crossing detected!\n", 0
endif
kPrev = kPhas
endin

</CsInstruments>
<CsScore>
i 1 0 100
</CsScore>
</CsoundSynthesizer>


Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 17:40
FromJustin Smith
SubjectRe: [Csnd] Re: Re:
Attachmentsepsilon.csd  
since csound uses floating point so much, maybe there should be an `epsilon` opcode?

Attached is a csd with one possible version as a UDO.


On Fri, Apr 11, 2014 at 9:18 AM, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
You could try running this Joachim and see if you know why it is "coughing"?

thanks!


2014-04-11 16:06 GMT+00:00 joachim heintz <jh@joachimheintz.de>:

i meant something like the code below. maybe it is not your case, but it should detect phasor zero crossings at any ksmps.
        joachim


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

opcode zero_transition, k, kk
;reports if kCurr is lower than kPrev
kCurr, kPrev xin
if kCurr < kPrev then
kOut = 1
else
kOut = 0
endif
xout kOut
endop

instr 1
kPrev init 0
kPhas phasor 1
kPing zero_transition kPhas, kPrev
if kPing == 1 then
printks "Zero crossing detected!\n", 0
endif
kPrev = kPhas
endin

</CsInstruments>
<CsScore>
i 1 0 100
</CsScore>
</CsoundSynthesizer>


Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson


Date2014-04-11 17:51
Fromjoachim heintz
SubjectRe: [Csnd] Re: Re:
sorry, this time i don't get it really -- but the phasor-trigger seems 
to work, does it not? by the way, when you use schedkwhen, you can 
simply write:
   instr 1
kPrev init 0
kPhas phasor 1
kPing zero_transition kPhas, kPrev
schedkwhen kPing, 0, 0, 2, 0, .2, 60
kPrev = kPhas
   endin

	joachim

Am 11.04.2014 18:18, schrieb Hlöðver Sigurðsson:
> You could try running this Joachim and see if you know why it is "coughing"?
>
> thanks!
>
>
> 2014-04-11 16:06 GMT+00:00 joachim heintz  >:
>
>     i meant something like the code below. maybe it is not your case,
>     but it should detect phasor zero crossings at any ksmps.
>              joachim
>
>
>     
>     
>     
>     
>     sr = 44100
>     ksmps = 32
>     nchnls = 2
>     0dbfs = 1
>
>     opcode zero_transition, k, kk
>     ;reports if kCurr is lower than kPrev
>     kCurr, kPrev xin
>     if kCurr < kPrev then
>     kOut = 1
>     else
>     kOut = 0
>     endif
>     xout kOut
>     endop
>
>     instr 1
>     kPrev init 0
>     kPhas phasor 1
>     kPing zero_transition kPhas, kPrev
>     if kPing == 1 then
>     printks "Zero crossing detected!\n", 0
>     endif
>     kPrev = kPhas
>     endin
>
>     
>     
>     i 1 0 100
>     
>     
>
>
>     Send bugs reports to
>     https://github.com/csound/__csound/issues
>     
>     Discussions of bugs and features can be posted here
>     To unsubscribe, send email sympa@lists.bath.ac.uk
>      with body "unsubscribe csound"
>
>
>
>
>
>
> --
> Hlöðver Sigurðsson

Date2014-04-11 18:07
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
Attachmentshlolli_csd.wav  
The phasor trigger workes! 
But it(in my usage) skips and starts to act weirdly when Im using multiple initializations. For example skipping and doing other. Here I have the phasor at 2Hz so it sounds much more clear.


2014-04-11 16:51 GMT+00:00 joachim heintz <jh@joachimheintz.de>:
sorry, this time i don't get it really -- but the phasor-trigger seems to work, does it not? by the way, when you use schedkwhen, you can simply write:
  instr 1
kPrev init 0
kPhas phasor 1
kPing zero_transition kPhas, kPrev
schedkwhen kPing, 0, 0, 2, 0, .2, 60
kPrev = kPhas
  endin

        joachim

Am 11.04.2014 18:18, schrieb Hlöðver Sigurðsson:
You could try running this Joachim and see if you know why it is "coughing"?

thanks!


2014-04-11 16:06 GMT+00:00 joachim heintz <jh@joachimheintz.de
<mailto:jh@joachimheintz.de>>:


    i meant something like the code below. maybe it is not your case,
    but it should detect phasor zero crossings at any ksmps.
             joachim


    <CsoundSynthesizer>
    <CsOptions>
    </CsOptions>
    <CsInstruments>
    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs = 1

    opcode zero_transition, k, kk
    ;reports if kCurr is lower than kPrev
    kCurr, kPrev xin
    if kCurr < kPrev then
    kOut = 1
    else
    kOut = 0
    endif
    xout kOut
    endop

    instr 1
    kPrev init 0
    kPhas phasor 1
    kPing zero_transition kPhas, kPrev
    if kPing == 1 then
    printks "Zero crossing detected!\n", 0
    endif
    kPrev = kPhas
    endin

    </CsInstruments>
    <CsScore>
    i 1 0 100
    </CsScore>
    </CsoundSynthesizer>


    Send bugs reports to
    https://github.com/csound/__csound/issues

    <https://github.com/csound/csound/issues>
    Discussions of bugs and features can be posted here
    To unsubscribe, send email sympa@lists.bath.ac.uk
    <mailto:sympa@lists.bath.ac.uk> with body "unsubscribe csound"






--
Hlöðver Sigurðsson


Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 18:20
Fromjoachim heintz
SubjectRe: [Csnd] Re: Re:
yes but this has something to do with the score loop you are using.
similar to rory i have no idea about it, so i can't help ...


Am 11.04.2014 19:07, schrieb Hlöðver Sigurðsson:
> The phasor trigger workes!
> But it(in my usage) skips and starts to act weirdly when Im using
> multiple initializations. For example skipping and doing other. Here I
> have the phasor at 2Hz so it sounds much more clear.
>
>
> 2014-04-11 16:51 GMT+00:00 joachim heintz  >:
>
>     sorry, this time i don't get it really -- but the phasor-trigger
>     seems to work, does it not? by the way, when you use schedkwhen, you
>     can simply write:
>        instr 1
>     kPrev init 0
>     kPhas phasor 1
>     kPing zero_transition kPhas, kPrev
>     schedkwhen kPing, 0, 0, 2, 0, .2, 60
>     kPrev = kPhas
>        endin
>
>              joachim
>
>     Am 11.04.2014 18:18, schrieb Hlöðver Sigurðsson:
>
>         You could try running this Joachim and see if you know why it is
>         "coughing"?
>
>         thanks!
>
>
>         2014-04-11 16:06 GMT+00:00 joachim heintz          
>         >>:
>
>
>              i meant something like the code below. maybe it is not your
>         case,
>              but it should detect phasor zero crossings at any ksmps.
>                       joachim
>
>
>              
>              
>              
>              
>              sr = 44100
>              ksmps = 32
>              nchnls = 2
>              0dbfs = 1
>
>              opcode zero_transition, k, kk
>              ;reports if kCurr is lower than kPrev
>              kCurr, kPrev xin
>              if kCurr < kPrev then
>              kOut = 1
>              else
>              kOut = 0
>              endif
>              xout kOut
>              endop
>
>              instr 1
>              kPrev init 0
>              kPhas phasor 1
>              kPing zero_transition kPhas, kPrev
>              if kPing == 1 then
>              printks "Zero crossing detected!\n", 0
>              endif
>              kPrev = kPhas
>              endin
>
>              
>              
>              i 1 0 100
>              
>              
>
>
>              Send bugs reports to
>         https://github.com/csound/____csound/issues
>         
>
>                       >
>              Discussions of bugs and features can be posted here
>              To unsubscribe, send email sympa@lists.bath.ac.uk
>         
>                       __> with body "unsubscribe csound"
>
>
>
>
>
>
>         --
>         Hlöðver Sigurðsson
>
>
>
>     Send bugs reports to
>     https://github.com/csound/__csound/issues
>     
>     Discussions of bugs and features can be posted here
>     To unsubscribe, send email sympa@lists.bath.ac.uk
>      with body "unsubscribe csound"
>
>
>
>
>
>
> --
> Hlöðver Sigurðsson

Date2014-04-11 19:02
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Re: Re:
Loop {} or not, still same (phase?) problems.
I'll let you guys know if I find solution for this
thanks for your patience.

i 1 0 8
i 1 8 8
i 1 16 8
i 1 24 8
i 1 32 8
etc....


2014-04-11 17:20 GMT+00:00 joachim heintz <jh@joachimheintz.de>:
yes but this has something to do with the score loop you are using.
similar to rory i have no idea about it, so i can't help ...


Am 11.04.2014 19:07, schrieb Hlöðver Sigurðsson:
The phasor trigger workes!
But it(in my usage) skips and starts to act weirdly when Im using
multiple initializations. For example skipping and doing other. Here I
have the phasor at 2Hz so it sounds much more clear.


2014-04-11 16:51 GMT+00:00 joachim heintz <jh@joachimheintz.de
<mailto:jh@joachimheintz.de>>:


    sorry, this time i don't get it really -- but the phasor-trigger
    seems to work, does it not? by the way, when you use schedkwhen, you
    can simply write:
       instr 1
    kPrev init 0
    kPhas phasor 1
    kPing zero_transition kPhas, kPrev
    schedkwhen kPing, 0, 0, 2, 0, .2, 60
    kPrev = kPhas
       endin

             joachim

    Am 11.04.2014 18:18, schrieb Hlöðver Sigurðsson:

        You could try running this Joachim and see if you know why it is
        "coughing"?

        thanks!


        2014-04-11 16:06 GMT+00:00 joachim heintz <jh@joachimheintz.de
        <mailto:jh@joachimheintz.de>
        <mailto:jh@joachimheintz.de <mailto:jh@joachimheintz.de>>>:



             i meant something like the code below. maybe it is not your
        case,
             but it should detect phasor zero crossings at any ksmps.
                      joachim


             <CsoundSynthesizer>
             <CsOptions>
             </CsOptions>
             <CsInstruments>
             sr = 44100
             ksmps = 32
             nchnls = 2
             0dbfs = 1

             opcode zero_transition, k, kk
             ;reports if kCurr is lower than kPrev
             kCurr, kPrev xin
             if kCurr < kPrev then
             kOut = 1
             else
             kOut = 0
             endif
             xout kOut
             endop

             instr 1
             kPrev init 0
             kPhas phasor 1
             kPing zero_transition kPhas, kPrev
             if kPing == 1 then
             printks "Zero crossing detected!\n", 0
             endif
             kPrev = kPhas
             endin

             </CsInstruments>
             <CsScore>
             i 1 0 100
             </CsScore>
             </CsoundSynthesizer>


             Send bugs reports to
        https://github.com/csound/____csound/issues
        <https://github.com/csound/__csound/issues>


             <https://github.com/csound/__csound/issues
        <https://github.com/csound/csound/issues>>
             Discussions of bugs and features can be posted here
             To unsubscribe, send email sympa@lists.bath.ac.uk
        <mailto:sympa@lists.bath.ac.uk>
             <mailto:sympa@lists.bath.ac.uk
        <mailto:sympa@lists.bath.ac.uk>__> with body "unsubscribe csound"







        --
        Hlöðver Sigurðsson



    Send bugs reports to
    https://github.com/csound/__csound/issues
    <https://github.com/csound/csound/issues>
    Discussions of bugs and features can be posted here
    To unsubscribe, send email sympa@lists.bath.ac.uk
    <mailto:sympa@lists.bath.ac.uk> with body "unsubscribe csound"






--
Hlöðver Sigurðsson


Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"






--
Hlöðver Sigurðsson

Date2014-04-11 19:15
FromRory Walsh
SubjectRe: [Csnd] Re: Re:
AttachmentssimpleSequencer.csd  
Try this one, I don't hear any problem with syncing? You may need to
change the CsOptions.

On 11 April 2014 19:02, Hlöðver Sigurðsson  wrote:
> Loop {} or not, still same (phase?) problems.
> I'll let you guys know if I find solution for this
> thanks for your patience.
>
> i 1 0 8
> i 1 8 8
> i 1 16 8
> i 1 24 8
> i 1 32 8
> etc....
>
>
> 2014-04-11 17:20 GMT+00:00 joachim heintz :
>
>> yes but this has something to do with the score loop you are using.
>> similar to rory i have no idea about it, so i can't help ...
>>
>>
>> Am 11.04.2014 19:07, schrieb Hlöðver Sigurðsson:
>>>
>>> The phasor trigger workes!
>>> But it(in my usage) skips and starts to act weirdly when Im using
>>> multiple initializations. For example skipping and doing other. Here I
>>> have the phasor at 2Hz so it sounds much more clear.
>>>
>>>
>>> 2014-04-11 16:51 GMT+00:00 joachim heintz >> >:
>>>
>>>
>>>     sorry, this time i don't get it really -- but the phasor-trigger
>>>     seems to work, does it not? by the way, when you use schedkwhen, you
>>>     can simply write:
>>>        instr 1
>>>     kPrev init 0
>>>     kPhas phasor 1
>>>     kPing zero_transition kPhas, kPrev
>>>     schedkwhen kPing, 0, 0, 2, 0, .2, 60
>>>     kPrev = kPhas
>>>        endin
>>>
>>>              joachim
>>>
>>>     Am 11.04.2014 18:18, schrieb Hlöðver Sigurðsson:
>>>
>>>         You could try running this Joachim and see if you know why it is
>>>         "coughing"?
>>>
>>>         thanks!
>>>
>>>
>>>         2014-04-11 16:06 GMT+00:00 joachim heintz >>         
>>>         >>:
>>>
>>>
>>>
>>>              i meant something like the code below. maybe it is not your
>>>         case,
>>>              but it should detect phasor zero crossings at any ksmps.
>>>                       joachim
>>>
>>>
>>>              
>>>              
>>>              
>>>              
>>>              sr = 44100
>>>              ksmps = 32
>>>              nchnls = 2
>>>              0dbfs = 1
>>>
>>>              opcode zero_transition, k, kk
>>>              ;reports if kCurr is lower than kPrev
>>>              kCurr, kPrev xin
>>>              if kCurr < kPrev then
>>>              kOut = 1
>>>              else
>>>              kOut = 0
>>>              endif
>>>              xout kOut
>>>              endop
>>>
>>>              instr 1
>>>              kPrev init 0
>>>              kPhas phasor 1
>>>              kPing zero_transition kPhas, kPrev
>>>              if kPing == 1 then
>>>              printks "Zero crossing detected!\n", 0
>>>              endif
>>>              kPrev = kPhas
>>>              endin
>>>
>>>              
>>>              
>>>              i 1 0 100
>>>              
>>>              
>>>
>>>
>>>              Send bugs reports to
>>>         https://github.com/csound/____csound/issues
>>>         
>>>
>>>
>>>              >>         >
>>>              Discussions of bugs and features can be posted here
>>>              To unsubscribe, send email sympa@lists.bath.ac.uk
>>>         
>>>              >>         __> with body "unsubscribe csound"
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>         --
>>>         Hlöðver Sigurðsson
>>>
>>>
>>>
>>>     Send bugs reports to
>>>     https://github.com/csound/__csound/issues
>>>     
>>>     Discussions of bugs and features can be posted here
>>>     To unsubscribe, send email sympa@lists.bath.ac.uk
>>>      with body "unsubscribe csound"
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Hlöðver Sigurðsson
>>
>>
>>
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
>
> --
> Hlöðver Sigurðsson