PyFLP icon indicating copy to clipboard operation
PyFLP copied to clipboard

🐞 Example Code of "Implementing a plugin data parser" doesn't work

Open SilverShepherd opened this issue 1 year ago • 0 comments

Describe the issue

Screenshot 2024-05-11 154712 Hello, I tried the example code from the "Walkthrough: Implementing a plugin data parser" from the documentation. I followed each step as mentioned and then some errors occured

This is the first error Message:

Traceback (most recent call last): File "c:\Users\Silver Shepherd Lap\Documents\Coding\Code Projekte.xpj zu .flp\Sammelsurium\FLP Decontructor - Fruity Balance VorlagenTest_3.py", line 8, in events = project.events_asdict() ^^^^^^^^^^^^^^^^^^^^^ AttributeError: **'Project' object has no attribute 'events_asdict'**

The Compiler doesn't seem to know teh command "events_asdict"

And in other scenarios the ".struct" command is also not as an attribute there. But maybe that is because the "events_asdict()" command is needed to create this attribute.

The Fruity Balance Demo FLP was created in FL Studio 21.2.3

Hopefully someone can help.

What version of PyFLP are you using?

2.2.2dev6

What code caused this issue?

import pyflp
from pyflp.plugin import PluginID

# Parse the FLP file into a project
project = pyflp.parse("fruity-balance.flp")

# Collect all the events as a dict of ID to event
events = project.events_asdict()

# Get the first plugin data event - the Fruity Balance one itself
plugin_data_event = events[PluginID.Data][0]

# Get the raw data and convert it to a tuple of 8-bit unsigned integers
data = tuple(bytearray(plugin_data_event._struct))
print(data)

Screenshots, Additional info

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

SilverShepherd avatar May 11 '24 14:05 SilverShepherd