LISTSERV mailing list manager LISTSERV 16.5

Help for CSOUND Archives


CSOUND Archives

CSOUND Archives


CSOUND@LISTSERV.HEANET.IE


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

CSOUND Home

CSOUND Home

CSOUND  March 2016

CSOUND March 2016

Subject:

Re: Making opcodes

From:

Peter Burgess <[log in to unmask]>

Reply-To:

A discussion list for users of Csound <[log in to unmask]>

Date:

Fri, 4 Mar 2016 14:45:32 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (139 lines)

On a slightly different subject, does it matter if I use vectors in
the performance function for the opcode? I am assuming I can't use
them in the struct.

On Fri, Mar 4, 2016 at 1:48 PM, Peter Burgess
<[log in to unmask]> wrote:
> Awesome! thanks very much, that's all pretty clear now :D
>
> On Fri, Mar 4, 2016 at 1:46 PM, Steven Yi <[log in to unmask]> wrote:
>> Yes, all opcode input and output arguments are set as MYFLT* and are
>> treated as addresses to data structures.  For i- and k- arguments,
>> they can be immediately dereferenced as MYFLT values.  For a-, it
>> should be treated as a MYFLT array.  Other variable types need casting
>> to their related data structure (e.g., PVSDAT, STRINGDAT, etc.).
>>
>> Within a performance function, it's not only not a problem, but also
>> recommended to first copy values to a local variables to the function.
>> The general pattern for opcode performance functions (and really,
>> audio plugin systems in general) is:
>>
>> * your state data structure holds state for between runs
>> * during a run, copy all values to local variables on the stack
>> * perform audio processing using local variables
>> * save state once again from the local variables for the next run
>>
>> Using local variables will generally be faster than having to hop
>> around the heap.
>>
>> On Fri, Mar 4, 2016 at 8:26 AM, Peter Burgess
>> <[log in to unmask]> wrote:
>>> boom! that worked, cheers man :D any problem likely to arise from
>>> keeping the varialbes within my performance function as non-pointers?
>>>
>>> ie iSideThreshHi and iSideThreshLo
>>>
>>> On Fri, Mar 4, 2016 at 1:22 PM, Peter Burgess
>>> <[log in to unmask]> wrote:
>>>> ah ok, are they all pointers then? arrays and single value variables alike?
>>>>
>>>> On Fri, Mar 4, 2016 at 1:21 PM, Steven Yi <[log in to unmask]> wrote:
>>>>> I'm pretty sure threshHi and threshlo should also be pointers.
>>>>>
>>>>>
>>>>> On Fri, Mar 4, 2016, 8:19 AM Peter Burgess <[log in to unmask]>
>>>>> wrote:
>>>>>>
>>>>>> I'm having a go at making an opcode again. Come across a snag.
>>>>>>
>>>>>> I have two i-rate input arguments, that aren't passing properly into my
>>>>>> opcode.
>>>>>> This is my set of inputs in the struct:
>>>>>>
>>>>>>     MYFLT *carIn, *modIn, threshLo, threshHi;                 // input
>>>>>> args
>>>>>>
>>>>>> That's 2 a-rate, followed by the 2 i-rate in question. I am doing
>>>>>> nothing with them in the init function, and in the performance
>>>>>> function I am only doing this before trying to use them:
>>>>>>
>>>>>>     MYFLT iSideThreshLo = p->threshLo;
>>>>>>     MYFLT iSideThreshHi = p->threshHi;
>>>>>>
>>>>>> I am passing 0.2 and 0.6 for these parameters in my csd, but when I
>>>>>> monitor the values in my opcode, they look like this:
>>>>>>
>>>>>> p->threshLo = 1.69618e-316
>>>>>> p->threshHi = 1.69618e-316
>>>>>> iSideThreshLo = 1.69618e-316
>>>>>> iSideThreshHi = 1.69618e-316
>>>>>>
>>>>>> I guess that I need to do some more to initialise them or something,
>>>>>> but I can't figure it out, even when having a look through some
>>>>>> existing opcode source.
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>> Pete
>>>>>>
>>>>>> --
>>>>>> http://algorythmradio.com
>>>>>> https://soundcloud.com/algorythmradio
>>>>>>
>>>>>> Csound mailing list
>>>>>> [log in to unmask]
>>>>>> 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
>>>>>
>>>>> Csound mailing list [log in to unmask]
>>>>> 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
>>>>
>>>>
>>>>
>>>> --
>>>> http://algorythmradio.com
>>>> https://soundcloud.com/algorythmradio
>>>
>>>
>>>
>>> --
>>> http://algorythmradio.com
>>> https://soundcloud.com/algorythmradio
>>>
>>> Csound mailing list
>>> [log in to unmask]
>>> 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
>>
>> Csound mailing list
>> [log in to unmask]
>> 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
>
>
>
> --
> http://algorythmradio.com
> https://soundcloud.com/algorythmradio



-- 
http://algorythmradio.com
https://soundcloud.com/algorythmradio

Csound mailing list
[log in to unmask]
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

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015

ATOM RSS1 RSS2



LISTSERV.HEANET.IE

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager