Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Calling named instrument

Date2008-12-15 23:40
From" Partev Barr Sarkissian"
Subject[Csnd] Re: Calling named instrument
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 
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.

Date2008-12-16 00:24
FromCarlosJP
Subject[Csnd] Re: Calling named instrument


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.