Via its Mixer object name?
i.e.
ra:select-track 0
then
ra:set-block-track-instrument 'DPiano-E 1'
Any way to assign an instrument to a track via the API?
-
- Posts: 34
- Joined: 06 Jan 2018 23:03
Re: Any way to assign an instrument to a track via the API?
Yes, you use the function setInstrumentForTrack:
It doesn't take instrument name as argument though. Since instrument names are not unique, that wouldn't work. So you need to get the instrument id. You get the id of the current instrument by calling getCurrentInstrument, if that works. (Also, in the picture, "D Piano10" probably doesn't have id 10. 10 is just a number displayed to make things easier to read.)
Code: Select all
void setInstrumentForTrack | int64_t instrument_id | int tracknum ? -1 | int blocknum ? -1 | int windownum ? -1
Re: Any way to assign an instrument to a track via the API?
To get the id of the 10th instrument shown in that menu, do this:
Code: Select all
ra.getAudioInstrumentId(10)
-
- Posts: 34
- Joined: 06 Jan 2018 23:03
Re: Any way to assign an instrument to a track via the API?
Thanks for the useful info; I have a follow-up question:
Is there currently a way to get a LIST of all available instrument IDs and their corresponding names, i.e.
id=27, DPiano-A 1
id=28, EPiano-A 1
etc.
Trying to familiarize myself with the API functions list in
https://github.com/kmatheussen/radium/b ... rotos.conf
so I can ask fewer questions.
Is there currently a way to get a LIST of all available instrument IDs and their corresponding names, i.e.
id=27, DPiano-A 1
id=28, EPiano-A 1
etc.
Trying to familiarize myself with the API functions list in
https://github.com/kmatheussen/radium/b ... rotos.conf
so I can ask fewer questions.
Re: Any way to assign an instrument to a track via the API?
Use getNumAudioInstruments to find number of audio instruments. Use getAudioInstrumentId to get instrument id from instrument number. Use getInstrumentName to get instrument name from instrument id.
-
- Posts: 34
- Joined: 06 Jan 2018 23:03