Comments (5)
It seems ChannelID.Parameters["fx.start"]
used an int
instead of the (now) LogNormal
/ float
representation.
While a fix for this is simple, it will be a downgrade for projects and presets saved with newer versions of FL Studio.
I need to find a better solution to such issues.
In the meantime, you can fix this by changing this line
Line 303 in a74fad0
to
"fx.start" / c.Optional(c.Int32ul), # 137
If you are familiar with git and Python, I recommend that you fork PyFLP, clone it locally, make the edits and install it in your environment, instead of changing this manually in your existing installation.
from pyflp.
I found a truly hacky solution for this, but maybe it can inspire something on your end. The following code monkey-patches a new version of STRUCT
with the one commented out field changed.
try:
project = pyflp.parse(flpfile)
except ValueError:
flp_monkeypatch_pyflp()
project = pyflp.parse(flpfile)
def flp_monkeypatch_pyflp():
from pyflp.channel import StdEnum, _DelayFlags, ArpDirection, DeclickMode, List2Tuple, LinearMusical, StretchMode, Log2, LogNormal
pyflp.channel.ParametersEvent.STRUCT = c.Struct(
"_u1" / c.Optional(c.Bytes(9)), # 9
"fx.remove_dc" / c.Optional(c.Flag), # 10
"delay.flags" / c.Optional(StdEnum[_DelayFlags](c.Int8ul)), # 11
"keyboard.main_pitch" / c.Optional(c.Flag), # 12
"_u2" / c.Optional(c.Bytes(28)), # 40
"arp.direction" / c.Optional(StdEnum[ArpDirection](c.Int32ul)), # 44
"arp.range" / c.Optional(c.Int32ul), # 48
"arp.chord" / c.Optional(c.Int32ul), # 52
"arp.time" / c.Optional(c.Float32l), # 56
"arp.gate" / c.Optional(c.Float32l), # 60
"arp.slide" / c.Optional(c.Flag), # 61
"_u3" / c.Optional(c.Bytes(1)), # 62
"time.full_porta" / c.Optional(c.Flag), # 63
"keyboard.add_root" / c.Optional(c.Flag), # 64
"time.gate" / c.Optional(c.Int16ul), # 66
"_u4" / c.Optional(c.Bytes(2)), # 68
"keyboard.key_region" / c.Optional(List2Tuple(c.Int32ul[2])), # 76
"_u5" / c.Optional(c.Bytes(4)), # 80
"fx.normalize" / c.Optional(c.Flag), # 81
"fx.inverted" / c.Optional(c.Flag), # 82
"_u6" / c.Optional(c.Bytes(1)), # 83
"content.declick_mode" / c.Optional(StdEnum[DeclickMode](c.Int8ul)), # 84
"fx.crossfade" / c.Optional(c.Int32ul), # 88
"fx.trim" / c.Optional(c.Int32ul), # 92
"arp.repeat" / c.Optional(c.Int32ul), # 96; FL 4.5.2+
"stretching.time" / c.Optional(LinearMusical(c.Int32ul)), # 100
"stretching.pitch" / c.Optional(c.Int32sl), # 104
"stretching.multiplier" / c.Optional(Log2(c.Int32sl, 10000)), # 108
"stretching.mode" / c.Optional(StdEnum[StretchMode](c.Int32sl)), # 112
"_u7" / c.Optional(c.Bytes(21)), # 133
#"fx.start" / c.Optional(LogNormal(c.Int16ul[2], (0, 61440))), # 137
"fx.start" / c.Optional(c.Int32ul), # 137
"_u8" / c.Optional(c.Bytes(4)), # 141
"fx.length" / c.Optional(LogNormal(c.Int16ul[2], (0, 61440))), # 145
"_u9" / c.Optional(c.Bytes(3)), # 148
"playback.start_offset" / c.Optional(c.Int32ul), # 152
"_u10" / c.Optional(c.Bytes(5)), # 157
"fx.fix_trim" / c.Optional(c.Flag), # 158 (FL 20.8.4 max)
"_extra" / c.GreedyBytes, # * 168 as of 20.9.1
)
from pyflp.
Thank you, will try it.
from pyflp.
Could you wrap it in a try
and catch the ValueError
and then run the second one?
from pyflp.
Could you wrap it in a
try
and catch theValueError
and then run the second one?
Nah it won't work that way. Its not the correct place to do it.
from pyflp.
Related Issues (20)
- π `VSTPlugin.plugin_path` setter fails HOT 1
- π `RuntimeWarning: VSTPluginEvent: Unknown marker 6 detected` HOT 3
- π Unlocking trial project fails on FL's latest version HOT 2
- π`Arrangements.loop_pos` doesn't work
- π Unlocking FLP does not work. HOT 6
- π `VSTPlugin.name` encoded in UTF8 HOT 2
- πCan't unlock Sytrus HOT 3
- β¨ Comprehensive bounds checking for event values
- β¨ Stream and buffer support for `parse` and `save`
- β¨ Fruity Parametric EQ 2 parser HOT 1
- π UserWarning: Cannot parse event ArrangementID.Playlist HOT 1
- the worst doc i seeπ HOT 1
- π Python 3.12 Enum issue HOT 6
- β¨ Additional research into unknown fields HOT 2
- π FL 12 `fx.start` - `LogNormal` (duplicate) HOT 3
- π Example Code of "Implementing a plugin data parser" doesn't work
- π FLPEdit should be updated to an SDK-Project HOT 1
- β¨ MixerParamsEvent channel_data "type" field or similar
- π Enum error when parsing the flp file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyflp.