Csound Csound-dev Csound-tekno Search About

Loopseg at a-rate

Date2016-12-14 01:35
FromPeter Burgess
SubjectLoopseg at a-rate
I would like to use loopseg at a-rate, so I'm going to edit the source
and try to add that functionality.

I'm looking at the sources for both linseg and loopseg now, to
determine how the a-rate version is handled in linseg, so I can keep
things as simllar as possible for loopseg. The first thing I want to
ask about is the bit where they are added to OENTRY:

{ "linseg", S(LINSEG),0, 3, "k", "iim", lsgset, klnseg, NULL },
{ "linseg.a", S(LINSEG),0, 5, "a", "iim", lsgset, NULL, linseg },

I assumed that you would add the function "linseg" to the end of the
first entry, rather than create it's own entry for the a-rate version.
Is this because the initialisation function is slightly different?
Also, I'm guessing that simply adding ".a" to the opcodes name
automatically lets csound know that this is the a-rate version does
it?

Date2016-12-14 19:31
Fromjpff
SubjectRe: Loopseg at a-rate
On Wed, 14 Dec 2016, Peter Burgess wrote:

> I would like to use loopseg at a-rate, so I'm going to edit the source
> and try to add that functionality.
>
> I'm looking at the sources for both linseg and loopseg now, to
> determine how the a-rate version is handled in linseg, so I can keep
> things as simllar as possible for loopseg. The first thing I want to
> ask about is the bit where they are added to OENTRY:
>
> { "linseg", S(LINSEG),0, 3, "k", "iim", lsgset, klnseg, NULL },
> { "linseg.a", S(LINSEG),0, 5, "a", "iim", lsgset, NULL, linseg },
>
> I assumed that you would add the function "linseg" to the end of the
> first entry, rather than create it's own entry for the a-rate version.

No; if it works at a rate in needs a 5 as 4th arg

> Is this because the initialisation function is slightly different?
> Also, I'm guessing that simply adding ".a" to the opcodes name
> automatically lets csound know that this is the a-rate version does
> it?

No.  The .a is documentation that aids debugging as we know which vesion 
was triggeed

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-12-14 19:59
FromPeter Burgess
SubjectRe: Loopseg at a-rate
Thanks for the clarification! Although, couldn't all three functions
in the example above be in one row, but with a 7 as the 4th arguement?
Or is it because of debugging, as you mentioned, that it was chosen to
have a seperate .a?

On Wed, Dec 14, 2016 at 7:31 PM, jpff  wrote:
> On Wed, 14 Dec 2016, Peter Burgess wrote:
>
>> I would like to use loopseg at a-rate, so I'm going to edit the source
>> and try to add that functionality.
>>
>> I'm looking at the sources for both linseg and loopseg now, to
>> determine how the a-rate version is handled in linseg, so I can keep
>> things as simllar as possible for loopseg. The first thing I want to
>> ask about is the bit where they are added to OENTRY:
>>
>> { "linseg", S(LINSEG),0, 3, "k", "iim", lsgset, klnseg, NULL },
>> { "linseg.a", S(LINSEG),0, 5, "a", "iim", lsgset, NULL, linseg },
>>
>> I assumed that you would add the function "linseg" to the end of the
>> first entry, rather than create it's own entry for the a-rate version.
>
>
> No; if it works at a rate in needs a 5 as 4th arg
>
>> Is this because the initialisation function is slightly different?
>> Also, I'm guessing that simply adding ".a" to the opcodes name
>> automatically lets csound know that this is the a-rate version does
>> it?
>
>
> No.  The .a is documentation that aids debugging as we know which vesion was
> triggeed
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Date2016-12-14 20:17
Fromjpff
SubjectRe: Loopseg at a-rate
On Wed, 14 Dec 2016, Peter Burgess wrote:

> Thanks for the clarification! Although, couldn't all three functions
> in the example above be in one row, but with a 7 as the 4th arguement?
> Or is it because of debugging, as you mentioned, that it was chosen to
> have a seperate .a?

It cannot be all one as output arguments differ.  One could unify with a x 
output but that complicates the code

In earlier versions of csound the .a or .k was necessary for parsing. 
Newer versions select on signature.

I have not been following e-mail recently so not sure what you are 
attempting to achieve.  If you want the segments to change while 
performing you have many problems, like the current segment vanishing 
under your feet.

At present the segments are type i (m is arbitary number of i's); can you 
describe what you want -- sorry to be slow

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-12-14 20:20
FromPeter Burgess
SubjectRe: Loopseg at a-rate
That's quite alright! I only started posting about this in the early
hours, haha. But I've posted some info in my other thread regarding
this, so I'll post a little more info there...

On Wed, Dec 14, 2016 at 8:17 PM, jpff  wrote:
> On Wed, 14 Dec 2016, Peter Burgess wrote:
>
>> Thanks for the clarification! Although, couldn't all three functions
>> in the example above be in one row, but with a 7 as the 4th arguement?
>> Or is it because of debugging, as you mentioned, that it was chosen to
>> have a seperate .a?
>
>
> It cannot be all one as output arguments differ.  One could unify with a x
> output but that complicates the code
>
> In earlier versions of csound the .a or .k was necessary for parsing. Newer
> versions select on signature.
>
> I have not been following e-mail recently so not sure what you are
> attempting to achieve.  If you want the segments to change while performing
> you have many problems, like the current segment vanishing under your feet.
>
> At present the segments are type i (m is arbitary number of i's); can you
> describe what you want -- sorry to be slow
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here