Skip to content

How to get the name of a playlistitem? #83

Answered by demberto
YihaoChen96 asked this question in Q&A
Discussion options

You must be logged in to vote

Yea, I planned to make use of ChannelPlaylistItem and PatternPlaylistItem classes, but until that's done you can use this code:

import pyflp

project = pyflp.parse(r"F:\Prog\Python\PyFLP\tests\assets\FL 20.8.4.flp")

for track in (track for arr in project.arrangements for track in arr.tracks):
    # print(track) -- Get track information
    for playlist_item in track:
        if playlist_item["item_index"] <= playlist_item["pattern_base"]:
            channel_iid = playlist_item["item_index"]
            print(f"Playlist item for {project.channels[channel_iid]}")
        else:
            pattern_num = (
                playlist_item["item_index"] - playlist_item["pattern_base"]
         …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@YihaoChen96
Comment options

@demberto
Comment options

Answer selected by demberto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request arrangement-playlist Channel and Pattern playlist items
2 participants