Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 02-04-2019, 12:15 PM   #1
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default There's no API function to set the swing amount in the MIDI editor?

Is this correct? There is a way to retrieve the value, but not to set it, unless I'm mistaken.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-04-2019, 04:00 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default

Correct.


Maybe take a look at existing script like : Script: Archie_MidiEditor; Swing grid minus one percent(MIDI editor).lua
X-Raym is offline   Reply With Quote
Old 02-04-2019, 04:02 PM   #3
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

I solved it in a different way: I'm retrieving the grid settings from the MIDI editor, apply them temporarily to the project grid and restore them afterwards.

However, swing does not seem to work with BR_GetClosestGridDivision. Notes get moved to a complete different grid, not even close to a swing grid.
So, for the time being, I had to remove the swing presets from my quantize script.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-04-2019, 05:15 PM   #4
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

Swing also doesn't work with "move note by grid division" annoyingly
Travesty is offline   Reply With Quote
Old 02-04-2019, 06:00 PM   #5
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

You mean in one of my scripts or Reaper default actions?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-05-2019, 02:07 AM   #6
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

Default
Travesty is offline   Reply With Quote
Old 04-19-2019, 02:39 AM   #7
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Quote:
Originally Posted by X-Raym View Post
Correct.


Maybe take a look at existing script like : Script: Archie_MidiEditor; Swing grid minus one percent(MIDI editor).lua
X-Raym, where is this script located? I can't find it anywhere. Googled like crazy.

Ahh found it by googling for Archie Reaper Scripts:
https://github.com/ArchieScript/Arch.../MIDI%20Editor
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 04-22-2019, 07:15 AM   #8
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

got those two plus and minus scripts for swing grid... but they error out with:

Swing Grid Minus 1.lua:35: attempt to call a nil value (global 'no_undo')

Perhaps _Stevie_ will give us something more???
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 04-23-2019, 01:44 PM   #9
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

Quote:
Originally Posted by Travesty View Post
Swing also doesn't work with "move note by grid division" annoyingly
Exactly, really annoying IMHO.
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 04-23-2019, 05:11 PM   #10
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

The way Archie does it, is the only way to set the swing in the MIDI editor.
It's very convoluted...

First, the script retrieves the swing intensity from the MIDI editor and saves it.
Then, the script sets the MIDI editor and Arrange to use the same grid settings. Finally, the swing intensity in the Arrange is altered by % (which now also affects swing settings in the MIDI editor) and then, the grid sync between the MIDI editor and Arrange is again turned off.
Not sure, why the script isn't working on your end, though.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 04-25-2019, 07:26 AM   #11
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,672
Default

putting in my support for anything that can be done to open up swing to scripters

i dream of being able to control all quantize functions (input quantize AND quantize dialog box) by midi/osc, so as not to leave the controller to reach for the mouse as often.

note that "Grid: Adjust swing strength (MIDI CC/mousewheel)" isn't very good due to midi ccs only having 128 steps, whereas grid has value of what, -100% - 0 - 100%? this makes cc control functionally useless
__________________
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.
mccrabney is online now   Reply With Quote
Old 04-26-2019, 08:57 AM   #12
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

while we are on the subject of swing grid, I notice a behavior that makes no sense to me.

It is easy for anyone to test.
Maybe you can explain the logic to me, cuz I don't see it, or maybe you can confirm that this is a silly bug.

How to see what I'm talking about:

In the MIDI Ed. set the grid to 1/4 note swing.
Set the swing amount to something... I used +36 but most anything will be fine...
clk in some notes all on the same pitch, but leave at least one note of empty space between them... more space is OK...
You only need 3 or 4 notes to see this happen...

OK now select all the notes and use the mouse to try and move them to the left... you can have Snap on or off... try it both ways

Do you see the notes grow and overlap each other? I do and it should not happen...

OK undo and get the notes back as they should be..
This time just select and move one note at a time... again Snap can be on or off...
This works as expected...

So WTF is going on when selecting them all and trying to move them?
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi 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 04:03 PM.


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