10 posts
Page 1 of 1
1. Is it possible to run a macro without assigning it to a shortcut key or adding it to the macro toolbar? I kinda expected to be able to run a macro from the macro organiser or similar. The reason I want to do this is I am auditioning a whole bunch of macros from the Presonus Exchange and I'd like to see what they do before I decide whether keep them.

2. Is there a macro command reference somewhere? Maybe as a PDF? The macro editor lists all the commands but does not explain the function or the arguments.

(and what I really really need is a macro recorder - it's the best way to learn macros!)

Heavy-handed moderation can strangle a forum
User avatar
by Nip on Sat Sep 14, 2019 12:03 am
1. I think this is difficult since so context dependent.
2. in key commands you can export as text - macros are there too as I recall.
I usually put on desktop and just double click to check out options as they are.

But proper explanation of arguments are missing - agree fully.
It's a lot of trial end error. :thumbdown:

*** Windows 7 Pro * i7-860 2.8 Ghz 16 GB ram * RME HDSP 9632+AI4S+Audient ASP 800 * GT730 ***
User avatar
by IanM5 on Tue Sep 17, 2019 10:45 am
I got bored in the end. :D

I've also abandoned (for now) my attempts to write what I expected to be a fairly straightforward macro to switch the currently selected track from stereo to mono, reduce the volume by 6dB then bounce it down. I might return to it one day or I might continue to do it manually.

In the end I just needed to get on with the song!

Heavy-handed moderation can strangle a forum
User avatar
by Lawrence on Wed Sep 18, 2019 3:19 am
That's not a simple macro because there's no command for toggling the channel mode. It would need a temp track and might look something like this below, although I haven't actually ran this..

1. Cut (cut the audio event)
2. Add Audio Track (mono)
3. Create Range From Cursor
4, Size Range End
5. Bounce Selection. You need to have a mono file on the new track so that when you paste the stereo event the track won't auto-switch to stereo
6. Paste at Original Position
7. Edit Volume (-6, Relative ("1"))
8. Bounce Selection (Snap ("0))

Now you have the new mono event on the new track, do whatever you want with it, like put it back on the original track if you want.

9. Cut
10. Up (move up to the original track)
11. Paste at Original Position
12. Down (move down to the temp track)
13. Remove Track (remove the temp track)

In the scripting world that's a pretty easy and small script because you can switch the channel mode directly and just bounce it in place. I'll make an action that switches the channel mode and paste it back here.
User avatar
by Lawrence on Wed Sep 18, 2019 4:42 am
Here's an action to toggle the channel mode for the selected track. It has a State argument... "" (default) =Toggle, 0=Mono, 1=Stereo. Add the package to Studio One \scripts folder and restart and it will show up as Track > Switch Channel Mode.

switchChannelMode.package

Using that action the macro to do what you want would be...

1. Switch Channel Mode ("0")
2. Edit Volume (Level ("-6"), Relative ("1"))
3. Bounce Selection (Snap ("0"))

See the animation below:
btm.gif
User avatar
by IanM5 on Wed Sep 18, 2019 1:07 pm
Lawrence, Many thanks for that. It's spot on. I've attached the macro in case it is of use to anyone else. (No wonder I couldn't figure out the macro command to switch to mono - there wasn't one!)

At this point I was going to ask you how you got the info to do the script but having googled a while I've read your stuff on here and on KVR and also poked around on github. Nice work by you and others. :+1 It would be excellent if PS were to release, document and officially support a scripting API/SDK but I can see that they might not want to tie themselves to keeping it compatible across future versions. Is there an active feature request for this?

One more question. Do you know if it is possible to conditionally run (or abort) macros based on a return value from a script? I'm thinking it would be a nice touch for this macro to only run if the track is stereo, thus preventing this foolish user from running it twice on the same track and further decreasing the volume.

You've awoken my curiosity and given me just enough stuff to chew on so I think I may be spending a bit of time fiddling with scripts rather than making music!

Attachments
Bounce To Mono.studioonemacro
(570 Bytes) Downloaded 118 times

Heavy-handed moderation can strangle a forum
User avatar
by Lawrence on Thu Sep 19, 2019 3:57 am
You're welcome, we're all here to help each other.

IanM5 wroteOne more question. Do you know if it is possible to conditionally run (or abort) macros based on a return value from a script? I'm thinking it would be a nice touch for this macro to only run if the track is stereo, thus preventing this foolish user from running it twice on the same track and further decreasing the volume.

Yes, you can do that, but not with a macro. Look over the bounceTrackToMono.js code below. It reads longer than it is because it's been heavily commented but it's a pretty basic function. You can copy and paste all of that and zip those three files into a package to use that action.

In this case if you fire it on a track that's already set to mono it prompts and if you choose to bounce it anyway it doesn't compensate for the gain, it assumes that the additional gain from the mono summing has already been compensated for elsewhere with it already being in that state.

metainfo.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<MetaInformation>
   <Attribute id="Package:ID" value="bounce.track.to.mono"/>
</MetaInformation>

classfactory,xnl
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<ClassFactory>
   <ScriptClass
      classID="{269D9BA0-E759-4D8C-8B86-AF24D4F0A1D8}"
      category="EditTask"
      subCategory="TrackEdit"
      name="Bounce Track to Mono"
      sourceFile="bounceTrackToMono.js"
      functionName="createInstance"
      metaClassID="{D6BF554D-D36C-4786-B8C7-1DFC70B191B2}">
      <Attribute id="menuPriority" value="-1"/>
   </ScriptClass>
</ClassFactory>

bounceTrackToMono.js
Code: Select all
function bounceTrackToMono()
{
   this.interfaces = [Host.Interfaces.IEditTask]   

   // -------------------------------------------

   this.prepareEdit = function (context)
   {return Host.Results.kResultOk;}
   
   // -------------------------------------------
   
   this.performEdit = function (context)
   {
      // command action code shortcut
      let cmd = Host.GUI.Commands;

      // get the selected channel
      let channel = context.mainTrackList
         .getSelectedTrack(0).channel;

      /* if there is no audio channel or if it's
         not from an audio track do nothing */
      if (channel == undefined ||
         channel.mediaType != "Audio")
      {return}

      // get the channel mode switch param
      let mode = channel.findParameter("stereo")

      /* all audio track channels have a mode
         switch so this is likely an unnecessary 
         error trap, but just in case ...  */
      if (mode == undefined) {return}
      
      // hold the initial channel mode state
      let initState = mode.value;

      // if the track mode is already mono, prompt
      if (mode.value == 0)
      {
         if( Host.GUI.ask("This track channel is already set to mono.\n" +
            "Do you want to bounce the events to mono anyway?\n\n" +
            "This will not apply event gain compensation.")
            == Host.GUI.Constants.kNo)
         {return}
      }

      // set to mono if not already
      mode.setValue(0, true)

      /* clear all selections to not accidentally bounce
         other media on other tracks that may also be
         selected, and select all media on the current track  */
      cmd.interpretCommand("Edit", "Deselect All")
      cmd.interpretCommand("Edit", "Select All on Tracks")
      
      /* only reduce event gain to compensate for the mono
         summing if the initial state was stereo, otherwise
         it's assumed the gain was already compensated for
         elsewhere in the song or mix or plugins  */
      if (initState == "1")
      {
         cmd.interpretCommand("Audio", "Edit Volume", false,
            Host.Attributes(["Level", "-6", "Relative", "1"]))
      }

      // consolidate events to mono with no snapping / resizing
      cmd.interpretCommand("Event", "Bounce Selection", false,
         Host.Attributes(["Snap", "0"]))
         
      return Host.Results.kResultOk;
   }
}

/////////////////////////////////////////////////////////////////////

function createInstance ()
{
   return new bounceTrackToMono ();
}
User avatar
by IanM5 on Thu Sep 19, 2019 9:42 pm
Thanks Lawrence. That works a treat :+1

Heavy-handed moderation can strangle a forum
User avatar
by bruceqld on Sun Sep 22, 2019 2:34 am
Thanks Lawrence and IanM5. Works perfectly! :thumbup:

Studio One 5.11 Pro, Win 10, Asus ROG i7, 32 Gb Ram, SSD, RME Fireface UFX, X32, Atom, Faderport USB
User avatar
by juvandes on Sun Sep 22, 2019 9:46 pm
Is there a way to rename some selected tracks like a bunch of incremental choir tracks (ex Chorus 1, Chorus 2, Chorus 3...)?

Macbook Pro i9 32gb|Studio One 6.5.2|Protools 2024|Cubase Pro 13|Wavelab 11|Logic X|Apollo X8|2xUAD-2 Octo
UAD 11.0.1|Waves14| Soundtoys| Melodyne 5.3.1| Softube| PluginAlliance| Fabfilter| Sonnox| Eventide| Antares

10 posts
Page 1 of 1

Who is online

Users browsing this forum: No registered users and 63 guests