Csound Csound-dev Csound-tekno Search About

[Csnd] Opcode that returns instrument number?

Date2019-10-09 22:41
Fromjoehughes1
Subject[Csnd] Opcode that returns instrument number?
Hello Everyone, 
Has anyone here ever written an opcode that accepts an instrument name
string and returns the number for that instrument? Or is there one natively
that I'm not aware of?

This would be very handy for keeping your code readable with named
instruments while also allowing for the programmatic benefits of numbered
instruments



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-10-09 22:47
FromRory Walsh
SubjectRe: [Csnd] Opcode that returns instrument number?
You can print p1 to get the instrument number from any running instrument, will that do? 

On Wed, 9 Oct 2019 at 22:42, joehughes1 <joehughesmail@gmail.com> wrote:
Hello Everyone,
Has anyone here ever written an opcode that accepts an instrument name
string and returns the number for that instrument? Or is there one natively
that I'm not aware of?

This would be very handy for keeping your code readable with named
instruments while also allowing for the programmatic benefits of numbered
instruments



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-10-09 23:06
FromJohn ff
SubjectRe: [Csnd] Opcode that returns instrument number?
Yes.  I forget it's name but there are number to string and strong to number opcodes.  Something like sternum

Sent from TypeApp
On 9 Oct 2019, at 22:43, joehughes1 <joehughesmail@gmail.com> wrote:
Hello Everyone, 
Has anyone here ever written an opcode that accepts an instrument name
string and returns the number for that instrument? Or is there one natively
that I'm not aware of?

This would be very handy for keeping your code readable with named
instruments while also allowing for the programmatic benefits of numbered
instruments



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-10-09 23:17
FromJustin Smith
SubjectRe: [Csnd] Opcode that returns instrument number?
nstrnum

http://www.csounds.com/manual/html/nstrnum.html

On Wed, Oct 9, 2019 at 3:06 PM John ff  wrote:
>
> Yes.  I forget it's name but there are number to string and strong to number opcodes.  Something like sternum
>
> Sent from TypeApp
> On 9 Oct 2019, at 22:43, joehughes1  wrote:
>>
>> Hello Everyone,
>> Has anyone here ever written an opcode that accepts an instrument name
>> string and returns the number for that instrument? Or is there one natively
>> that I'm not aware of?
>>
>> This would be very handy for keeping your code readable with named
>> instruments while also allowing for the programmatic benefits of numbered
>> instruments
>>
>>
>>
>> --
>> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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

Date2019-10-10 00:04
FromJoseph Hughes
SubjectRe: [Csnd] Opcode that returns instrument number?
Right there in the docs! Thank you, Justin. Sorry to bother everybody with this, I just could not find that opcode.

On Wed, Oct 9, 2019 at 6:17 PM Justin Smith <noisesmith@gmail.com> wrote:
nstrnum

http://www.csounds.com/manual/html/nstrnum.html

On Wed, Oct 9, 2019 at 3:06 PM John ff <jpff@codemist.co.uk> wrote:
>
> Yes.  I forget it's name but there are number to string and strong to number opcodes.  Something like sternum
>
> Sent from TypeApp
> On 9 Oct 2019, at 22:43, joehughes1 <joehughesmail@gmail.com> wrote:
>>
>> Hello Everyone,
>> Has anyone here ever written an opcode that accepts an instrument name
>> string and returns the number for that instrument? Or is there one natively
>> that I'm not aware of?
>>
>> This would be very handy for keeping your code readable with named
>> instruments while also allowing for the programmatic benefits of numbered
>> instruments
>>
>>
>>
>> --
>> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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

Date2019-10-10 18:45
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Opcode that returns instrument number?
Many questions like this could be answered with a Search feature in the Csound reference manual. I.e., search: "instrument number to string."
I've had many questions like this as well.
The manual used to have such a feature.
Any chance Search could be reintroduced?

On Wed, Oct 9, 2019 at 7:05 PM Joseph Hughes <joehughesmail@gmail.com> wrote:
Right there in the docs! Thank you, Justin. Sorry to bother everybody with this, I just could not find that opcode.

On Wed, Oct 9, 2019 at 6:17 PM Justin Smith <noisesmith@gmail.com> wrote:
nstrnum

http://www.csounds.com/manual/html/nstrnum.html

On Wed, Oct 9, 2019 at 3:06 PM John ff <jpff@codemist.co.uk> wrote:
>
> Yes.  I forget it's name but there are number to string and strong to number opcodes.  Something like sternum
>
> Sent from TypeApp
> On 9 Oct 2019, at 22:43, joehughes1 <joehughesmail@gmail.com> wrote:
>>
>> Hello Everyone,
>> Has anyone here ever written an opcode that accepts an instrument name
>> string and returns the number for that instrument? Or is there one natively
>> that I'm not aware of?
>>
>> This would be very handy for keeping your code readable with named
>> instruments while also allowing for the programmatic benefits of numbered
>> instruments
>>
>>
>>
>> --
>> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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

Date2019-10-10 20:11
FromSteven Yi
SubjectRe: [Csnd] Opcode that returns instrument number?
csound.com has a search in the upper right. You choose to search the
site or just the manual.

On Thu, Oct 10, 2019 at 1:45 PM Arthur Hunkins
<000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>
> Many questions like this could be answered with a Search feature in the Csound reference manual. I.e., search: "instrument number to string."
> I've had many questions like this as well.
> The manual used to have such a feature.
> Any chance Search could be reintroduced?
>
> Art Hunkins
> http://www.arthunkins.com
>
>
> On Wed, Oct 9, 2019 at 7:05 PM Joseph Hughes  wrote:
>>
>> Right there in the docs! Thank you, Justin. Sorry to bother everybody with this, I just could not find that opcode.
>>
>> On Wed, Oct 9, 2019 at 6:17 PM Justin Smith  wrote:
>>>
>>> nstrnum
>>>
>>> http://www.csounds.com/manual/html/nstrnum.html
>>>
>>> On Wed, Oct 9, 2019 at 3:06 PM John ff  wrote:
>>> >
>>> > Yes.  I forget it's name but there are number to string and strong to number opcodes.  Something like sternum
>>> >
>>> > Sent from TypeApp
>>> > On 9 Oct 2019, at 22:43, joehughes1  wrote:
>>> >>
>>> >> Hello Everyone,
>>> >> Has anyone here ever written an opcode that accepts an instrument name
>>> >> string and returns the number for that instrument? Or is there one natively
>>> >> that I'm not aware of?
>>> >>
>>> >> This would be very handy for keeping your code readable with named
>>> >> instruments while also allowing for the programmatic benefits of numbered
>>> >> instruments
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>> >>
>>> >> Csound mailing list
>>> >> Csound@listserv.heanet.ie
>>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> Send bugs reports to
>>> >>         https://github.com/csound/csound/issues
>>> >> Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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

Date2019-10-11 14:52
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Opcode that returns instrument number?
Thanks for the info, Steven.

I wonder how many other users are unaware of this feature? (It is not at all intuitive.)
It would be helpful if it were displayed on the front page of the reference manual as well.

On Thu, Oct 10, 2019 at 3:11 PM Steven Yi <stevenyi@gmail.com> wrote:
csound.com has a search in the upper right. You choose to search the
site or just the manual.

On Thu, Oct 10, 2019 at 1:45 PM Arthur Hunkins
<000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>
> Many questions like this could be answered with a Search feature in the Csound reference manual. I.e., search: "instrument number to string."
> I've had many questions like this as well.
> The manual used to have such a feature.
> Any chance Search could be reintroduced?
>
> Art Hunkins
> http://www.arthunkins.com
>
>
> On Wed, Oct 9, 2019 at 7:05 PM Joseph Hughes <joehughesmail@gmail.com> wrote:
>>
>> Right there in the docs! Thank you, Justin. Sorry to bother everybody with this, I just could not find that opcode.
>>
>> On Wed, Oct 9, 2019 at 6:17 PM Justin Smith <noisesmith@gmail.com> wrote:
>>>
>>> nstrnum
>>>
>>> http://www.csounds.com/manual/html/nstrnum.html
>>>
>>> On Wed, Oct 9, 2019 at 3:06 PM John ff <jpff@codemist.co.uk> wrote:
>>> >
>>> > Yes.  I forget it's name but there are number to string and strong to number opcodes.  Something like sternum
>>> >
>>> > Sent from TypeApp
>>> > On 9 Oct 2019, at 22:43, joehughes1 <joehughesmail@gmail.com> wrote:
>>> >>
>>> >> Hello Everyone,
>>> >> Has anyone here ever written an opcode that accepts an instrument name
>>> >> string and returns the number for that instrument? Or is there one natively
>>> >> that I'm not aware of?
>>> >>
>>> >> This would be very handy for keeping your code readable with named
>>> >> instruments while also allowing for the programmatic benefits of numbered
>>> >> instruments
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>> >>
>>> >> Csound mailing list
>>> >> Csound@listserv.heanet.ie
>>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> Send bugs reports to
>>> >>         https://github.com/csound/csound/issues
>>> >> Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

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