Track/Sample DSP chain visibility testing

Hello! Currently working on a tool where I need to know which device is currently visible/selected, i.e. whether the tracks/mixer pane is currently visible or the sample DSP chain.

I’ve seen there are options to tell the corrent track and dsp chain selected device, but not which view is actually currently visible.

Looking for this, because I want to load data from an instrument to a specific device and back, so I need to know whether the user would want to trigger the command in track or sample effects chain.

1 Like

Id look for which widget [ hasFocus or ActiveControl ] or whatever gui lang this thing uses; check for focus.

hi, should we do a call or something?

here.

>>> oprint (renoise.song().selected_device.name)
Convolver

i have Convolver as a selected device. if i have nothing selected, then the selection is nil.

>>> oprint (renoise.song().selected_device.name)
*** [string "oprint (renoise.song().selected_device.name..."]:1: attempt to index field 'selected_device' (a nil value)
*** stack traceback:
***   [string "oprint (renoise.song().selected_device.name..."]:1: in main chunk

>>> oprint (renoise.song().selected_device)
nil

tracks/mixer pane… the lower_frames are only “track dsp” or “automation”. or then the lower frame is not visible.

here’s a couple of things that can help you

>>> oprint (renoise.app().window.active_lower_frame)
1

this means that the track dsp is visible.

here are the names you can call.

renoise.ApplicationWindow.LOWER_FRAME_TRACK_DSPS
renoise.ApplicationWindow.LOWER_FRAME_TRACK_AUTOMATION

this means, if you want the track dsps to show, you can either do

renoise.app().window.active_lower_frame=1

to set the current lower frame to 1 which is LOWER_FRAME_TRACK_DSPS
or you can do

renoise.app().window.active_lower_frame=renoise.ApplicationWindow.LOWER_FRAME_TRACK_DSPS

which will definitely set the lower frame to that specific view.

now, if the lower frame is not visible, you can check this with

renoise.app().window.lower_frame_is_visible

you’ll get true if it’s visible, false if it’s not visible.

situations where trackdsps will not be visible == if you’re in the sample editor, or any other view in the samples (instrument mappings, etc).
then you gotta kick yourself to pattern editor, or mixer, to get to show trackdsps.
in this case, you’ll do it like this

renoise.app().window.active_middle_frame = renoise.ApplicationWindow.MIDDLE_FRAME_MIXER

or

renoise.app().window.active_middle_frame = renoise.ApplicationWindow.MIDDLE_FRAME_PATTERN_EDITOR

you can also ask, what is the current middle frame, and get the answer

>>> oprint (renoise.app().window.active_middle_frame)
1

(in this case, 1 = Pattern Editor)
the full list is

renoise.ApplicationWindow.MIDDLE_FRAME_PATTERN_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_MIXER
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_PHRASE_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_KEYZONES
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_MODULATION
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EFFECTS
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_PLUGIN_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_MIDI_EDITOR

this last thing “so i need to know whether the user would want to trigger the command in track or sample effects chain” is something i need to know.

i think what you maybe mean, is, the Convolver might be in the Sample FX Chain, or in the Track DSP Chain.
In this case, i think, let’s see.
yes, selected_device will tell you what the track dsp device is.
but if there’s nothing selected, it won’t tell you that “oh, you don’t have track dsp device selected, but i see you have a sample fx chain device selected, and that is this”, instead you gotta then go… like this.

renoise.song().selected_sample_device

this’ll tell you if you have a device selected in the Sample FX chain.
and if you want to make sure the device is a Convolver, then of course use

renoise.song().selected_sample_device.name

the way i’ve solved this for myself, is, i query, first and foremost, which frame is being displayed. if the frame is 7, in this case, renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EFFECTS - i’ll know to go "ah, okay, sample_fx chain is displayed, i’m gonna run the script so that it imports or extracts something from the Convolver device.
and if it’s NOT displayed, then do the import + extract Convolver device stuff from trackdsp instead.

hope this helps!

the system otherwise is very similar

oprint (renoise.song().selected_sample_device.active_preset_data)
oprint (renoise.song().selected_device.active_preset_data)

and just hit the XML with the data you want to extract, or import to.

good luck!

if something din’t make sense, ping me privately or let’s do a google meet.

btw, thanks for the idea, i’m gonna include it in my flavor (Paketti Convolver Import/Export) too. (the track dsp or sample fx chain differentiation)