| Do I recall correctly that something like this (opcodes embedded as
parameters) used to be possible within Music360?
Art Hunkins
----- Original Message -----
From: "Victor"
To: "Developer discussions"
Sent: Thursday, April 19, 2012 6:07 PM
Subject: Re: [Cs-dev] t-variable ideas
>
> Wouldn't this be nice?
>
> outs(^pan2(linen(p4,0.1,p3,0.1)*oscil(1,cpspch(p5),1)), 0.5))
>
> Victor
> On 19 Apr 2012, at 22:58, jpff@cs.bath.ac.uk wrote:
>
>> Yeak!
>>
>>
>>> Yes, I think the unpacking idea is useful and would help disambiguate
>>> the
>>> syntax, so opcodes as functions would then be possible. What would you
>>> envisage them to be difference between udos and user defined functions?
>>>
>>> Victor
>>>
>>> On 19 Apr 2012, at 20:35, Steven Yi wrote:
>>>
>>>> Some more thoughts on functions: One of the things I'm thinking is
>>>> that right now, opcodes can return n-number of return values. Really
>>>> though, they're just writing values into the memory allocated for the
>>>> variables listed in the left-hand side of the opcode. In Python, when
>>>> a function returns multiple items, they get packed into a tuple, but
>>>> can be automatically unpacked and written into variables:
>>>>
>>>>>>> def test():
>>>> ... return 1, 2
>>>> ...
>>>>>>> test()
>>>> (1, 2)
>>>>>>> a, b = test()
>>>>>>> a
>>>> 1
>>>>>>> b
>>>> 2
>>>>>>>
>>>>
>>>> I wonder if it would be useful to bring this kind of mechanism into
>>>> play. If a function returns multiple return values, we pack it into a
>>>> list, and if multiple var names are given, we write that back into
>>>> those variables. From a parser perspective, we would have to
>>>> introduce a tuple type, then when allocating and assigning out values
>>>> from opcodes, we can create an anonymous tuple, assign those mem
>>>> addresses to the opcode, then do an extra unpack to the out vars. For
>>>> example:
>>>>
>>>> a1, a2 pan2 asig, .5
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |