[Csnd] Altering an instruments parameters from the c++ API

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Altering an instruments parameters from the c++ API

iron_attorney
Hi there. I am trying to think of the best way to change the parameters of an instrument instance that is already running, via the API. I am working with c++ if it makes any difference.

To set the scene, my c++ code is choosing the instrument definitions that appear in the orchestra and writing the score. The music is composed (ie, the score is written) before the performamce starts, so c++ has no idea of the real time clock durin performance and everything must be set at the start.

What I am trying to figure out, is the most flexible way(s) I can alter parameters within an active instrument instance taking into account the above circumstances. For example, if one of my instruments has an LFO, I might want to alter it's frequency or amplitude every few beats. Ideally, I'd like to do this without starting a new instance of the instrument each time, but that is also an option if I store the state of the instrument and restore it in the next instance (though that could quickly get real complicated).

The options I can think of:

Use midi... Can you send midi messages via the score?

Score statements that just change p-values, I don't think I remember seeing one before.

Ditch the score and do everything with schedule etc, I seem to remember a way of accessing the p-values using the handles.

New instrument instance for each parameter change, not ideal.

Amy thoughts on this?
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

Tarmo Johannes-3

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

jpff
In reply to this post by iron_attorney
Channels

Sent from TypeApp
On 12 Jul 2017, at 11:33, Peter Burgess <[hidden email]> wrote:
Hi there. I am trying to think of the best way to change the parameters of an instrument instance that is already running, via the API. I am working with c++ if it makes any difference.

To set the scene, my c++ code is choosing the instrument definitions that appear in the orchestra and writing the score. The music is composed (ie, the score is written) before the performamce starts, so c++ has no idea of the real time clock durin performance and everything must be set at the start.

What I am trying to figure out, is the most flexible way(s) I can alter parameters within an active instrument instance taking into account the above circumstances. For example, if one of my instruments has an LFO, I might want to alter it's frequency or amplitude every few beats. Ideally, I'd like to do this without starting a new instance of the instrument each time, but that is also an option if I store the state of the instrument and restore it in the next instance (though that could quickly get real complicated).

The options I can think of:

Use midi... Can you send midi messages via the score?

Score statements that just change p-values, I don't think I remember seeing one before.

Ditch the score and do everything with schedule etc, I seem to remember a way of accessing the p-values using the handles.

New instrument instance for each parameter change, not ideal.

Amy thoughts on this?
Csound mailing list [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

iron_attorney
In reply to this post by Tarmo Johannes-3
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

Tarmo Johannes-3
Or put all necessary data into tables or arrays and read from there when you need.
T

12.07.2017 14:50 kirjutas kuupäeval "Peter Burgess" <[hidden email]>:
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

iron_attorney
Oh, that's a good idea! That's a nice clean and flexible method. If I have a table that contains times and values, the instrument could use that to control any parameter. That's probably the cleanest and most flexible solution so far

On 12 Jul 2017 12:56 p.m., "Tarmo Johannes" <[hidden email]> wrote:
Or put all necessary data into tables or arrays and read from there when you need.
T

12.07.2017 14:50 kirjutas kuupäeval "Peter Burgess" <[hidden email]>:
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

iron_attorney
Is there a way to access pfields through the handles created with schedule and the like?

On 12 Jul 2017 1:07 p.m., "Peter Burgess" <[hidden email]> wrote:
Oh, that's a good idea! That's a nice clean and flexible method. If I have a table that contains times and values, the instrument could use that to control any parameter. That's probably the cleanest and most flexible solution so far

On 12 Jul 2017 12:56 p.m., "Tarmo Johannes" <[hidden email]> wrote:
Or put all necessary data into tables or arrays and read from there when you need.
T

12.07.2017 14:50 kirjutas kuupäeval "Peter Burgess" <[hidden email]>:
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

iron_attorney
Sorry, not schedule, I'm reading the manual now and I see it's nstance that produces a handle. Is there any way of accessing p-fiekds from that?

On 12 Jul 2017 4:30 p.m., wrote:
Is there a way to access pfields through the handles created with schedule and the like?

On 12 Jul 2017 1:07 p.m., "Peter Burgess" <[hidden email]> wrote:
Oh, that's a good idea! That's a nice clean and flexible method. If I have a table that contains times and values, the instrument could use that to control any parameter. That's probably the cleanest and most flexible solution so far

On 12 Jul 2017 12:56 p.m., "Tarmo Johannes" <[hidden email]> wrote:
Or put all necessary data into tables or arrays and read from there when you need.
T

12.07.2017 14:50 kirjutas kuupäeval "Peter Burgess" <[hidden email]>:
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

rorywalsh
There is a method for getting tracker arts. I asked Victor for it some time back. I think it's called csoundGetTableArgs(). 

On 12 Jul 2017 11:09 p.m., "Peter Burgess" <[hidden email]> wrote:
Sorry, not schedule, I'm reading the manual now and I see it's nstance that produces a handle. Is there any way of accessing p-fiekds from that?

On 12 Jul 2017 4:30 p.m., wrote:
Is there a way to access pfields through the handles created with schedule and the like?

On 12 Jul 2017 1:07 p.m., "Peter Burgess" <[hidden email]> wrote:
Oh, that's a good idea! That's a nice clean and flexible method. If I have a table that contains times and values, the instrument could use that to control any parameter. That's probably the cleanest and most flexible solution so far

On 12 Jul 2017 12:56 p.m., "Tarmo Johannes" <[hidden email]> wrote:
Or put all necessary data into tables or arrays and read from there when you need.
T

12.07.2017 14:50 kirjutas kuupäeval "Peter Burgess" <[hidden email]>:
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Altering an instruments parameters from the c++ API

iron_attorney
I should really start this post again and remove the bit about the API, haha. My c++ program has to prepare the whole orchestra and score before hand, no real time interaction is involved.

On 13 Jul 2017 2:10 p.m., "Rory Walsh" <[hidden email]> wrote:
There is a method for getting tracker arts. I asked Victor for it some time back. I think it's called csoundGetTableArgs(). 

On 12 Jul 2017 11:09 p.m., "Peter Burgess" <[hidden email]> wrote:
Sorry, not schedule, I'm reading the manual now and I see it's nstance that produces a handle. Is there any way of accessing p-fiekds from that?

On 12 Jul 2017 4:30 p.m., wrote:
Is there a way to access pfields through the handles created with schedule and the like?

On 12 Jul 2017 1:07 p.m., "Peter Burgess" <[hidden email]> wrote:
Oh, that's a good idea! That's a nice clean and flexible method. If I have a table that contains times and values, the instrument could use that to control any parameter. That's probably the cleanest and most flexible solution so far

On 12 Jul 2017 12:56 p.m., "Tarmo Johannes" <[hidden email]> wrote:
Or put all necessary data into tables or arrays and read from there when you need.
T

12.07.2017 14:50 kirjutas kuupäeval "Peter Burgess" <[hidden email]>:
I realise I've made a mistake mentioning the API, because I'm not actually controlling the performance via the API,, just compiling, starting and stopping, appologies for the confusion.

Tarmo:

The latter idea is another option yes. To clarify, you mean I could have a master modulation instrument that knows when to alter global parameters that the performance instrument references for it's parameters? As I am algorithmically generating instruments already, to generate an instrument that makes timed alterations to global parameters should be a breeze.

Another way is obviously to have all parameter changes set in p-fields St the beggining of the note instance, but this creates a horrendous mess of the instrument definitions if you want more than a couple of parameter changes to happen. 

On 12 Jul 2017 12:22 p.m., "Tarmo Johannes" <[hidden email]> wrote:

Can you think of using global variables for the parameters that change in runtime?

 

with chn_export opcode you declare them so that you can access them from host via API calls as channels.

 

Or if you decide everythng beforhand you can write master instruments that set necessary values to global variables in specific moments.

 

If I understood right what you are after...

 

tarmo

 

 

On Wednesday, July 12, 2017 11:32:08 AM you wrote:

> Hi there. I am trying to think of the best way to change the parameters of

> an instrument instance that is already running, via the API. I am working

> with c++ if it makes any difference.

>

> To set the scene, my c++ code is choosing the instrument definitions that

> appear in the orchestra and writing the score. The music is composed (ie,

> the score is written) before the performamce starts, so c++ has no idea of

> the real time clock durin performance and everything must be set at the

> start.

>

> What I am trying to figure out, is the most flexible way(s) I can alter

> parameters within an active instrument instance taking into account the

> above circumstances. For example, if one of my instruments has an LFO, I

> might want to alter it's frequency or amplitude every few beats. Ideally,

> I'd like to do this without starting a new instance of the instrument each

> time, but that is also an option if I store the state of the instrument and

> restore it in the next instance (though that could quickly get real

> complicated).

>

> The options I can think of:

>

> Use midi... Can you send midi messages via the score?

>

> Score statements that just change p-values, I don't think I remember seeing

> one before.

>

> Ditch the score and do everything with schedule etc, I seem to remember a

> way of accessing the p-values using the handles.

>

> New instrument instance for each parameter change, not ideal.

>

> Amy thoughts on this?

>

> Csound mailing list

> [hidden email]

> 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Loading...