MPL Dump Retrospective Record log (no JSFX required)
UPD 08.04.23: the script is no longer supported, since REAPER has this feature natively.
================================================== =============
Concept: dump all incoming MIDI events into project MIDI data without actully recording it.
Before 2021 it was implemented using custom JSFX tracker.
After 2021 REAPER 6.39+ has native way to do this.
Instructions: 1) play something on your MIDI device connected to REAPER, 2) run script. Result: incoming MIDI is inside selected track new take at edit cursor.
Here is bunch of scripts from ReaPack:
Free version: mpl_Dump Retrospective Record log (old version). No dependencies and mostly built around Justin`s code.
Paid version:
mpl_Dump Retrospective Record log.lua kinda general script, uses optimized settings, including breaks to not get previous added data and obey looped recordings as multiple takes
mpl_Dump Retrospective Record log (notes only).lua
mpl_Dump Retrospective Record log (only data at playing).lua - event put into their played positions
mpl_Dump Retrospective Record log (only data at stop).lua - start from edit cursor to a event list length
mpl_Dump Retrospective Record log (everything recorded from last REAPER start).lua - collect everything without any filters
mpl_Dump Retrospective Record log (everything from last 5 minutes).lua - ignore break, dump everything based on time limit
mpl_Dump Retrospective Record log (everything from last 10 minutes).lua
mpl_Dump Retrospective Record log (everything from last 30 minutes).lua
mpl_Dump Retrospective Record log (everything from last hour, obey stored data break).lua
These scripts use VariousFunctions package 2.62+ from my repository (which is paid).
They have different (better) way of handling/sorting data, also they are easier to extend so any suggestions welcome.
old post:
Eugen made previously a JSFX writing MIDI data during playing project, and the script dumping this data as new item.
gmem API allows to share memory across JSFX and Reascript, so what I did is easier to think through and code.
Here are parts of making this real:
RetrospectiveRecord_tracker.jsfx is a JSFX sitting at some fixed track FX Chain to receive MIDI data for further translating it into ReaScript.
mpl_Prepare selected track for RetrospectiveRecord tracker.lua
Eugen`s script search for track where tracker is inserted and add/hide it automatically if not found. I personally don`t like such things, so I made this action going manual. The script add RetrospectiveRecord tracker, disable parent send, enable monitoring, record arm, set input to all channels all MIDI devices, disable record). You can hide this track, add to default project template and forget.
mpl_Dump RetrospectiveRecord tracker log to selected track.lua 1) dump raw MIDI log into new item/take on selected track at edit cursor. Since tracker write system timestamps (not related to playing state), script just put whole buffer data as is, not syncronized to project, if you played while playing project; 2) reset buffer data.
Buffer is limited to 3.500.000 messages (it wraps if buffer filled).
Requirements:
Require REAPER 5.97+.
ReaPack 1.2+
Download: ReaPack.com (MPL`s repository is embedded into default ReaPack configuration)
Install:
run ActionList > ReaPack: Browse packages...
navigate and install Various_functions.lua, RetrospectiveRecord_tracker.jsfx, mpl_Prepare selected track for RetrospectiveRecord tracker.lua, mpl_Dump RetrospectiveRecord tracker log to selected track.lua packages
Does it work if playback is NOT engaged? Previous version by Eugen requires playback to be active. Just yesterday I wanted to point this out in another thread and now you post this! Awesome work - I'm gonna test this immediately!
Edit: YES IT WORKS EVEN WHEN PLAYBACK IS NOT ENGAGED. AWESOME!!!
So, I put JSFX in input FX chain in all of my track templates now and it all works. Thank you MPL - you just made my day! No more losing best performances!
Great work (as always) mpl, but man, wouldn't it be so much easier if this was just built into Reaper, no fussing with JSFX or anything?
Absolutely agree. This one was made only as a temporary solution. I remember I asked Justin for having global incoming MIDI data log as accessible text (like OSC messages log in OSC setup window). Not sure is that so complex to implement (probably because of MIDI control/input data handling difference) on the Reaper side though.
- in case of recording during playback, would it be possible to create the item at the start time of the playback, instead of the edit cursor location?
- often, I'm doing overdubs, like doing a 2nd pass for the CCs. Would it be possible to merge the CC item with the pre-existing item? Maybe as a preference. Not sure if everyone would like that behavior. But to me it would absolutely make sense to merge the recording with the underlaying item.
- often, I'm doing overdubs, like doing a 2nd pass for the CCs. Would it be possible to merge the CC item with the pre-existing item? Maybe as a preference. Not sure if everyone would like that behavior. But to me it would absolutely make sense to merge the recording with the underlaying item.
Yeah, but cumbersome when retro-Recording in the MIDI editor.
So create a macro and put in on the MIDI toolbar. You can run main actions from the MIDI editor using scripts. I have a bunch of EEL scripts made for MIDI editor just for that. Here are a few examples:
Code:
function Main ()
(
Main_OnCommand(41144, 0); // FX: Set MIDI learn for last touched FX parameter
);
Main();
function NoUndoPoint ()(abs(0)); // Makes sure there is no unnecessary undo point created, see more
defer("NoUndoPoint()"); // here: http://forum.cockos.com/showpost.php?p=1523953&postcount=67
Code:
function Main ()
(
Main_OnCommand(NamedCommandLookup("_BR_SAVE_CURSOR_POS_SLOT_16"), 0); // SWS/BR: Save edit cursor position, slot 16
);
Main();
function NoUndoPoint ()(abs(0)); // Makes sure there is no unnecessary undo point created, see more
defer("NoUndoPoint()"); // here: http://forum.cockos.com/showpost.php?p=1523953&postcount=67
edit:
I still can't come to my senses from using MPL's awesome script. I literally cannot describe the joy and wonder I feel every time I press the shortcut to load my precious retrospectively recorded MIDI data. MPL, you literally save my newborn babies every time I use it. May you have everything Valhalla offers and then some more, but in this life time! xd
Ah no, I meant something else. Executing the script from the MIDI editor isn't the issue.
The issue is, that a separate item is created and I would like to immediately see the CC and the notes in the editor. But I have to exit and then glue both items to do so.
Ah no, I meant something else. Executing the script from the MIDI editor isn't the issue.
The issue is, that a separate item is created and I would like to immediately see the CC and the notes in the editor. But I have to exit and then glue both items to do so.
Create a macro that select them both (this is where have to get a bit creative on how to determine what to select), glues them and then opens them in the MIDI editor xd
There's also an option to overdub into existing MIDI item so if you already know what you're doing and are engaging record then you can use that
- in case of recording during playback, would it be possible to create the item at the start time of the playback, instead of the edit cursor location?
- often, I'm doing overdubs, like doing a 2nd pass for the CCs. Would it be possible to merge the CC item with the pre-existing item? Maybe as a preference. Not sure if everyone would like that behavior. But to me it would absolutely make sense to merge the recording with the underlaying item.
- in case of recording during playback, would it be possible to create the item at the start time of the playback, instead of the edit cursor location?
added for 1.02
Quote:
Originally Posted by foxAsteria
Audio still not a possibility?
Probably required testing AudioWriter APIs by Xenakios (is that SWS thing?) and additional tracker (to not reduce maximum buffer length for current MIDI tracker), but seems possible.
Ask someone clever to code it, pretty easy to do.
... but man, wouldn't it be so much easier if this was just built into Reaper, no fussing with JSFX or anything?
Of course, but imagine Reaper would be Krüppelmididaw Ableton Live or Steinzeitdaw Cubase, no extension at all, here users have unlimited scripting options, lua, python, autohotkey, actually you can use any programming language which can work on audio or midi, just trigger that tool via python. I gave autohotkey because of this as one example. I mean really, full autohotkey scripts triggered as Reaper actions, full reaper actions. Something like:
PHP Code:
reaper action > python > triggering autohotkey script > result is anything what is possible with autohotkey
What for example? Also crazier stuff, like pixelsearch, then moving the mouse there, doing something there. Or switching to reaper forum, writing a post, coming back to reaper. Or doing OCR, then typing in required numbers for freeing plugins which try to put limitations like Venom VB-303 in midi mode. Or anything what is normally not possible but somehow possible using some tricks.
mpl, thanks and great work on retrospective record.
apologies for the off topic, but i see possible similarities here and this has been a FR of mine for a long time:
FR - could elements from this script be used in a sister script that [does stuff] to most recently recorded midi?
example:
1- toggle RECORD ON.
2- engage script
3- record midi into an item
4- toggle RECORD OFF.
5- script selects midi data recorded between steps 1 and 4
__________________ mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.
MPL! You did it again. Awesome script - I just keep the JS in the input fx section of my Instrument Track template. Works a charm, thanks a lot!
__________________ Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x "If I can hear well, then everything I do is right" (Allen Sides)
Okay, it's different, the item is created but it's moved to a complete different position.
My projects start always with a timecode of 10:00:00:00, could this be the culprit? In this particular case, the item was moved to 19:27:33:19, whereas I recorded at around 10:09:53:XX.
EDIT: oh an the new item gets automatically looped, if we enlarge it. On purpose?
EDIT: the memory is not cleared, when pressing play, e.g. when I dump the content to a track, all the noodling that happened before pressing play is also included.
the memory is not cleared, when pressing play, e.g. when I dump the content to a track, all the noodling that happened before pressing play is also included.
Memory cleared only after dumping log to the track.
I can add a cleaning buffer action, so you can make a cycle ction:
1) clear buffer
If stopped
2a) transport play
Else
2b) transport stop/pause
For 1.03 fixed issue with project offset and looping for new item.
The clear buffer on transport start would be really great. There is never a situation where I want to include both data from when transport is stopped AND when transport is playing. It will always be one or the other. I'm pretty sure that would be the consensus for anyone using it. The resulting combined midi item would just never make any sense.
If this can't be implemented for some reason, could you perhaps split it into two scripts? One for retro recording when transport stopped, and one for retro recording when transport is playing? Then at least there could be two separate shortcuts to trigger and stopped retro record data would never be combined with transport playing retro record data.
The clear buffer on transport start would be really great. There is never a situation where I want to include both data from when transport is stopped AND when transport is playing. It will always be one or the other. I'm pretty sure that would be the consensus for anyone using it. The resulting combined midi item would just never make any sense.
As I said before, the buffer are simply MIDI Messages + system timestamps pairs without any additional info (otherwise it would require smaller buffer size). I added mpl_Clear RetrospectiveRecord tracker log.lua to my repo. It reset buffer, but to make it properly working you have to import something like this into Cycle Action Editor:
As I said before, the buffer are simply MIDI Messages + system timestamps pairs without any additional info (otherwise it would require smaller buffer size).
Honestly, I really think you should just incorporate it directly into the retrorecord script. Normal usage would always be to capture while stopped or capture while playing. I don't think anyone would ever want to play notes while stopped, then start transport play, then play a part in and retrorecord everything into one item. Just in terms of working to a tempo map, the data captured while stopped would have no relation to the tempo map at all.
Anyone else care to chime in on this?
Also, and I think Stevie might have asked for this. Would there be any way to have an option that if a retrorecorded midi item overlaps an existing midi item that it automatically merges/glues the two midi items? With the ability to switch between it 1) not merging/gluing when the retrorecord midi item overlaps an existing midi item and 2) it merging/gluing?
Thanks so much for your consideration and your work. I would definitely donate again for those things.
I can't think of any case where it would make sense to keep "both" buffers (stop and playback), because they will have different tempos.
Recording while transport is stopped will always be "free tempo", whereas during playback, it will always be the tempo that the click provides.
And yes, merging would be amazing. mpl, I could make a short GIF to explain, if you want.
If this is feasable, I'd also gladly donate again.
- I press play in the MIDI editor
- during playback I use the mod wheel
- I press my shortcut for retrospective record and a new item is created
- now, I have to leave the MIDI editor, glue both items and enter the MIDI editor again to see both, notes and mod wheel
Would the following be possible?
- if there's an existing item under the play/edit cursor, dump everything
in this item.
Attach simple project to reproduce the issue.
And please use links to GIFs or smaller GIFs. I hate Reaper5 forum theme and my Reaper3 forum view is awfully wide with such GIFs.
Just in terms of working to a tempo map, the data captured while stopped would have no relation to the tempo map at all.
That is why I built this script. Many users asked to have a possibility to hold their improvisations without any relation to playing state. If you strongly want it to work only while playing, you can use Eugene's version (see link in first post).
That is why I built this script. Many users asked to have a possibility to hold their improvisations without any relation to playing state. If you strongly want it to work only while playing, you can use Eugene's version (see link in first post).
Sorry, I must not be doing a very good job of explaining myself. I should probably just let Stevie handle it lol.
I don't want it to work only while playing. I would like it to do both - retrorec while stopped and retrorec while playing. But just never have stopped data combined with data while playing. Hence, the request for the automatic clearing of the buffer.
If it's too much trouble, I'll make a cycle action. I appreciate your consideration.
If it's too much trouble, I'll make a cycle action. I appreciate your consideration.
You don't need to make it, I posted above ready-to-go CA, you just have to import it. In my case (way I built JSFX) it is better to use additional action for cleaning buffer rather than adding an option to JSFX.