Go Back   Cockos Incorporated Forums > REAPER Forums > JSFX and ReaScript Discussion

Reply
 
Thread Tools Display Modes
Old 12-08-2017, 04:50 PM   #41
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,608
Default

@FnA
There is reaper.BR_IsMidiOpenInInlineEditor( take ), but maybe using only selected items active take is enough (and a condition to check if it is MIDI editor or Main view if possible - I don't remember it it is possible).

Having a single scripts in multiple domain (Main, Midi Editor etc) is a bit more complex for reapack too, you will have to ask cfillion for the details.
X-Raym is offline   Reply With Quote
Old 12-08-2017, 05:03 PM   #42
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

He told me how already, unless it has changed recently? Well, I don't know if I want to make it possible for anything but the focused item to get it's notes joined. Could result in accidents. So maybe just the two for big MIDI Editor...

edit. I also think it will multiply the overlapping note chaos that someone will surely run into. Especially someone unfamiliar with this thread or others which discuss the problem. Maybe I should include "correct overlapping notes" action.

Last edited by FnA; 12-08-2017 at 05:50 PM.
FnA is offline   Reply With Quote
Old 12-08-2017, 09:25 PM   #43
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

I edited the script post that has appeared in some single post links recently. I did a few experiments and found that there is apparently no MIDI script that can be relied on to leave overlapping notes intact. I don't think most Reaper users realize this. I'm a little uncomfortable having "FnA" on a MIDI note script in a prominent place until that becomes well known knowledge. (maybe "correct overlapping notes" will stop unexpected behavior, if also included in the title) juliansader mentioned something to this effect here:
https://forum.cockos.com/showthread.php?t=159848
about post #11.

Undo can also be strange after the notes get rearranged.

Last edited by FnA; 12-08-2017 at 09:59 PM.
FnA is offline   Reply With Quote
Old 12-08-2017, 09:57 PM   #44
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 219
Default

Quote:
Originally Posted by FnA View Post
I edited the script post that has appeared in some single post links recently. I did a few experiments and found that there is apparently no MIDI script that can be relied on to leave overlapping notes intact. I don't think most Reaper users realize this. I'm a little uncomfortable having "FnA" on a MIDI note script in a prominent place until that becomes well known knowledge. (Sure, they are still very useful, and maybe "correct overlapping notes will stop unexpected behavior, if included in the title) juliansader mentioned something to this effect here:
https://forum.cockos.com/showthread.php?t=159848
about post #11.

Undo can also be strange after the notes get rearranged.
Thank you for your script, doing my job perfect!

strachupl is offline   Reply With Quote
Old 12-08-2017, 10:17 PM   #45
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Nice to hear.

I wonder if anyone might run into a situation where a rounding error or something might stop some notes from being joined. The input box script would cover that, or the max_join_space variable at the top could be changed from 0 to 1 or more. Join adjacent, and almost adjacent, notes.
FnA is offline   Reply With Quote
Old 12-08-2017, 10:35 PM   #46
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 219
Default

Quote:
Originally Posted by FnA View Post
Nice to hear.

I wonder if anyone might run into a situation where a rounding error or something might stop some notes from being joined. The input box script would cover that, or the max_join_space variable at the top could be changed from 0 to 1 or more. Join adjacent, and almost adjacent, notes.
almost adjacent notes works too

strachupl is offline   Reply With Quote
Old 12-08-2017, 10:56 PM   #47
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

lol. That is the only one I use. I have Enter button on mouse so it doesn't bother me. No input+Enter = 0+Enter.

I just realized something. There is now a function to refocus MIDI editor. Using input box causes main window to get focus. I will update tomorrow.
FnA is offline   Reply With Quote
Old 12-08-2017, 11:21 PM   #48
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Awesome that this is still getting tweaked. You scripters rock. Just please don't forget a lot of us use scripts live or with controllers so can't enter values or confirm dialogs.
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 12-09-2017, 07:50 AM   #49
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Nothing has really changed since original post. Usually a script like that can be made to just do x default values fairly easily. So not a big deal to ask for a change.

The midi refocus thing is also an action, I think. Could be macro instead maybe. Trying to think if there's some reason to leave it out.

Also, the script could probably join any selected overlapping notes with a rewrite, but I think it is not possible for the unselected ones to survive the Set part of the script as overlapping. Actually, maybe not. Get note function might not be able to see the note on/off the same way you can in the midi editor. (edit. It does not. It sees the next note off as the end.)

Last edited by FnA; 12-09-2017 at 04:58 PM.
FnA is offline   Reply With Quote
Old 12-09-2017, 11:54 AM   #50
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Oh cool. The only improvement that I could ask for then is that it could be run from the arrange window without opening ME. That's when I try to use it the most (after editing items and wanting to rejoin them without tiny orphan notes around the item splits), but I imagine that's still not possible...
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 12-09-2017, 04:34 PM   #51
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Quote:
Originally Posted by FnA View Post
I did a few experiments and found that there is apparently no MIDI script that can be relied on to leave overlapping notes intact.
This is probably too vague. I mean any script that alters MIDI data in a MIDI take. Doesn't apply to a script used in the MIDI actions list that just moves the cursor, for example. Selection and muting of notes/events in a script is "altering" the data in the take, as are more obvious things like changing channel, pitch, CC value. A script that works on CCs only can cause this overlapping note on/off reordering. See *


So the scripts would still work without the editor being open. The only thing the MIDI Editor is used for in the script is to get whatever take is being edited in it. Then, operations are directed toward that take. Some other scripts may incorporate a greater amount of MIDI Editor specific info, or use actual MIDI Editor actions, like Select All Notes or something.

It could use take under mouse cursor. It could be looped over any number of takes, say the common method of using active take in all selected items. But that is definitely getting into territory where SetAllEvents would be a big performance difference. I don't know how to use that method.

My script uses selection to limit the joining to certain notes. How would it be so limited otherwise? It sounds like you would want to use it right after gluing items together. There will be no overlapping notes then, but no selected ones either. You would have to store/mark the start and end positions of the items before gluing to limit the operations to those points. Or accept joining all adjacent notes in the item. (That might not be to hard to convert the script to) then you would have to start at the first note of the take and check each note until you pass the stop/cutoff point.

So, anyway, it's probably possible to do something like that, but is quite likely too much for me, personally, to take on right now.




* Scripts that use SetAllEvents method will allow some, but not all overlapping note situations to continue as they were. It puts the note on/offs back in the right place, but they might get mixed up as to which off belongs to which on. Mostly more complex cases. For example:
aaaaa
_bbb
turns into
aaaa
_bbbb

Last edited by FnA; 12-09-2017 at 05:56 PM.
FnA is offline   Reply With Quote
Old 12-29-2017, 07:18 PM   #52
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Quote:
Originally Posted by X-Raym View Post
+1 for this in Reapack !
This is what I will turn in. I hope some people will test/examine it so cfillion doesn't have to be bothered too much with changes, etc. There are two lines for ReaPack temporarily disabled. Its a package script that provides code for two action list entries. To try the Input Box version, just change false in this line:

isInput = false -- delete this for ReaPack, uncomment 2 previous lines

to true. As is, it performs the non-input box version.

It is supposed to work with overlapping notes as well as adjacent (or those within x ticks of each other in the input box version, as before). It joins only muted to muted, un-muted to un-muted. It should preserve unselected overlapping notes about as well as REAPER does when undoing, closing the editor, changing active item via track list, copy/pasting, etc. The SetAllEvents function forces that sorting even if no changes are applied to anything. It is a lot faster when many notes are involved because that function is used.

No effort put into handling notation, because for the most part it seemed to work out ok because the first note on is preserved. I put MIDI_Sort in. It seems to take care of strange looking slurs that go nowhere in particular after the note on they belonged to is removed. Not too sure about MIDI_Sort. Those aimless slurs go away when you select a note or something after running the script, so maybe it can be taken out if necessary.

Maybe I could make it work for "take under mouse cursor" for use with the Inline Editor.


EDIT:
Script removed. Updated scripts:
Script: FnA_Join selected overlapping and consecutive (adjacent) notes.lua
Script: FnA_Join selected overlapping and consecutive notes with spacing below threshold (input box).lua
now in ReaPack.

Last edited by FnA; 01-11-2018 at 12:22 AM.
FnA is offline   Reply With Quote
Old 12-29-2017, 07:55 PM   #53
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Thanks for this, FnA, I'll play around with it tonite or tomorrow and let you know if anything's amiss.
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 12-29-2017, 08:27 PM   #54
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

That will be great. If you can outline what you asked about earlier in more detail, (maybe some kind of pseudo custom action form?), I might be able to think of something to deal with it.
FnA is offline   Reply With Quote
Old 12-30-2017, 10:15 PM   #55
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Seems to be working better than before in terms of overlapping notes.

For my purposes (rejoining split MIDI items), the only improvement I could ask for would (and I doubt it's possible) would be that only notes touching the start or end of selected items get selected by the script. I guess that's more of a spinoff request from the script you have here, but a way to easily rejoin split MIDI and just the notes affected by those splits is all I'm really looking for.

This way I can use it directly from the Arrange without needing to select notes in the MIDI Editor or via action. There are scripts to select all MIDI notes in selected items, but occasionally I do have notes split on the grid that I want to keep separated.

After I select the items I want to join, this is the action I use:
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 12-30-2017, 11:17 PM   #56
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Maybe something like this:

Start.

It gets and stores start and end positions of selected items per track.

Glues items.

Then gets ppq (tick) positions from stored project times (there is a function for that). Joins notes that start before and end there/later and those that start there. It might need an allowance of a tick or two, because split might not line up with tick position. Not sure.

End.

I will have to mull it over for a while to think of easiest way. Or unforeseen difficulties at this time. Don't expect it tomorrow.
FnA is offline   Reply With Quote
Old 12-31-2017, 04:57 AM   #57
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,608
Default

I think that the script should be rename Join selected overlapping and consecutive notes under spacing threshold

Apart from that it seems ready for a reapack distribution !
X-Raym is offline   Reply With Quote
Old 12-31-2017, 07:28 PM   #58
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

I like that for the most part. "Threshold" appears in Action List a couple times. You use "below" in a script. I think it sounds a little better.

What do you think? Tentative name in script. I changed a couple little things, like t[i] = something rather than table.insert(t,something) because I read it's faster. And switching of one variable. Marked in red.


@foxAsteria: Looking like I might just go with something like you said about select only notes that touch the start or end. Might go easier that way.


EDIT:
Script removed. Updated scripts:
Script: FnA_Join selected overlapping and consecutive (adjacent) notes.lua
Script: FnA_Join selected overlapping and consecutive notes with spacing below threshold (input box).lua
now in ReaPack.

Last edited by FnA; 01-11-2018 at 12:23 AM.
FnA is offline   Reply With Quote
Old 01-01-2018, 01:01 AM   #59
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Quote:
Originally Posted by FnA View Post
Don't expect it tomorrow.
I don't expect it at all, but it would be great if you could manage it. Thanks either way!
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 01-01-2018, 10:40 AM   #60
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Try this. v1...

Quote:
Originally Posted by foxAsteria View Post
...only notes touching the start or end of selected items get selected by the script...
It doesn't exactly work that way, but you could probably imagine it being so. It gets the start time of second through last item on each track and saves it. Then after gluing it allows notes that start on those positions to be joined to a note that ends there as well. There is no 1 or 2 tick slop allowance in this. I'm a bit suspicious that a situation could arise where it might be needed, but I didn't run into it yet myself.

I thought I might make something more comprehensive that would handle overlapping items and such. Maybe some other time. This is mostly for items that butt together, which seems like what you want anyway.

Code:
-- glue and join v1.03

---------------------------------------------------
local r = reaper
local t_jointimes = {}
local t_SelItemsPerTrack = {}
local numtrks = 0
local t_SelItems = {}
local numitems = 0
local t_SelTakes = {}
local numtakes = 0
local prev_item_trk = false

function Fn_Floor(num)
  num = math.floor(num)
  return num
end

function Fn_Make_T_CPx4()
  local t = {}
  for i=1,16 do
    t[i] = {}
    for j=1,128 do
      t[i][j] = { {}, {}, {}, {} }
    end
  end
  return t
end

local T_CP = Fn_Make_T_CPx4() -- note channel and pitch matrix

function Fn_Clean_T_CPx4()
  for i=1,16 do
    for j=1,128 do
      T_CP[i][j] = { {}, {}, {}, {} }
    end
  end
end
----------------------------------

function Fn_Join_Notes_At_Item_Start_Times(take)
  local t_jt = {}
  for i=1, #t_jointimes[numtakes] do
    local jppq = Fn_Floor( r.MIDI_GetPPQPosFromProjTime(take, t_jointimes[numtakes][i]) + 0.5 )
    t_jt[jppq-1] = true; t_jt[jppq] = true; t_jt[jppq+1] = true
  end
  Fn_Clean_T_CPx4()
  local t1 = {} -- for pre packed variables, because need to "" some out
  local tableEvents = {} -- for packed string
  local gotAllOK, MIDIstring = r.MIDI_GetAllEvts(take, "")
  local MIDIlen = MIDIstring:len()  
  local s_empty = ""
  local i, runningppqpos, stringPos = 1, 0, 1
  local offset, flags, msg, c, p
  local doit = true
  -------------------------------------------------------------------------------------
  local function Fn_Do_Note_On(a,b)
    local len = #T_CP[c][p][a]
    local noteoff = T_CP[c][p][a][len]
    if noteoff and noteoff >= runningppqpos -1 then
      t1[ T_CP[c][p][b][len] ] [3] = s_empty -- "" note off msg in other table
      T_CP[c][p][a][len] = nil
      T_CP[c][p][b][len] = nil
      msg = s_empty
    end
  end
  
  local function Fn_Do_Note_Off(a,b)
    local len = #T_CP[c][p][a]
    T_CP[c][p][a][len+1] = runningppqpos
    T_CP[c][p][b][len+1] = i -- index in other table in case needs to be "" out
  end
  ------------------------------------------------------------------------------------
  while stringPos < MIDIlen do
    offset, flags, msg, stringPos = string.unpack("i4Bs4", MIDIstring, stringPos)
    runningppqpos = runningppqpos + offset
    jointime = t_jt[runningppqpos]
    
    if msg:len() == 3 then
      local mb1 = msg:byte(1) --MIDI event type and channel
      local evt = mb1 >> 4 --MIDI event type
      local mb3 = msg:byte(3) -- velocity
      
      if (evt == 9) and (mb3 ~= 0) then -- Note-on MIDI event type and selected and not 0 velocity
        if jointime then
          c = (mb1 & 0xf) + 1 -- channel
          p = (msg:byte(2)) + 1 -- pitch
          if (flags&2) == 2 then Fn_Do_Note_On(3,4) else Fn_Do_Note_On(1,2) end -- muted or not
        end
      elseif (evt == 8) or ( (evt == 9) and (mb3 == 0) ) then -- Note-off. (or on with Vel 0)
        c = (mb1 & 0xf) + 1 -- channel
        p = (msg:byte(2)) + 1 -- pitch
        if (flags&2) == 2 then Fn_Do_Note_Off(3,4) else Fn_Do_Note_Off(1,2) end
      end -- end of if note ons/offs section
    end -- if msg:len() == 3 then
    
    t1[i] = {offset, flags, msg}
    i = i+1
  end -- while
  
  for i=1,#t1 do tableEvents[i] = string.pack("i4Bs4", t1[i][1], t1[i][2], t1[i][3]) end
  r.MIDI_SetAllEvts(take, table.concat(tableEvents))
end -- function Fn_Join_Selected_Notes(take,MJS)

---------------------------------------------------------------
local mega = r.MIDIEditor_GetActive()
if mega then r.MIDIEditor_OnCommand(mega, 2) end
r.Undo_BeginBlock2(0)
r.PreventUIRefresh(1)

for i=0, r.CountSelectedMediaItems(0)-1 do 
  t_SelItems[i+1] = r.GetSelectedMediaItem(0,i) 
  numitems = numitems + 1
end

if numitems > 0 then
  local item = t_SelItems[1]
  prev_item_trk = r.GetMediaItem_Track(item)
  numtrks = 1
  t_SelItemsPerTrack[1] = {item}
end

for i=2, numitems do
  local item = t_SelItems[i]
  local item_trk = r.GetMediaItem_Track(item)
  if item_trk == prev_item_trk then
    t_SelItemsPerTrack[numtrks][ #t_SelItemsPerTrack[numtrks]+1 ] = item
  else
    numtrks = numtrks + 1
    t_SelItemsPerTrack[numtrks] = {item}
    prev_item_trk = item_trk 
  end
end

for i=1, numtrks do
  t_jointimes[i] = {}
  local len = #t_SelItemsPerTrack[i]
  if len > 1 then 
    for j=2, len do
      t_jointimes[i][j-1] = r.GetMediaItemInfo_Value(t_SelItemsPerTrack[i][j], "D_POSITION")
    end
  end
end


r.Main_OnCommand(40362, 0) -- Item: Glue items, ignoring time selection

for i=0, r.CountSelectedMediaItems(0)-1 do 
  t_SelTakes[i+1] = r.GetActiveTake(r.GetSelectedMediaItem(0,i) )
  numtakes = numtakes + 1
end

while numtakes > 0 do 
  local take = t_SelTakes[numtakes]
  if r.TakeIsMIDI(take) then Fn_Join_Notes_At_Item_Start_Times(take) end
  numtakes = numtakes - 1
end

r.PreventUIRefresh(-1)
r.Undo_EndBlock2(0, "glue - join notes at item starts", -1)

Last edited by FnA; 01-02-2018 at 07:55 PM.
FnA is offline   Reply With Quote
Old 01-01-2018, 01:54 PM   #61
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Dude, you're a magician! However, it's not quite working for me... It did actually work perfectly the first time, but after that not at all.

To test, I'm simply drawing a MIDI item, drawing some long notes inside and splitting them on the grid, then splitting the item in random spots without snapping and finally running the script.

I'm attaching my ini in case you'd like to test that it's not a config issue. Hope it's something simple because this will be a great tool!
Attached Files
File Type: ini REAPER.ini (45.7 KB, 5 views)
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 01-01-2018, 02:05 PM   #62
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

I think a project might be better. But before that, would you perhaps have had the MIDI Editor open when running it when it failed? I was reminded that gluing with it open can cause selection changes that might throw it off. I probably should put in something to close it if detected open.

nm. I made it fail with snap off. Going to try the +- one tick thing.

Last edited by FnA; 01-01-2018 at 02:33 PM.
FnA is offline   Reply With Quote
Old 01-01-2018, 04:31 PM   #63
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

I did manage to get a gap between notes with regular split and glue like that.

Updated the post with the new script. Has two places where some fudge factor is put in...

Also put in MIDI Editor closing thingy.
FnA is offline   Reply With Quote
Old 01-01-2018, 06:19 PM   #64
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Thank you, thank you, thank you! Yes it's working now, regardless of snap or ME being open! I'm adding it to my custom actions and I will let you know if anything else crops up when using it more intensively, but you should for sure add this variant to ReaPack as well. Personally I might call it "Heal MIDI Items," as that's what essentially the same function is called for audio items. People should be able to find it either way, but it was only after trying to use that heal action years ago on MIDI that I realized Reaper couldn't do this.
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 01-01-2018, 07:25 PM   #65
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

FnA's butt healing glue?

Actually, now that you mention that word, I seem to recall it has come up in the forum at one time or another. Kind of ironic it gets made on the eve of:
5.71
+ Regions: copy regions without splitting the original media items

but I guess there are other uses. Well, you will be as good a tester as any, I reckon. It probably needs a little clean up at least before going bigtime. Anyway, do tell how it goes. The script will join overlapping notes at the end/start, probably how they were before splitting. (but I saw some odd things when going glue crazy here) It has to be in kind of arbitrary way. Another way, which I don't have worked out, might be to join all of those. Corner case, I guess.

You could probably replace the commandID number in this line:
Code:
reaper.Main_OnCommand(40362, 0) -- Item: Glue items, ignoring time selection
to a different Glue action if you like. But all glued items need to be selected after gluing, before the rest of the script ensues. If you put this in a macro after something, you have to ensure that all items to be glued are selected when the script is run. That's obvious, I guess.



edit. Actually, you know what? I still need to put something in to limit the join function to MIDI items only.

Last edited by FnA; 01-01-2018 at 07:37 PM.
FnA is offline   Reply With Quote
Old 01-01-2018, 08:28 PM   #66
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Axis Mundi
Posts: 4,371
Default

Quote:
Originally Posted by FnA View Post
FnA's butt healing glue?
You have my endorsement.
__________________
TwilightMysterySchool
foxAsteria is offline   Reply With Quote
Old 01-01-2018, 08:46 PM   #67
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Ok, put in something to stop error hopefully if audio gets glued too. Localized some variables, etc. Kind of hate to keep screwing around like that, but seems to be working ok.
FnA is offline   Reply With Quote
Old 01-02-2018, 06:28 PM   #68
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Couple bug fixes for the glue script. v 1.03

1. Nil error when first note on of given pitch/channel in glued item was at a join point.

2. More complicated one involving the offset falling behind when the note off leads the next note on by a tick. Pulled stuff forward a tick. Not 100% sure about this fix. (edit. I think it needs to be different, but I don't have it yet.) got it, I think...


Also put UndoBlock2 in because it was doing a point for the glue and one for the join. I read there was a problem with UndoBlock and SetAllEvents here: https://forum.cockos.com/showthread.php?t=185118, but hopefully the Glue action will meet the requirements...

Last edited by FnA; 01-02-2018 at 07:56 PM.
FnA is offline   Reply With Quote
Old 01-03-2018, 09:14 AM   #69
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 3,456
Default

Oh, great script...
Thanks a lot, FnA
__________________
Quote:
Originally Posted by Sexan View Post
Make a thread "F%#! you Reaper! I quit!" to get more views and feedback since these kind of threads get much more traction
SoundCloudFR: "Real" Non-destructive GLUEAll the REAPER names
vitalker is online now   Reply With Quote
Old 01-03-2018, 10:28 AM   #70
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

You're welcome/enjoy (hopefully). But it's new, and I'm not a pro coder, so...keep your eye open.
FnA is offline   Reply With Quote
Old 01-03-2018, 10:36 AM   #71
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 3,456
Default

Quote:
Originally Posted by FnA View Post
You're welcome/enjoy (hopefully). But it's new, and I'm not a pro coder, so...keep your eye open.
Why the space between notes is measured by ticks?
__________________
Quote:
Originally Posted by Sexan View Post
Make a thread "F%#! you Reaper! I quit!" to get more views and feedback since these kind of threads get much more traction
SoundCloudFR: "Real" Non-destructive GLUEAll the REAPER names
vitalker is online now   Reply With Quote
Old 01-03-2018, 12:28 PM   #72
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 1,893
Default

Easy to write. No one expressed interest in that version. You want to write 1/8 or something? Maybe possible. Also, new version doesn't have use note start feature... so it just measures ticks between note off and on.
FnA 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 02:28 AM.


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