Online Sequencer Forums

Full Version: Console Marker Commands
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering if anyone knew console commands to get and set the markers. I can see a bunch of marker functions in the drop down but I don't know what they all do, nor what the settings mean.
Be careful messing around with the markers in the console. They're stored in a complicated data structure, to reduce CPU use when playing the song.

Changing marker values, or toggling blending in the console is ok. Changing marker instrument, setting, or time via the console will break things.

There's not even an easy way of listing all the markers in the song, because of that data structure. So what I do is use the selection instead. I select the markers I want to mess with, then iterate over selection.markers instead:
for (const m in selection.markers) console.log(m);

The only marker function that you could reasonably use from the console is this one:
addMarker(time, setting, instrument, value, blend)

If people have ideas for other console commands, they're easy enough to add. I should probably add something like selectNotesIf for markers.
Thanks, but that doesn't show me console commands. By drop down I meant typing 'marker' into the console and seeing all the functions there.
I couldn't tell if I should have mentioned song.getAllMarkersAtTime(t) since the OP was asking some really basic questions over what items markers accomplish. You can easily get markers via the UI which I have explained in the first link I sent. It should also explain everything under the marker menu dropdown if I'm interpreting correctly.
(06-10-2021, 05:34 PM)Liam Wrote: [ -> ]Be careful messing around with the markers in the console. They're stored in a complicated data structure, to reduce CPU use when playing the song.

Changing marker values, or toggling blending in the console is ok. Changing marker instrument, setting, or time via the console will break things.

There's not even an easy way of listing all the markers in the song, because of that data structure. So what I do is use the selection instead. I select the markers I want to mess with, then iterate over selection.markers instead:
for (const m in selection.markers) console.log(m);

The only marker function that you could reasonably use from the console is this one:
addMarker(time, setting, instrument, value, blend)

If people have ideas for other console commands, they're easy enough to add. I should probably add something like selectNotesIf for markers.

Sorry my above reply was to Lucent.

Ok, I think add marker could work. What I really want to do is just enter precise numbers for the settings. So if the marker was set inst volume at .52 I could change it to .5 etc

This would not have been an issue if you had not deprecated the text files. Tounge
(06-10-2021, 05:34 PM)Liam Wrote: [ -> ]Be careful messing around with the markers in the console. They're stored in a complicated data structure, to reduce CPU use when playing the song.

Changing marker values, or toggling blending in the console is ok. Changing marker instrument, setting, or time via the console will break things.

I feared as much, that's why I was asking.

Quote:addMarker(time, setting, instrument, value, blend)

So for time, how is that calculated? Real time or bar/count? Then setting would be 1 for volume, 2 for pan, 3-5 for eq etc?, instrument and value are straight forward, and blend is true/false?
Select the marker you want to change, then in the console type this:

for (const m of selection.markers) { m.value = 1.5; }

Change 1.5 to whatever you want.
(06-10-2021, 05:43 PM)emekat Wrote: [ -> ]
(06-10-2021, 05:34 PM)Liam Wrote: [ -> ]Be careful messing around with the markers in the console. They're stored in a complicated data structure, to reduce CPU use when playing the song.

Changing marker values, or toggling blending in the console is ok. Changing marker instrument, setting, or time via the console will break things.

There's not even an easy way of listing all the markers in the song, because of that data structure. So what I do is use the selection instead. I select the markers I want to mess with, then iterate over selection.markers instead:
for (const m in selection.markers) console.log(m);

The only marker function that you could reasonably use from the console is this one:
addMarker(time, setting, instrument, value, blend)

If people have ideas for other console commands, they're easy enough to add. I should probably add something like selectNotesIf for markers.

Sorry my above reply was to Lucent.

Ok, I think add marker could work.  What I really want to do is just enter precise numbers for the settings.  So if the marker was set inst volume at .52 I could change it to .5 etc

This would not have been an issue if you had not deprecated the text files. Tounge

song.getAllMarkersAtTime(t) should be your best friend then. t is the timestamp which you can obtain by left-clicking the measure bar of whichever marker group you want to view. You want to change "value" for the specific marker you want to change.

Some parameters on OS have obvious values. Volume typically goes from 0 to 2, while Detune goes from -1200 to 1200. Using console, you can make these values more precise as well as extending them past regular UI values.
(06-10-2021, 05:47 PM)Liam Wrote: [ -> ]Select the marker you want to change, then in the console type this:

for (const m of selection.markers) { m.value = 1.5; }

Change 1.5 to whatever you want.

This did the trick!

At first I couldn't figure out which setting I was changing ... then I realized that each marker only has ONE setting, duh. Tounge

I've fixed my mix! Thank you Liam so much!!!

And thanks too Lucent. +/-1200 on pitch makes sense (cents Tounge) it's an octave either way. I'll keep that in mind when I start pitching.

So if anyone else wants to do this:

1 ~ Select your marker. Right click it, open the panel. If there are more than 1 marker, make sure only the ONE that you are editing is box ticked.

2 ~ Open console.

3 ~ Enter this:

for (const m of selection.markers) { m.value = x; }

Substitute the new value for 'x'

4 ~ Reselect the marker from the marker bar to refresh the panel and watch the slider move to confirm.

YAY!!