Old 08-15-2016, 02:31 PM   #1
tenfour
Human being with feelings
 
tenfour's Avatar
 
Join Date: Aug 2016
Posts: 18
Default "tenfour-step", a new way to step-record MIDI

I have written a set of custom actions that improve my MIDI-editing workflow. I am relatively new to Reaper for MIDI work, and I've recently posted a handful of messages recently asking for help adapting my workflow to Reaper, and my solution was to write a few scripts to smooth out the process. Maybe someone else would be interested in these scripts, maybe Reaper developers would be interested to see a different workflow.

The scripts are here, including up-to-date / official documentation: https://github.com/thenfour/ReaperSc...r/tenfour-step
And a video to demonstrate it: https://www.youtube.com/watch?v=07gs0X6StM4

Copy "tenfour-step" to the Scripts directory, so you end up with something like: /Users/tenfour/Library/Application Support/REAPER/Scripts/tenfour-step

--------------------------------------------------------
The core of this library is a bunch of scripts for entering notes (or chords):

* tenfour-insertHeldNotesAtEditCursor_Thirtysecond.lua
* tenfour-insertHeldNotesAtEditCursor_Sixteenth.lua
* tenfour-insertHeldNotesAtEditCursor_Eighth.lua
* tenfour-insertHeldNotesAtEditCursor_Quarter.lua
* tenfour-insertHeldNotesAtEditCursor_Half.lua
* tenfour-insertHeldNotesAtEditCursor_Whole.lua

Each of these takes the notes you're currently playing on your MIDI keyboard, and inserts them in the MIDI editor at the edit cursor for various durations. Velocity is preserved as you played it. It advances the edit cursor, and adjusts the grid size as well to a sensible value.

If you aren't playing any notes, then the cursor is moved & grid size adjusted without adding any notes. Basically, you're inserting a rest.

Existing MIDI notes are preserved. If you try to overwrite MIDI data, the old data will stay there.

If no MIDI clip exists, one is created. So this is also a very quick way to create a measure-long MIDI clip. If a MIDI clip already exists, it's expanded to make sure it can hold the new note.

This works in the MIDI editor, AND the main arranger view. This is actually pretty big; it means you can step record MIDI directly from arranger view, no inline MIDI editor needed.

If you've ever used Finale, this is very similar to "Quick Edit" mode. I feel like I get a lot of control, and melody-writing feels fluent.

I assign these scripts to numbers 2-3-4-5-6-7 on my keyboard. 5 is a quarter note.

To enter a note goes like this:
1. hold a note/chord on your MIDI keyboard
2. hit "5" on the computer keyboard, and your chord is inserted at the edit cursor. Edit cursor is advanced, and grid size is adjusted to a quarter note.

--------------------------------------------------------
There are a couple more bonus actions to make this workflow more robust:

* tenfour-addDotToHeldNotes.lua

I assign this to ".". When run, note durations are increased by a dot length. You should still be playing the notes for this to work. So to enter a dotted quarter note,

1. Play a chord, hold it..
2. Hit "5" to enter it as a quarter note
3. Hit "." to add the dot length
4. Release the chord

--------------------------------------------------------
And similar actions for modifying the length of notes you entered:

* tenfour-moveCursorLeftByGridSizeAndAlterDurationOfHeldNote s.lua
* tenfour-moveCursorRightByGridSizeAndAlterDurationOfHeldNot es.lua

I assign these to left / right arrow keys, replacing the "move cursor by grid size" default actions. Similar to how Ableton does step recording, these will move the cursor by the grid size, adjusting the note end with it. You must be holding down the notes for this to work.

Ableton users will be familiar with this operation. Together with the previous scripts, you have a pretty flexible workflow that shouldn't disrupt your existing workflow method.

Example scenario using this action:

1. You hold a chord
2. Hit "4" to enter it as an eighth note.
3. You realize actually you wanted that to be a quarter note
4. Hit right-arrow, and the duration increases by another eighth note.

--------------------------------------------------------
* tenfour-replaceChordAtEditCursorWithPlayingChord.lua
* tenfour-replaceChordAtEditCursorWithPlayingChordPreserving OriginalOctave.lua

Both of these scripts will replace the chord at the edit cursor with the chord you're playing on your MIDI keyboard.

I assign these to "Alt+Enter" and "Enter" in both midi & main views.

How to use it:
1. position the edit cursor at the start of a note/chord
2. hold a new note/chord on your MIDI keyboard
3. run this script.

The old notes will be replaced by the ones you're playing.

In the 2nd script, the notes will be transposed to match that of the original voicing.


--------------------------------------------------------
* tenfour-rotateVoicingDownAtEditCursor.lua

Takes the top note of the chord at the edit cursor, and transposes it down an octave. Basically it's cycling through chord inversions. If the above scripts ever gets the octave wrong, this is a way to quickly correct it.

Could easily be changed to work on the *selected* chord, not the chord at the edit cursor. But so far all of these scripts are tied to the edit cursor so that's what I stuck with.

* tenfour-rotateVoicingUpAtEditCursor.lua

Same as the above script, but rotates up.

--------------------------------------------------------
* tenfour-unarmAllTracksExceptSelectedTrack.lua

Disables record arm for all tracks except the selected one. Doesn't change the rec arm status of the currently-selected track. I have some tracks set to automatically arm when selected, and some not. In the spirit of one-click MIDI step-recording, I wanted a way to ensure that the selected track is the only one armed.


---------
*EDIT: HUGE thanks to snooks & eugen2777 and the creative method for capturing MIDI input.
*EDIT: 2016-08-20 Added more scripts

Last edited by tenfour; 08-20-2016 at 09:36 AM.
tenfour is offline   Reply With Quote
Old 08-15-2016, 03:14 PM   #2
woggle
Human being with feelings
 
Join Date: Nov 2015
Posts: 314
Default

thanks , this looks very handy - and really nice clear video
woggle is offline   Reply With Quote
Old 08-15-2016, 03:25 PM   #3
MikComposer
Human being with feelings
 
MikComposer's Avatar
 
Join Date: May 2012
Location: Brighton
Posts: 1,988
Default

Sugestion: how about assigning length to midi controller, like a knob, where every 15% changes the length?
__________________
My Royalty Free Music library
MikComposer is offline   Reply With Quote
Old 08-15-2016, 03:52 PM   #4
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,584
Default

Cool, that was quick! Btw I wasn't the first to use a JSFX to get MIDI, that was eugen2777 with his Retrospective Record script. It's not the same JSFX, but the same kind of thing.

(oh, from the comment in GitHub, the reason for the OR, idx|0x1000000 is that this is the flag set to tell Reaper the idx is an Input Effect)
snooks is offline   Reply With Quote
Old 08-17-2016, 08:39 AM   #5
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Sholder, Kentucky
Posts: 1,889
Default

this is awesome. please make sure this makes it into ReaPack.

your script moves us a bit closer to full-on hardware control of REAPER's midi sequencer without having to reach for the mouse all the time.

one FR that we might be able to fulfill ourselves by editing your code: prevent edit cursor to moving to the noteoff. this was an option in the old MPC series that i found useful for adding notes quickly and on predictable quantize positions, like say a clap alternating on every other snare.
__________________
° using REAPER as host/arranger/sequencer to write instrumental beat music.
° striving for a loop-based, controller-centric midi recording/editing workflow.
° reluctantly switched to using Ableton for live performance and actually enjoying it
mccrabney is offline   Reply With Quote
Old 08-17-2016, 09:32 AM   #6
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,771
Default

Quote:
Originally Posted by tenfour View Post
I have written a set of custom actions that improve my MIDI-editing workflow significantly. I am relatively new to Reaper for MIDI work, and I've recently posted a handful of messages recently asking for help adapting my workflow to Reaper, and my solution was to write a few scripts to smooth out the process. Maybe someone else would be interested in these scripts, maybe Reaper developers would be interested to see a different workflow. Maybe it's worthless and I'll soon realize this workflow sucks

The scripts are here: https://github.com/thenfour/ReaperScripts
And a video to demonstrate it: https://www.youtube.com/watch?v=07gs0X6StM4

Copy "tenfour-step" to the Scripts directory, so you end up with something like:

/Users/tenfour/Library/Application Support/REAPER/Scripts/tenfour-step

My goal here was to create a new MIDI step recording workflow that's more free-style than existing methods. I don't like recording MIDI takes live, and I don't like Reaper's step record. I need to be able to noodle around on the keyboard and enter notes / chords in at will.

This method of entry I created is very simple. You get a number of actions for entering notes:

* tenfour-insertHeldNotesAtEditCursor_Thirtysecond.lua
* tenfour-insertHeldNotesAtEditCursor_Sixteenth.lua
* tenfour-insertHeldNotesAtEditCursor_Eighth.lua
* tenfour-insertHeldNotesAtEditCursor_Quarter.lua
* tenfour-insertHeldNotesAtEditCursor_Half.lua
* tenfour-insertHeldNotesAtEditCursor_Whole.lua

Each of these takes the notes you're currently playing on your MIDI keyboard, and inserts them in the MIDI editor at the edit cursor for various durations. Velocity is preserved as you played it. It advances the edit cursor, and adjusts the grid size as well to a sensible value.

If you aren't playing any notes, then the cursor is moved & grid size adjusted without adding any notes.

If no MIDI clip exists, one is created. If one exists, it's expanded to make sure it can hold the new note.

This works in the MIDI editor, AND the main arranger view. This is actually pretty big; it means you can step record MIDI directly from arranger view, no inline MIDI editor needed.

If you've ever used Finale, this is very similar to "Quick Edit" mode. I feel like I get a lot of control, and melody-writing feels fluent.

I assign those to numbers 2-3-4-5-6-7. 5 is a quarter note.

There are a couple more bonus actions to make this workflow more robust:

* tenfour-addDotToHeldNotes.lua

I assign this to ".". When run, note durations are increased by a dot length. You should still be playing the notes for this to work. So to enter a dotted quarter note,

1. Play a chord, hold it..
2. Hit "5" to enter it as a quarter note
3. Hit "." to add the dot length
4. Release the chord

And similar actions for modifying the length of notes you entered:

* tenfour-moveCursorLeftByGridSizeAndAlterDurationOfHeldNote s.lua
* tenfour-moveCursorRightByGridSizeAndAlterDurationOfHeldNot es.lua

I assign these to left / right arrow keys, replacing the "move cursor by grid size" default actions. Similar to how Ableton does step recording, these will move the cursor by the grid size, adjusting the note end with it. You must be holding down the notes for this to work.

Example scenario:

1. You hold a chord
2. Hit "4" to enter it as an eighth note.
3. You realize actually you wanted that to be a quarter note
4. Hit right-arrow, and the duration increases by another eighth note.

Most of these actions set a new grid size. This grid size is selected based on the note you entered, and position in the measure. Examples:

- You enter a half note at beat 1 (downbeat). Grid size gets set to half note.
- You enter a half note at beat 2. Grid size gets set to quarter note.

The "add dot" action has similar decision making, so I still try to do sensible things for things like successive dots, or adding a dot to oddball durations.

---------
*EDIT: HUGE thanks to snooks and his creative method for capturing MIDI input.
Err, wow , this is pretty amazing, thanks a mil !

Integration in ReaPack would be great indeed !!
vanhaze is offline   Reply With Quote
Old 08-17-2016, 03:05 PM   #7
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 416
Default

Hi tenfour,
Thanks for these wonderful scripts and workflow. I have a problem. When run the actions reaper is also scrubbing the project.



Edit: I changed my scrubbing preferences. Now it is working correctly.

Last edited by mehmethan; 08-17-2016 at 03:10 PM.
mehmethan is offline   Reply With Quote
Old 08-18-2016, 06:04 AM   #8
xbitz_
Human being with feelings
 
Join Date: Jul 2016
Posts: 92
Default

amazing BIG THX (from an Ableton Live refugee...)
xbitz_ is offline   Reply With Quote
Old 08-20-2016, 09:24 AM   #9
tenfour
Human being with feelings
 
tenfour's Avatar
 
Join Date: Aug 2016
Posts: 18
Default

Updates!

First let me say thanks for the positive messages. As a self-proclaimed Reaper newbie, I was completely expecting the response to be "um, don't do it like that. We Reaper people do it like THIS..."

I have updated the code, adding a couple scripts which I found were needed:

- tenfour-replaceChordAtEditCursorWithPlayingChord.lua
Use this to replace a chord in the take with the chord you're currently playing.
How to use:
1. position the edit cursor at the beginning of a chord
2. play a chord on your MIDI keyboard
3. run this script.
I have bound it to "Alt+Enter".

- tenfour-replaceChordAtEditCursorWithPlayingChordPreserving OriginalOctave.lua
Same as the above, but it transposes the new chord to match the octave of the one you're replacing. This way you don't need to bother trying to match it first. 99% of the time, this is what I want, so I have bound it to "Enter".

- tenfour-rotateVoicingDownAtEditCursor.lua
Takes the top note of the chord at the edit cursor, and transposes it down an octave. Basically it's cycling through chord inversions. If the above scripts ever gets the octave wrong, this is a way to quickly correct it.

Could easily be changed to work on the *selected* chord, not the chord at the edit cursor. But so far all of these scripts are tied to the edit cursor so that's what I stuck with.

- tenfour-rotateVoicingUpAtEditCursor.lua
Same thing, but going up.

- tenfour-unarmAllTracksExceptSelectedTrack.lua
Disables record arm for all tracks except the selected one. Doesn't change the rec arm status of the currently-selected track. I have some tracks set to automatically arm when selected, and some not. In the spirit of one-click MIDI step-recording, I wanted a way to ensure that the selected track is the only one armed.


Quote:
Originally Posted by mccrabney View Post
one FR that we might be able to fulfill ourselves by editing your code: prevent edit cursor to moving to the noteoff. this was an option in the old MPC series that i found useful for adding notes quickly and on predictable quantize positions, like say a clap alternating on every other snare.
Not sure I understand. Don't you want the cursor to advance as you enter the part?

Quote:
Originally Posted by MikComposer View Post
Sugestion: how about assigning length to midi controller, like a knob, where every 15% changes the length?
I am not really sure how to set that up, but I am sure it's possible somehow with minimal editing. You'd need good visual feedback to know which notelength you've selected. The MIDI assignment and interpreting it in script is beyond me at the moment now. My instinct is that buttons would be better than a knob though, just in terms of being able to quickly & accurately choose a note length.

Good weekend everyone!
tenfour is offline   Reply With Quote
Old 08-20-2016, 09:47 AM   #10
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Sholder, Kentucky
Posts: 1,889
Default

in this requested variation of the script, no, i would prefer if the edit visit did not advance to the note end and instead remained at the position of entry. i move around my midi items using endless encoders so it would be nice to be able to quickly enter a note of a specified length and then zip to the next position manually.
__________________
° using REAPER as host/arranger/sequencer to write instrumental beat music.
° striving for a loop-based, controller-centric midi recording/editing workflow.
° reluctantly switched to using Ableton for live performance and actually enjoying it
mccrabney is offline   Reply With Quote
Old 08-20-2016, 09:49 AM   #11
tenfour
Human being with feelings
 
tenfour's Avatar
 
Join Date: Aug 2016
Posts: 18
Default

Quote:
Originally Posted by mccrabney View Post
in this requested variation of the script, no, i would prefer if the edit visit did not advance to the note end and instead remained at the position of entry. i move around my midi items using endless encoders so it would be nice to be able to quickly enter a note of a specified length and then zip to the next position manually.
Aha, and I think it makes sense NOT to set the grid size as well then, correct? I can easily create a variation of these scripts for this.
tenfour is offline   Reply With Quote
Old 08-20-2016, 10:12 AM   #12
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Sholder, Kentucky
Posts: 1,889
Default

yeah that'd be awesome!

the holy grail might be too inconvenient, but what if the note duration was entered as held? so instead of a predetermined length, the script listened to how long you held the notes and then set their duration by calculating the time-held by the project tempo, perhaps with note off quantized to the current grid?

this might be useful for both the original script and my suggested "static" version but i get it if this is too far from the original idea.

great work!
__________________
° using REAPER as host/arranger/sequencer to write instrumental beat music.
° striving for a loop-based, controller-centric midi recording/editing workflow.
° reluctantly switched to using Ableton for live performance and actually enjoying it
mccrabney is offline   Reply With Quote
Old 08-22-2016, 06:02 AM   #13
tenfour
Human being with feelings
 
tenfour's Avatar
 
Join Date: Aug 2016
Posts: 18
Default

I published yet more updates, this time removing the whole "extend note by dotted duration", which was never going to be reliable outside of an actual notation view. Instead I added "extend by quarter note", "extend by eighth note", etc. This is much simpler & intuitive anyway.

Quote:
Originally Posted by mccrabney View Post
yeah that'd be awesome!
...what if the note duration was entered as held? so instead of a predetermined length, the script listened to how long you held the notes and then set their duration by calculating the time-held by the project tempo, perhaps with note off quantized to the current grid?

this might be useful for both the original script and my suggested "static" version but i get it if this is too far from the original idea...
Yea it's definitely possible, but I think it's indeed a bit too far off my original conception. Shouldn't be too hard to use the core code though to quickly whip this up.

As for the "static" version, this is super easy but I am just trying to figure out a manageable way to deal with all the permutations of scripts.

There are a number of other permutations that I think would be useful, for example instead of modifying the currently-playing notes, modify the selected notes (more traditional strategy). Very easy to implement, but if I have like 4 different dimensions on 6 note-lengths, this is a lot of scripts with very long names. For the moment i'll make sure the basic code supports it, making way for people to easily create variations to suit their own needs.
tenfour is offline   Reply With Quote
Old 08-22-2016, 07:48 AM   #14
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Sholder, Kentucky
Posts: 1,889
Default

seeing a note duration by cc with definable high and low boundaries would be cool too.

your idea has certainly captured my imagination. can't wait to see what else you come up with.
__________________
° using REAPER as host/arranger/sequencer to write instrumental beat music.
° striving for a loop-based, controller-centric midi recording/editing workflow.
° reluctantly switched to using Ableton for live performance and actually enjoying it
mccrabney is offline   Reply With Quote
Old 08-22-2016, 07:20 PM   #15
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 14,754
Default

ten four VERY nice thanks so much!

but ooops having nothing but trouble with github... can't seem to dl the folder

Is there some reason you don't care to upload this folder to the reaper stash? that would make it much easier and not dependent on having a supported browser
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain

Last edited by hopi; 08-22-2016 at 07:31 PM.
hopi is offline   Reply With Quote
Old 09-18-2016, 01:06 AM   #16
pinksoir
Human being with feelings
 
pinksoir's Avatar
 
Join Date: Aug 2012
Posts: 214
Default

Really excellent and useful script, this. I'll be using it a lot.
__________________
Bear Worship on Bandcamp
pinksoir is offline   Reply With Quote
Old 10-02-2017, 09:25 PM   #17
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 247
Default

I know this is kind of an old thread, but I've been trying to use this and I've had a few problems:

-Is there a way to input triplets or swing notes?
-Reaper's undo function doesn't work on your script actions. Is there a way to enable this?
Dex is offline   Reply With Quote
Old 02-28-2019, 03:00 PM   #18
themixtape
Human being with feelings
 
themixtape's Avatar
 
Join Date: Aug 2009
Posts: 591
Default

Just found this today. Looks dope! Any updates with it?
themixtape is offline   Reply With Quote
Old 05-01-2019, 02:30 PM   #19
Yorkz
Human being with feelings
 
Yorkz's Avatar
 
Join Date: Jan 2007
Location: Canada
Posts: 115
Default

Does this script still work or am I doing something wrong?
- D/l'd tenfour-step folder from github
- installed into Reaper scripts directory
- loaded 'Script: tenfour-replaceChordAtEditCursorWithPlayingChord.lua'
- assigned shortcut (Shift 5 in my case)
- added synth
- played chord and then hit 'Shift 5'
- nothing happens

This really fits my composing style..would love to get it working.

Thanks!
Yorkz is offline   Reply With Quote
Old 05-01-2019, 02:38 PM   #20
Fergler
Human being with feelings
 
Fergler's Avatar
 
Join Date: Jan 2014
Posts: 3,903
Default

Would you have any interest, since you mentioned Finale, of replicating HyperScribe?

That was the only comfortable way I've ever entered MIDI, besides maybe my method in Dorico which is rhythms first in real time record, then adjust the pitches after by playing the melody at any tempo I want. Hyperscribe takes out the second step.
__________________
Check out my hip-hop, funk-rock band Theatre Crisp
Fergler is offline   Reply With Quote
Old 05-01-2019, 03:08 PM   #21
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,806
Default

Quote:
Originally Posted by Yorkz View Post
Does this script still work or am I doing something wrong?
- D/l'd tenfour-step folder from github
- installed into Reaper scripts directory
- loaded 'Script: tenfour-replaceChordAtEditCursorWithPlayingChord.lua'
- assigned shortcut (Shift 5 in my case)
- added synth
- played chord and then hit 'Shift 5'
- nothing happens

This really fits my composing style..would love to get it working.
Did you try playing the chord, then hitting your shortcut?
TonE is offline   Reply With Quote
Old 05-01-2019, 05:55 PM   #22
Yorkz
Human being with feelings
 
Yorkz's Avatar
 
Join Date: Jan 2007
Location: Canada
Posts: 115
Default

Quote:
Originally Posted by TonE View Post
Did you try playing the chord, then hitting your shortcut?
Yup - held down chord and hit shortcut. I even added the action as a menu item to test but still no go. Does it work for you?
Yorkz is offline   Reply With Quote
Old 05-01-2019, 06:10 PM   #23
Yorkz
Human being with feelings
 
Yorkz's Avatar
 
Join Date: Jan 2007
Location: Canada
Posts: 115
Default

NVM. I wasn't using it right. Needed to have a chord already in place so that it can be replaced - as per the script description.

Cheers.
Yorkz is offline   Reply With Quote
Old 05-02-2019, 04:21 AM   #24
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 1,806
Default

Cool it worked.
TonE is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.