Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Parser Update

Date2006-09-23 08:41
FromVictor Lazzarini
SubjectRe: [Cs-dev] Parser Update
I too found the SAOL example too complicated. But
if there is no better way (or if convergence with
SAOL is sought), I don't mind going that way. But
what you said below seems more interesting if
implementable.

(This is in fact, for me, the only thing in SuperCollider
which has an advantage over Csound. In SC, creating
filterbanks, oscillator banks can be done with very compact
code, because of looping and arrays.)

>
> yea, that would be really cool.  although either i don't
> understand   the SAOL
> version or the example is really poor -- the example seems
> like it is   more
> work than just using 2 separate opcodes.???
>
> i would like to see something like victor's example except
> when no index to the array is given for a variable, the
> opcode will   automatically
> handle all the elements within the array.
> so something like this:
>
> aBfSig arrayinit 4
> aBfFilter arrayinit 4
>
> ihp = 1000
>
> aBformatSig in
> aBfFilter tone aBfSig, ihp
> out aBfFilter
>
>
> i guess the parser would automatically generate something
> like:
>
> + first the size of largest variable array used for output
> or input   is found
>     ( in this example = 4)
>
> + the opcode is duplicated for that number - so internally
> the instr   would look like:
>
>     aBfFilter[0] tone aBfSig[0], ihp
>     aBfFilter[1] tone aBfSig[1], ihp
>     aBfFilter[2] tone aBfSig[2], ihp
>     aBfFilter[3] tone aBfSig[3], ihp
>
>     - note since ihp is not an array, it is used in each
> instance
>     - if arrays are different sizes, the parser needs to
> determine   what to do for the smaller array variables
>     ( i guess just "carry" the last element for input
> params and do   nothing for output params? )
>
> + ideally, the parser or opcodes themselves would know
> special   handling of opcodes like in/out/etc to:
>         aBformatSig[0], aBformatSig[1],  aBformatSig[2],
> aBformatSig[3] inq
>
>
>
> On Sep 22, 2006, at 10:31 AM, Richard Dobson wrote:
>
> > Re specifically opcode arrays, I think note should be
> > taken of the   SAOL
> > semantics for this (not least as one use for a Csound
> > backend would be as a fast SAOL interpreter - there is a
> > case for ensuring that the Csound semantics for arrays
> facilitates an easy translation to SAOL): >
> >
>
http://www.cs.berkeley.edu/~lazzaro/sa/book/opcodes/filter/
> > index.html#oparray
> >
> > The notation below might be a problem for any opcodes
> > that have   multiple
> > or variable numbers of outputs, or even for any opcodes
> > without any outputs. SAOL clearly distinguishes between
> > signal-variable arrays,   and
> > opcode arrays, as can be seen in the example in the link
> above. >
> > Of course, to support all of SAOL, Csound would need to
> > support templates too, which is no doubt "another thing
> altogether". >
> > Richard Dobson
> >
> > Victor Lazzarini wrote:
> >> I think definitely we should look into adding
> >> loops, as well as variable/opcode arrays. I am
> >> thinking on the lines of the following syntax:
> >>
> >> a1[] arrayinit 10
> >>
> >> for ki=0, ki < 10, ki = ki + 1
> >> a1[ki] oscil 10000, kfun*ki, 1
> >> endfor
> >>
> >>
> > ..
> >
> >
> >
> >
> ----------------------------------------------------------
> > ------------  ---
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the
> > chance to   share your
> > opinions on IT & business topics through brief surveys
> > -- and earn   cash
> > http://www.techsay.com/default.php?
> > page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
>
>
> ----------------------------------------------------------
> --------------- Take Surveys. Earn Cash. Influence the
> Future of IT Join SourceForge.net's Techsay panel and
> you'll get the chance to share your opinions on IT &
> business topics through brief surveys -- and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-09-23 19:20
Frommatt ingalls
Subject[Cs-dev] opcode arrays
AttachmentsNone  None  

On Sep 23, 2006, at 12:41 AM, Victor Lazzarini wrote:

(This is in fact, for me, the only thing in SuperCollider

which has an advantage over Csound. In SC, creating

filterbanks, oscillator banks can be done with very compact

code, because of looping and arrays.)


yes -- a good friend ( joe anderson -- who is teaching in Scarborough now -- maybe you UK 
folk have run into him?)  is an ex-csound supercollider user -- and always cites
oscillator banks and audio signal arrays ( he does a lot of work in B-format )
as one of the reasons he uses supercollider instead.

so how does supercollider handle opcode arrays?
   i can't seem to find an example..


also i noticed a typo in my previous post and it should be:

aBfSig arrayinit 4
aBfFilter arrayinit 4

ihp = 1000

aBfSig in
aBfFilter tone aBfSig, ihp
out aBfFilter

; and for something more similar to Victor's original example, 
; you could do something like:

iPartials init 10
kCps arrayinit iPartials

kPitch line 20, p3, 20000

kIndex = 0
while (kIndex < iPartials)
kCps[kIndex] = kPitch*(kIndex+1)
endwhile 

aSig oscili 0dbfs/iPartials, kCps
out aSig

; so 10 oscili's would be automatically generated
; and we want their outputs to be mixed into aSig
; ( since aSig is not an array ) -- can we assume
; this will always be the case?