perlence / rpp Goto Github PK
View Code? Open in Web Editor NEWRead and write Reaper RPP files with Python.
License: BSD 3-Clause "New" or "Revised" License
Read and write Reaper RPP files with Python.
License: BSD 3-Clause "New" or "Revised" License
Is it possible to use Perlence to create a RPP file from multiple MIDI files with those files showing up as items with vertical regions? I notice that RPP files store MIDI in ASCII format. The MIDI files I have are binary. I want to be able to program in Python:
insert_MIDI(file1.mid, time=00:00:00)
insert_MIDI(file2.mid, time=00:02:25)
insert_MIDI(file3.mid, time=00:04:50)
create_region(start=00:00:00, end=00:02:25, name="intro")
create_region(start=00:02:25, end=00:04:50, name="part 1")
create_region(start=00:04:50, end=00:06:00, name="chorus")
Please see the following code
import rpp
fx_chain = '''\
<FXCHAIN_REC
BYPASS 0 0
<JS sstillwell/3x3 ""
0 0 0 0 0 0 240 2400 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
WAK 0 0
BYPASS 0 0
<JS loser/5BandJoiner ""
0 0 0 0 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
WAK 0 0
>'''
track = rpp.Element(tag='TRACK', attrib=[], children=fx_chain_formatted)
rpp_root = rpp.Element(tag='REAPER_PROJECT', attrib=['0.1', '6.09/x64', '1594105202'],
children=track)
final_result = rpp.dumps(rpp_root)
The logic of how the code works is simple, it starts with the fx_chain piece of data to create a project.
But the result of running the code is completely different from what I expect, only the outermost tag is kept in the final rpp.dumps operation, and all the tags in the inner level are ignored, and the result is as follows.
<REAPER_PROJECT 0.1 6.09/x64 1594105202
BYPASS 0 0
<JS sstillwell/3x3 ""
0 0 0 0 0 0 240 2400 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
WAK 0 0
BYPASS 0 0
<JS loser/5BandJoiner ""
0 0 0 0 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
WAK 0 0
>
I wonder if there is something wrong with the recursive logic in your code? THX
I recently switched to Python 3.11 and found that rpp/rpp/encoder.py
reports an error when executing from collections import Iterable.
After looking through the source code, I found that this fix has been fixed in commit 0ba3583, but it was not released to pypi.
Can you please release a new version, I guess it might be rpp 0.5? Thanks a lot :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.