[Csnd] named instruments issue with livecoding

Hi all!

(I'm sorry I sent an incomplete mail before)

I want to ask you something about an issue I've got in livecoding with csound.
The idea is that I open a csound listening server and I send messages with reaper.
The problem is that if I send for exemple three different named instruments (I need to use named instruments because I need that csound manage the instruments numbers), csound think they are always the same.
For exemple, something like this:

instr inst9B589C8D
print p1
endin
schedule "inst9B589C8D", 1.0, 0.5

instr inst0A7FFD81
print p1
endin
schedule "inst0A7FFD81", 2.0, 0.5

instr inst0941D201
print p1
endin
schedule "inst0941D201", 3.0, 0.5

//

If I send it with livecoding, I get this result:

instr 41: p1 = 41.000
instr 41: p1 = 41.000
instr 42: p1 = 42.000

//

If I render offline, I get this result:

instr 1: p1 = 1.000
instr 2: p1 = 2.000
instr 3: p1 = 3.000

Is this a bug or an issue. I didn't figure out why the last instrument is another number and sometimes csound gives me all three instruments the same number. Is it a time bound issue?
Thank you for your answers,

j

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Hi,

Sorry that I'm still not really clear on what you are trying to do,
but in my own "livecoding" setup, I don't see the problem.

I just took the code below that you provide, and inserted it in a
csd. The output is identical, both when directly run with Csound
and when run "live". My livecode is unfortunately very personal,
using my own software (in the Haiku OS) but essentially I just run
Csound with a UDP port, and feed the port with text, as required.
I feed it the entire csd, and get the same output as with the
direct invocation.

I guess there's something wonky in your setup? Maybe Reaper.
I've never used it.

  -- Pete --

from where are you sending these, from first glance this looks like a bug, but I can’t rule out if the host application is making some modifications

Since no one replied yet, I'll have a
go. The only way to guarantee that a given number is assigned to an instrument is to
assign one in the code. If not Csound will
provide one depending on various factors.

instr 1, name

endin

now you can either use name or 1 to refer to it.

Prof. Victor Lazzarini
Maynooth University
Ireland

But nstrnum(“name”) in this case does not return a 1 which seems odd. Or at least that’s how I remember it being…

Ok, then you just can’t rely on a named instrument using a given number, because using a name will look for the assigned number and that can be anything.

if you need to rely on a numeric p1, you will need to use a number to instantiate it. That’s the bottom line.

Prof. Victor Lazzarini
Maynooth University
Ireland

I should have said that Steven already explained this to me :joy: I was just saying I don’t it odd is all.

…think it’s odd.

It seems to me that none of the replies here have really addressed
the original poster's problem, so let me go back to that...

taking the following code, simply inserted into a CSD, and run:

=======================================
instr inst9B589C8D
print p1
endin
schedule "inst9B589C8D", 1.0, 0.5

instr inst0A7FFD81
print p1
endin
schedule "inst0A7FFD81", 2.0, 0.5

instr inst0941D201
print p1
endin
schedule "inst0941D201", 3.0, 0.5

I would expect to see this:

instr 1: p1 = 1.000
instr 2: p1 = 2.000
instr 3: p1 = 3.000

which is exactly what I see, whether I run it directly
or via (my) livecode.

Seeing what jacopo sees in livecode:

instr 41: p1 = 41.000
instr 41: p1 = 41.000
instr 42: p1 = 42.000

seems very odd, becaaus the code explicitly calls each
instrument once, but the first one apparently gets called twice!
(As I understand it, it should be impossible for two instruments
to end up with the same number, however it has been derived.)
It's also a bit odd that the instruments are not still numbered
1, 2, and 3, but I guess his livecode environment has some already
defined blocks.

  -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

When you say "live coding" what are you actually running?

⁣Sent from TypeApp ​