Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Calling named instrument

Date2008-12-16 22:20
From" Partev Barr Sarkissian"
Subject[Csnd] Re: Re: Calling named instrument
Anthony wrote:
I am thinking that this syntax for calling subinstruments may have been
removed in favor of the UDO mechanism, but I could be wrong.  You can
accomplish pretty much everything (and more) with UDOs that you can with
subinstruments.  The subinstr opcode takes care of those corner cases 
where
you really want to call another instrument.

Anthony Kozar
mailing-lists-1001 AT anthonykozar DOT net
http://anthonykozar.net/

--------

Yeah, I agree, a syntax thing.

Maybe something like this;


     instr Insx

Insx=iparameters [whatever set-ups you're doing in "score" file]
....
aInsx1, aInsx2 (then an opcode here, like maybe tablei)  [and then read backs, parameters & attributes]
.....
outs   aInsx1, aInsx2
   endin


Or something along those lines. That might take care of the "used before defined" message.
I've got that message once too many times and solved that in a similar way.

It looks like that, ....

error:  no legal opcode, line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5

.... the program sees "Insx" here as an opcode rather than an instrument name.
>From what I recall, "Insx" isn't an opcode. Which would explain the 
"no legal opcode" message. Got one of those once for labeling 
something in a similar way.

That "subinstr" designator also looks like it's where an opcode should be
regarding the syntax thing Anthony was mentioning.

-PBS



-------------------------------------------------------------------------------------------


--- carlosjosepita@gmail.com wrote:

From: CarlosJP 
To: csound@lists.bath.ac.uk
Subject: [Csnd] Re: Calling named instrument
Date: Mon, 15 Dec 2008 16:24:57 -0800 (PST)




Partev Barr Sarkissian wrote:
> 
> The "used before defined" error suggests that you need to declare or 
> specify your function block prior to using it. I run into this all the 
> 


I'm not sure if I understand you but the instrument is defined before its
use. I mean, above it in the orch:

instr Insx
...
endin


instr 1
...
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5
...
endin

Regards
-Carlos

time, not naming a block. I'll have a oscillator and use it several times
with different names (via copy & Paste), but in the "orch" or "score"
there's only one named oscillator. Have to name and spec all of them before
using it. Something about the spec'd input isn't quite coming up right.

And it looks like it sees "Insx" as the opcode rather than the instrument
name.

error:  illegal character ., line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5

Don't know if subinstr is a legal opcode or not.

-PBS


-----------------------------------------------------------------------------------------




--- carlosjosepita@gmail.com wrote:

From: "Carlos Pita" 
To: csound@lists.bath.ac.uk
Subject: [Csnd] Calling named instrument
Date: Sun, 14 Dec 2008 22:41:54 -0200

Hi all,

http://www.csounds.com/manual/html/instr.html states that:

"""
If an instrument is defined with a name, you simply call it directly
like an opcode:

asig MyOscil iamp, ipitch, iftable
"""

But I get errors when calling a named instrument like that. OTOH, the
same invocation works fine when done through subinstr.

For example:

a1,a2   subinstr    "Insx", ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5

works as expected, but

a1,a2   subinstr    "Insx", ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5

throws:

error:  illegal character ., line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5
                              ^
error:  illegal character ., line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5
                                   ^
error:  illegal character ., line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5
                                        ^
error:  illegal character ., line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5
                                                        ^
error:  no legal opcode, line 57:
    a1,a2   Insx  ivel, ipch, .05, .7, 0.3, 6, 5, 3, 2, .5
error:  input arg 'a2' used before defined, line 58:
            outs        a1, a2
error:  input arg 'a1' used before defined, line 58:
            outs        a1, a2

Am  I missing something here?

Regards
-Carlos


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"




_____________________________________________________________
Netscape.  Just the Net You Need.


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"


-- 
View this message in context: http://www.nabble.com/Calling-named-instrument-tp21012564p21024991.html
Sent from the Csound - General mailing list archive at Nabble.com.



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




_____________________________________________________________
Netscape.  Just the Net You Need.