WL13 JS functions cdTrackStart, cdTrackEnd, cdTrackFrontier

Hi @PG1 ,
I’m trying to automatically generate a script, or ideally a complete, ready-to-open montage, from a floder containing the audio files and XML data containing the track order, markers, and album metadata. it seems possible, but i’m stuck on some functions.

In WL13, findNextMarkerPosition(-1, type) returns the same marker for cdTrackStart, cdTrackEnd, cdTrackFrontier and even an invalid type, so the type argument seems ignored.
Also, the old practical cdTrackFrontier marker type is documented but its global constant seems absent, while cdTrackStart/cdTrackEnd are available.
Is this a change, and what is the supported WL13 replacement? if there is a replacement?
Thanks,
Olivier

Documentation mistake: the correct name is “cdTrackSplice”.

Please try again because it seems to work here.

Thanks :folded_hands: I’ll try that.

I might do smthg wrong with findNextMarkerPosition.

Thanks @PG1 cdTrackSplice works, and findNextMarkerPosition(-1, constant) filters the marker types correctly.
Do you think creating a working .mon from a folder is an achievable goal on mac plateform (it seems it could be possible on PC windows but i’m on mac).
by the way, on this hard to me stuff, would writing directly in french is ok to you, or is it better in English in case someone one day had exactly the same issue? :sweat_smile:

I prefer english here :wink:

Why do you think there is a difference between Mac and Windows?
And what do you mean exactly with “creating a montage from a folder”?

Hello @PG1 , thank you for your reply.

By “creating a montage from a folder”, I mean:
I have folders containing the audio files, their order, positions, markers.xml, Album/cd-text.csv, ISRC.txt and EAN data.
Example folder with random tracks :

Example of a ready montage:
I would like to get, as quickly as possible, a WaveLab project ready to work on, with all this data & clips in place.

I thought Windows might be easier because external ActiveX control is mentioned in the manual.

I gave up the idea of generating the .mon file and its system.mon dependencies directly.
So I then tried JavaScript inside WaveLab.
I can create markers and named silent clips.

I am stuck on:
importing or replacing the audio used by the clips;
setting Album/CD-Text, ISRC and EAN data.
Are these functions accessible from JavaScript?
They are not documented.

Otherwise, the best solution would be an “intelligent” import function through Cmd+I: select the folder, WaveLab recognises the audio files and data, then populates the montage in one operation.
That would be really great.
Each function could be enabled or disabled in the import window.
See the mock-up.
This would avoid the repetitive tasks before each mastering session.

with the graphic stuff.
if there is a way to import all data at ones, from JS or any other way,
that would save some hours a month.

I see what you mean and indeed I can understand the interest. But that’s too much for what WaveLab 13 is capable of. That said, it is planned for the next version of WaveLab to greatly improve scripting capabilities so we can achieve this kind of thing. It’s always interesting for me to know what kind of script improvements are wanted, and your case is an example of this. I note it.

Thanks @PG1
That is really good news.

Since you are collecting examples of desired scripting improvements, it would be valuable for my workflow to allow scripts to access and combine native WL native functions and objects: montage clips and tracks, audio files, markers, metadata, analysis, plug-ins and parameters, automation, and import/export functions.

Being able to invoke scripts as native commands would also make it possible to build small, specific tools for repetitive tasks, such as the “intelligent import workflow” described above.

For vinyl-cutting work, with some help, I’ve developed tools to make the workflow more reliable and control my lathe. If useful, I would be happy to show you some concrete examples.

Regarding the import tool, the current WaveLab JavaScript API won’t do it :sweat_smile:. A combination of a macOS helper, Stream Deck, WaveLab shortcuts, seems fragile, if it is even possible and kind of overkill.

The prettier solution for me (though probably not for you :grinning_face_with_smiling_eyes:) would be to include this function in the next WaveLab 13 update :crossed_fingers:, if there is one :
when importing, we could import audio files + Markers.xml + CD-Text.csv + ISRC.txt, etc, and WL would place the clips in the montage as usual and the data in the correct fields, with a warning before replacing album information or ISRC data if the fields are not empty. This would save 3 to 4 minutes per project, if not much more.

It’s probably as useful as the “Watched Folder” function for batch converting final formats.
It would likely help with repeated track naming, renaming, re-exporting, etc.
More time spent mastering than administering projects means more happiness, doesn’t it?

What do you mean by this?

you are welcome

I meant being able to call WL native functions from a script, and combine them.
and also being able to call the script as if it was a WL function (kind of library logic).

Simple exemple, this script combines item selection, loudness normalisation and item spacing in one action : OC-autogap-1.2s–norm-18LUFS-Smax.lua and is called by ctrl+shift+M → raccourcis is set in the soft not in the script.
for the elaborate cutting tool, i’ll share on DM