|
|
|
12-09-2018, 06:57 PM
|
#1
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Write project markers as media cues to selected items' active takes' source
amagalma_Write project markers as media cues to selected items' active takes' source files (WAV only)
(in ReaPack)
# Writes the project markers that cross the selected items as media cues of the selected items' active takes' source files
- Overwrites the files
- Issues warning if markers are going to appear to other items in the project that share the same source file
- To erase an existing media cue, place an unnamed project marker at the position of the cue
|
|
|
12-10-2018, 04:00 AM
|
#2
|
Human being with feelings
Join Date: Jan 2010
Posts: 201
|
Cool thank you amagalma!
|
|
|
12-10-2018, 12:48 PM
|
#3
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
You suucceeded to make it work without render ? :P
|
|
|
12-10-2018, 03:01 PM
|
#4
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Yes :P
I even have a version where the old cue/list chunks get turned to junk chunks (if they are mid file) and the new ones are appended, or they get overwritten if at the end, as we had discussed. In that version, writing cues is instantaneous, but I finally chose to go the other route as I feel it safer. In this version a new temp file is created and after checking that all went well, the old one is erased and the temp is renamed as the old one.
|
|
|
12-10-2018, 03:04 PM
|
#5
|
Human being with feelings
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,782
|
Nice!!
|
|
|
12-10-2018, 10:48 PM
|
#6
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
@amalgama
Very great job I can drop dev of my version of this then, you succeeded to make something more optimized and actually ready for public release :P
|
|
|
12-11-2018, 05:33 AM
|
#7
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Thanks for the kind words by a script guru! I didn't mean to spoil the development of your version though.. It is just something I wanted for my personal use and I shared (actually all my scripts in ReaPack are made for me in the first place).
If you have some other idea (I liked the window list with the cues you had made), and you think you could use part of my code for its development, please feel free to do it! Or we could collaborate if you want!
|
|
|
12-11-2018, 08:54 AM
|
#8
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
dont worry for my version ^^ the dev was on hold, so the path was clear and open for you All that matterd is that we know have a working public version. and this is good !
|
|
|
12-29-2018, 09:50 PM
|
#9
|
Human being with feelings
Join Date: Nov 2018
Posts: 24
|
This is fantastic. Until we get item markers we can now at least simulate them.
Does this also work with regions? Or just markers?
|
|
|
12-30-2018, 01:46 AM
|
#10
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Just markers. I could make it work with regions too but I am not sure what would be the best workflow to add/remove them, and since markers were enough for my personal use, I did not add the region functionality.
|
|
|
03-30-2019, 12:32 AM
|
#11
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,640
|
Thanks for this ! I have been looking for something to do this without have to render.
Is it possible to modify it so you can get user input for the name @ cursor pos of selected item
rather than markers or region name ?
|
|
|
03-30-2019, 11:15 AM
|
#12
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
You are welcome! It is possible to do another script that does what you say, but I have no time at the moment... When I have time I 'll do it
|
|
|
03-30-2019, 02:43 PM
|
#13
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,640
|
Thanks, much appreciated.
|
|
|
11-14-2019, 01:34 PM
|
#15
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,640
|
Could you mod that to do Write ACID Chunk ?
|
|
|
02-23-2020, 03:36 PM
|
#16
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Hi !
I'm exploring your amagalma_Write project markers as media cues to selected items' active takes' source files (WAV only) script,
I'm suprised that you almost don't create any functions ^^
I would love a function to send a list of markers / regions multidimensional array to a wav file name (no item, take or other reaper related consideration),
trying to understand your code, I can see some things special like conditions for less than 2Mo files etc... How come ?
Quite complex code anyway !
|
|
|
02-23-2020, 04:17 PM
|
#17
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
I am not in front of a PC now to check the code, but if I remember correctly the 2MB thing is the file chunk size that is read in memory. For example, imagine that you have only 1GB of memory and your audio file is 2GB. If you try to read it in one go, it will be a disaster. After doing tests with various chunk sizes, I found out that 2MB was the fastest setting (at least in my PC).
Code may be complex because I am not a proper programmer but a self-taught.
|
|
|
02-23-2020, 04:47 PM
|
#18
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Your code seems fully functionnal so really well done with that, I really struggle with wav parsing there is some key concept I'm not fluent with and the more I look at it, the more I'm blocked ^^
And I alreayd dig this subject several time !
Question : what is your core concept to update the "cue " and "list" chunk from the script ?
Do you first erased it from the file and then push new infos at the end ?
Do you copy original file chunk by chunk to a temp copy and then put some "cue " and "list" there,
updating the RIFF size header when everything is copied...
What is your magic ? ^^
You did put some nice comments but it is really the lack of function and nested comments which confuse me a bit :P
(I can wait for you to be in front of PC for answers of course !)
|
|
|
02-24-2020, 02:22 AM
|
#19
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Quote:
Originally Posted by X-Raym
Your code seems fully functionnal so really well done with that, I really struggle with wav parsing there is some key concept I'm not fluent with and the more I look at it, the more I'm blocked ^^
And I alreayd dig this subject several time !
Question : what is your core concept to update the "cue " and "list" chunk from the script ?
Do you first erased it from the file and then push new infos at the end ?
Do you copy original file chunk by chunk to a temp copy and then put some "cue " and "list" there,
updating the RIFF size header when everything is copied...
What is your magic ? ^^
You did put some nice comments but it is really the lack of function and nested comments which confuse me a bit :P
(I can wait for you to be in front of PC for answers of course !)
|
If I am not mistaken (just had a quick look at the code), it is done like this:
- store all existing marker data in a table
- see if we want to erase, update, or add markers. All this is done in the table
- make a copy of the file without the existing markers
- add the chunks that results from the markers table (if there are updates or additions)
- calculate and update riff size and close file
- if all good then erase original file and replace with new one in project
No magic involved
|
|
|
02-25-2020, 05:08 AM
|
#20
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Thx for the infos, it helps !
I'm very close to have stripped down your script to a single re-usable funciton which would take file path and new marker array as argument,
though I can see that your script doesn't support region loop ! ^^
There is loop support in my wavefile.py script fork (I corrected this part but the main thing isn't by me so I cant explain the details) : https://github.com/X-Raym/wavfile.py...avfile.py#L349
The infos for loops is written under the smpl chunk.
are you interested in bringing region-loop support to this script ?
|
|
|
02-25-2020, 07:37 AM
|
#21
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Also, I noticed a bug with your script,
if the item already has a loop region,
and that you use the script to write a marker BEFORE that region,
then the region-marker destinction of that marker is messed up,
Look how the BUG marker become a loop poin in item whil the Green loop in item become a marker.
My guess is that is determined by marker ID in the smpl chunk, which isn't touched by your script so can lead to error if the items has loop points.
|
|
|
02-25-2020, 07:42 AM
|
#22
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Here is some code from my own wavefile parser which might help:
Code:
elseif chunk_id == "smpl" then
local str = file:read(36)
local manuf, prod, sampleperiod, midiunitynote, midipitchfraction, smptefmt, smpteoffs, numsampleloops, samplerdata = string.unpack('< I4 I4 I4 I4 I4 I4 I4 I4', str)
Msg("\tidx\tdatatype\tpos_start\tpos_end\tfraction\tplaycount")
for i = 1, numsampleloops do
local str = file:read(24)
local cuepointid, datatype, pos_start, pos_end, fraction, playcount = string.unpack( "< I4 I4 I4 I4 I4 I4", str )
Msg( "\t" .. cuepointid .. "\t" .. datatype .. "\t" .. pos_start .. "\t" .. pos_end .. "\t" .. fraction .. "\t" ..playcount)
end
|
|
|
02-26-2020, 05:58 AM
|
#23
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Note I have succeed to do basic smpl chunk parsing,
I will soon have code to add regions as well
(and not break existing one !)
|
|
|
03-02-2020, 05:01 AM
|
#24
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Quote:
Originally Posted by X-Raym
though I can see that your script doesn't support region loop ! ^^
..
are you interested in bringing region-loop support to this script ?
|
I hadn't done it because I never use them.. But, why not?
Quote:
Originally Posted by X-Raym
Also, I noticed a bug with your script,
if the item already has a loop region,
and that you use the script to write a marker BEFORE that region,
then the region-marker destinction of that marker is messed up,
|
Oops! Got to fix that!
Quote:
Originally Posted by X-Raym
Note I have succeed to do basic smpl chunk parsing,
I will soon have code to add regions as well
(and not break existing one !)
|
Great! Looking forward to it!
|
|
|
03-02-2020, 09:59 AM
|
#25
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
I have built a successfull cue/loop function injector which doesnt break existing stuffs, I share the code with you ASAP.
|
|
|
03-02-2020, 02:40 PM
|
#26
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Great! Thanks!
|
|
|
05-24-2020, 11:28 AM
|
#27
|
Human being with feelings
Join Date: Apr 2015
Posts: 99
|
Hi!
Is there a way to only delete the cues and not the whole chunk?
The start offset gets deleted when using amagalmas scripts. That makes it impossible to use the "move item to source prefered position" after removing the media cues.
Thanks
|
|
|
05-25-2020, 01:50 AM
|
#28
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Hello! My script is currently abandoned and would require some time in order to be fixed.. So, for the moment I can't promise anything..
|
|
|
05-25-2020, 10:36 PM
|
#29
|
Human being with feelings
Join Date: Apr 2015
Posts: 99
|
Ok, I understand... Is there another tool that you could recommend for removing cues without rendering a new file?
thanks
|
|
|
05-26-2020, 03:03 AM
|
#30
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
It could be done via my codebase but scripting for Cue takes lot of times so this kind of request would fit by sponsored dev plan better. I havent shared Cue marker script pack yet.
|
|
|
05-26-2020, 08:50 AM
|
#31
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
Working with wav chunks is very time consuming... And I'll need more time to understand what I already did there It's not an easy fix
|
|
|
05-26-2020, 09:18 AM
|
#32
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
@amaglama
It took me times to understand what you did, but ultimately I found way to optimize it and make the code cleaner, and I even was able to make script from it ^^
It required Hex inspection of wavefile etc.... Really complex stuff to debug.
It was a very precious start though.
I had various approach of this as you know, using python parser, other lua parser, NodeJS etc... I tried everything ^^.
|
|
|
05-27-2020, 05:57 AM
|
#33
|
Human being with feelings
Join Date: Apr 2015
Posts: 99
|
What about using this package?
It is called "wavefile" by Rafael da Silva Rocha
https://developer.aliyun.com/mirror/...efile/v/10.2.0
https://github.com/rochars/wavefile?...244017cf1brXWY
From the manual;
Quote:
To delete a cue point use WaveFile.deleteCuePoint() informing the index of the point. Points are ordered according to their position. The first point is indexed as 1.
wav.deleteCuePoint(1);
Mind that creating or deleting cue points will change the index of other points if they exist.
To list all the cue points in a file, in the order they appear:
let cuePoints = wav.listCuePoints();
|
Would it be possible to call this package from reaper?
|
|
|
05-27-2020, 06:11 AM
|
#34
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
This is in javascript, so unfortunately no..
|
|
|
05-27-2020, 07:01 AM
|
#35
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
@JonasHAnd
Actually it is, via Node.js, and a custom JavaScript wrapper to make it works as a command line.
The first CUE markers scripts I made actually used this library :
https://forum.cockos.com/showthread.php?t=207539
But trust me it is Slow. And really heavy if you include Node.js.
I tried python wavefile library too etc
The pure Lua solution I have based on amalgama solutions is quicker than all these alternatoive by an order of magnitude, way more light weight (few ko compared to 50Mo of Node), way more maintainable etc.
All this cue markers injection Research and Development took me weeks so that's why I would rather build a custom script pack form it. I also need to bring some food on the table from time to time ^^
|
|
|
05-27-2020, 10:38 AM
|
#36
|
Human being with feelings
Join Date: Apr 2015
Posts: 99
|
I understand. Sound like a lot of work testing out all these methods and then converting to lua etc.
If you would make a script pack, what would it consist of?
What functions could be performed with it?
And what would be the price?
|
|
|
05-27-2020, 11:14 AM
|
#37
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
Quote:
What functions could be performed with it?
|
Anything is possible but for pack the scripts have to be pretty polyvalent,
so "simple" things like take markers to cue marker, project marker to cue markers, item section to cue markers, delete all or specific take markers... Price will depend on the pack size of course.
Too early to make a list. I have higher priority script task (for which I'm actually sponsored ^^) to perform for now. :P
|
|
|
05-27-2020, 11:39 AM
|
#38
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,450
|
@JonasHAnd: If you're willing to sponsor and since X-Raym is busy, and I have all my musical performances cancelled due to coronavirus, I could fix my original script or add things if you like...
|
|
|
05-27-2020, 01:24 PM
|
#39
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,866
|
@amagalma
It would be too bad ifyou can't take advantage of my improvements.
Maybe should I open source it...
|
|
|
05-28-2020, 04:17 PM
|
#40
|
Human being with feelings
Join Date: Apr 2015
Posts: 99
|
I found that CS_Glue with handles works for my use case. I get rid of the cues as they don't follow along to the new item and handles are intact unlike regular glue.
It is a bit annoying that I have to delete the old files manually and rename the new ones so they dont say "glue", but it works. The source position gets written again into the new file so as long as I do it directly after import I minimize chances of burning in incorrect source position.
After testing some more I see amagalmas script seems to work fine when removing cues created by the script itself (and possibly other sources as well but I have not tested). The problem occurs with cues that are created in logic pro x. When removing them the whole chunk gets removed; originator, cues, start offset, everything! I dont understand what could be different from cues created by the script.
Anyway, I dont have a recurring workflow that needs this, I was just curious if it was easy to fix the bug(?) in amagalmas script so I could perhaps keep the source files, but It's not too bad with the workaround above.
Anyway I thank you both for your offers amagalma and X-raym
I'll donate a small amount to X-Raym to show my support for creating a cue pack someday, when the time is right.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:30 AM.
|