Auto determine cue points for on-the-fly database

Hi all

It is possible in version 2.1.x to auto detremine in and out points when loading new files into the playlist (by dragging files from the browser to the playlist).

How could I automaticly save these values in the on-the-fly database (or other database)?

It would be great to let the on-the-fly-database save the auto in and out markers for files that haven’t yet got any information regarding cue in and mix out points.

What could also help is to store the auto in and out points automaticly in the tag or metadata file of each audio item …

Thanks for any help!

The Auto Cue In etc. options will also apply to any item newly added to the OTF database. I will however not affect any items already contained in the database - how would it know which items to update/overwrite? (Even if an item has no cue points, this could be in purpose.)

Possible solutions:

  • Enabled Auto Cue or Fade, delete the cache file and let rescan the complete folder. Note that any previous manual changes to the OTF items will be lost.

  • The cache file is nothing but an ordinary .mlp file. You can simply open it in the playlist, and then run a script that applies the auto position features for all items that don’t have any cue points yet. Let me know if you need such a script.

  • You can also manually apply the Auto Position features to single items. Just open the file in PFL, hold down shift and click SET (for Cue In, Fade Out or Cue Out).

Torben

Here’s the script:

[code]var i: integer;

begin
for i := 0 to CurrentPlaylist.GetCount - 1 do
if pioAutoPosition in CurrentPlaylist.GetItem(i).GetOptions then begin
if CurrentPlaylist.GetItem(i).GetCueIn.GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCueIn.SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptCueIn));
if CurrentPlaylist.GetItem(i).GetFadeOut.GetValue = 0 then
CurrentPlaylist.GetItem(i).GetFadeOut.SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptFadeOut));
if CurrentPlaylist.GetItem(i).GetCueOut.GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCueOut.SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptCueOut));
end;
end.[/code]

Copy it into a text file and name it “autoposition.mls”. Open OnTheFlyCache.mlp inside the playlist (from the playlist context menu). Then run the script from mAirList’s main menu (Open -> Run script). It will take a while to process all files. mAirList will seem to “hang”, as the script blocks the foreground thread. Finally, save the playlist again as OnTheFlyCache.mlp from the playlist context menu.

You should make a backup of the .mlp file first. It’s also a good idea to deactivate the database during the process (just open your mAirList.ini file and rename the “Database0” section to “xDatabase0”) so that the cache file does not get accidently overwritten by the database system.

Torben

You can then call it from the mAirList menu.

Here's the script:

[code]var i: integer;

begin
for i := 0 to CurrentPlaylist.GetCount - 1 do
if pioAutoPosition in CurrentPlaylist.GetItem(i).GetOptions then begin
if CurrentPlaylist.GetItem(i).GetCueIn.GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCueIn.SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptCueIn));
if CurrentPlaylist.GetItem(i).GetFadeOut.GetValue = 0 then
CurrentPlaylist.GetItem(i).GetFadeOut.SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptFadeOut));
if CurrentPlaylist.GetItem(i).GetCueOut.GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCueOut.SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptCueOut));
end;
end.[/code]

Copy it into a text file and name it “autoposition.mls”. Open OnTheFlyCache.mlp inside the playlist (from the playlist context menu). Then run the script from mAirList’s main menu (Open → Run script). It will take a while to process all files. mAirList will seem to “hang”, as the script blocks the foreground thread. Finally, save the playlist again as OnTheFlyCache.mlp from the playlist context menu.

You should make a backup of the .mlp file first. It’s also a good idea to deactivate the database during the process (just open your mAirList.ini file and rename the “Database0” section to “xDatabase0”) so that the cache file does not get accidently overwritten by the database system.

Torben

You can then call it from the mAirList menu.


Hi Torben,

This script isn’t working (v2.1.31). There is an error: [Error] (5:8): Unknown identifier 'pioAutoPosition'

Didn’t use this script before so maybe I’m doing something wrong.

Vincent

Replace the faulty line by

if picAutoPosition in CurrentPlaylist.GetItem(i).GetCapabilities then begin 
Replace the faulty line by

if picAutoPosition in CurrentPlaylist.GetItem(i).GetCapabilities then begin

Still an (different) error:

[Error] (6:37): Unknown identifier GETCUEIN

It’s “GetCuePosition(ptCueIn)” instead of “GetCueIn” now. Same for Fade Out, Cue Out etc.

Hereby the correct script (tnx 2 Torben);

[code]var i: integer;

begin
for i := 0 to CurrentPlaylist.GetCount - 1 do
if picAutoPosition in CurrentPlaylist.GetItem(i).GetCapabilities then begin
if CurrentPlaylist.GetItem(i).GetCuePosition(ptCueIn).GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCuePosition(ptCueIn).SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptCueIn));
if CurrentPlaylist.GetItem(i).GetCuePosition(ptFadeOut).GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCuePosition(ptFadeOut).SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptFadeOut));
if CurrentPlaylist.GetItem(i).GetCuePosition(ptCueOut).GetValue = 0 then
CurrentPlaylist.GetItem(i).GetCuePosition(ptCueOut).SetValue(CurrentPlaylist.GetItem(i).AutoSearchPosition(ptCueOut));
end;
end.[/code]

Vincent.

OnTheFly database isn’t working on SUB-albums? Is it possible to create?

Vincent.

What’s a SUB album?

What's a SUB album?

Sorry, I mean:

D:\complete albums\1965-200x\1965
…\1966
…\1967 etc…

And

D:\complete albums\a\Ace of base\Album1
…\Album2 etc…

D:\complete albums\a\All Saints\Album1
…\Album2 etc…

D:\complete albums\b.… etc etc…
D:\complete albums\c.… etc etc…

etc…

The base directory is scanned recursively, so the database will contain all files, also from the sub-directories.

The base directory is scanned recursively, so the database will contain all files, also from the sub-directories.

Hi Torben,
Sorry for the delay but today I tried again on an clean computer. On my own music directory, with sub-directories only, OnTheFly does not create any OnTheFlyCache.mlp mAirList is scanning something (connecting to database) but after startup of mAirList notihing is happend and I can’t connect the database in the explorer.
In the config:
OnTheFlyDatabase
D:\complete albums
true
true

Vincent

Hmmmmmm I tried a sample directory with only a few sub-directories and filled with only 9 albums and now it is working.

Maybe the amount of sub-dirs is the problem?

I’ll try the ‘big one’ again.

Vincent, roughly how many albums/tracks do you have in the ‘big’ directory you are talking about?

Perhaps this is just a ‘patience’ issue :wink: … if you have more than a thousand tracks, I would suggest that you start the ‘scan’ and then check back after an hour, then each hour or so. If it still does not complete after (say) four hours, try starting it just before you go to bed, and then checking the results when you wake in the morning.

I am assuming that you are referring just to the OnTheFly database creation here, and not the ‘automatically set cue point’ script as well? That would definitely slow things down! :wink:

If it helps your estimates, remember that there are only 86,400 seconds available per day! :wink: If mAirList can add (say) five tracks to the OnTheFly cache per second, that would be 432,000 tracks per day or 18,000 tracks per hour in theory: but in practice, the larger each OnTheFly cache file becomes, the slower the processing.

BFN
CAD

HI Cad,

There are a lot of tracks. Do you assume that the OnTheFly database is build in the background and not in the large startup time from mAirList?(I suggest 10 to 15 minutes)? Hmmmm I will start it now and see what is happening later this evening.

This is the maximum amount of sub-directories (5);

D:\complete albums\d\The Doors\The Doors- The best of The Doors\cd1\

Thanks! Vincent.

Vincent, roughly how many albums/tracks do you have in the 'big' directory you are talking about?

Perhaps this is just a ‘patience’ issue :wink: … if you have more than a thousand tracks, I would suggest that you start the ‘scan’ and then check back after an hour, then each hour or so. If it still does not complete after (say) four hours, try starting it just before you go to bed, and then checking the results when you wake in the morning.

I am assuming that you are referring just to the OnTheFly database creation here, and not the ‘automatically set cue point’ script as well? That would definitely slow things down! :wink:

If it helps your estimates, remember that there are only 86,400 seconds available per day! :wink: If mAirList can add (say) five tracks to the OnTheFly cache per second, that would be 432,000 tracks per day or 18,000 tracks per hour in theory: but in practice, the larger each OnTheFly cache file becomes, the slower the processing.

BFN
CAD

I alread know the large ‘automatically set cue point script’ time. That’s not what I mean. It’s only the OTF database creation.

I am assuming that you are referring just to the OnTheFly database creation here, and not the 'automatically set cue point' script as well? That would [b]definitely[/b] slow things down! ;)


BFN
CAD

Vincent.

Vincent, have you enabled caching and auto rescan for the OTF database? mAirList then only looks for new files at startup.

Vincent, have you enabled caching and auto rescan for the OTF database? mAirList then only looks for [b]new[/b] files at startup.
Yes I did.... Here are my settings: [img]http://centani.nl/images/config.png[/img]

Nothing happened yet, I also can’t add the database search/browser into the explorer.

Vincent, roughly how many albums/tracks do you have in the 'big' directory you are talking about?

I looked into the iTunes database and there are 24280 tracks in the sub-directories…