-
Hello, I am currently navigating in Ableton with some Midi-CC events and wonder if there is a possibility to change from Session to Arrangement view and detect what the current View is to apply a different navigation scheme? How would you access those information? Should it be under Best regards Somewhat related source. case 43: // lower Scene
{
const scenes = await song.get("scenes");
const scene = await song.view.get('selected_scene');
const index = scenes.indexOf(scenes.filter((t) => t.raw.id === scene.raw.id)[0]);
if(index > 0) {
await song.view.set('selected_scene', scenes[index-1].raw.id);
}
break;
}
case 45: // previous Track
{
const tracks = await song.get("visible_tracks");
const index = tracks.indexOf(tracks.filter((t) => t.raw.id === track.raw.id)[0]);
if(index > 0) {
await song.view.set('selected_track', tracks[index-1].raw.id);
}
break;
}
case 46: // next Track
{
const tracks = await song.get("visible_tracks");
const index = tracks.indexOf(tracks.filter((t) => t.raw.id === track.raw.id)[0]);
if(index + 1 < tracks.length) {
await song.view.set('selected_track', tracks[index+1].raw.id);
}
break;
}
case 44: // collapse & un-collapse
{
if (await track.get('is_foldable')) {
await track.set('fold_state', (await track.get('fold_state') ? 0 : 1));
} else {
const group = await track.get('group_track');
if(group) {
const tracks = await song.get('tracks');
const groupTrack = tracks.filter((t) => t.raw.id === group?.id)[0];
await groupTrack.set('fold_state', 1);
await song.view.set('selected_track', groupTrack.raw.id);
}
}
break;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @chozilla, I've just released a new version with support for the await ableton.application.view.get("focused_document_view"); |
Beta Was this translation helpful? Give feedback.
Hey @chozilla,
I've just released a new version with support for the
application.view
class. You can get the current view using: