Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Support for playlists #27

Open
wargreen opened this issue Jan 3, 2025 · 1 comment
Open

[feature] Support for playlists #27

wargreen opened this issue Jan 3, 2025 · 1 comment

Comments

@wargreen
Copy link

wargreen commented Jan 3, 2025

Thanks a lot for this tool !

For a better integration in a workflow, is it possible to get the playlists of the PT session in the Ardour's session ?
I can send an example session.

I've seen a reference to playlist in the codebase, but c++ is very far of me !

Thank again

@wargreen
Copy link
Author

wargreen commented Jan 13, 2025

After some chats and many time to research, i have got tests sessions with PT logs (very useful !).
Sessions generated with PT version 24.10.1, that seem use session files version 6.23

What i can guess about playlists in these PT sessions :

Playlists seem to be standard tracks, with all related in the timeline. It seem to be a block with the mapping playlist > track and another with the tracks (or playlists) actually shown.
Tracks (so playlists) are identified with an trackUID in theses mappings.
For each track, we seem to have a "Glutter" playlist : a blank playlist used for the drag'n'drop operation. Ref : https://duc.avid.com/showpost.php?p=2576261&postcount=7

Identified blocks :

0x1015
        List of audio tracks
  0x1014
          Track definition :

        MONO track
                _____|_name size_|__________________________name  _____________________|__|___ChNbr___|ChID_|
                14 10 12 00 00 00 41 75 64 69 6F 20 4D 6F 6E 6F 20 54 69 63 6B 73 20 38 00 01 00 00 00 0F 00 00
                ________|__________Track UID________________|____________________|__Chnl ID__|___________|__
                00 00 00 2A 00 00 00 F7 5E A0 E3 ED BA F1 2E 00 00 00 00 00 00 00 0F 00 00 00 00 00 00 00 00

        STEREO track
                _____|_name size_|__________________________name  ________________________|__|__ChNbr____|ChAID|
                14 10 13 00 00 00 41 75 64 69 6F 20 53 74 65 72 65 6F 20 53 6D 70 6C 20 36 01 02 00 00 00 1A 00
                ChBID|___________|_________________TrackUID__________|_____|______________|_ChnlA ID__|_ChnlB ID
                1B 00 00 00 00 00 2A 00 00 00 0D 5F A0 E3 B3 D1 42 2F 01 00 01 00 00 00 00 1A 00 00 00 1B 00 00
                __|___________|
                00 01 00 00 00 00

        MONO playlist
                _____|_name size_|______________name  _______________|__|__ChNbr___ |_____|           |________
                14 10 0C 00 00 00 50 6C 79 6C 31 20 41 75 64 69 6F 32 00 01 00 00 00 04 00 00 00 00 00 2A 00 00
                _____TrackUID_____________|___________|________|__Chnl ID__|___________|__
                00 4B 51 A0 E3 6D F0 8F 11 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00



0x202d
         List of playlist parameters ??
  0x202c
          Playlist param definition

                |_____|___PlID____|                       |_mapToTrk__|           |______________TrackUID_____________|
                 2C 20 02 00 00 00 00 00 00 00 01 00 00 00 05 00 00 00 00 00 00 00 2A 00 00 00 56 51 A0 E3 34 DF B7 11

                PlID : Number of the playlist (increment for each playlist)

0x2107
        List of shown tracks
  0x210b
          Shown tracks

For the trackUIDs :

In the log, when adding a track or reload the session file we can read :

TTrack::SetUID = 8vPTem#OHgkaaaGk

So this UID is stored in the session file

Audio 1 : 8vPTem#OHgkaaaGk <=> 2A 00 00 00 A1 A1 A3 E3 08 B6 95 7C 
Audio 2 : 8vz7uo#OHgkaaaGk <=> 2A 00 00 00 A1 A1 A3 E3 99 ED 95 7C 
Audio 3 : 8z5dHo#OHgkaaaGk <=> 2A 00 00 00 A1 A1 A3 E3 A5 0F 96 7C 

That can be converted with

base64cuscharset = 
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#

8z5dHo#OHgkaaaGk > reverse the string > base64 with custom charset > 
0x2a 0x0 0x0 0x0 0xa1 0xa1 0xa3 0xe3 0xa1 0xf 0x96 0x7c
                                     ^^^^

Only one byte change : a char (the second at the left of #) seem to have an offset of 4 or 5. I don't understand that, but it seem sufficient for say that this hex store the TrackUID, so we can base the mapping of the playlists on that.

Pro_Tools_2025_01_08_04_27_09 (create session).log
Pro_Tools_2025_01_08_04_41_05 (reload session).log
PtForm Playlist Clips.ptx.txt
PtForm Playlist Clips - 4.01 upper.ptx.txt
PtForm Playlist Clips - 4.01 upper - 4.02 to 3.ptx.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant