|
|
|
05-13-2019, 10:57 AM
|
#1
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
v5.978+dev0513 - May 13 2019
v5.978+dev0513 - May 13 2019
+ Automation items: fix occasionally incorrect behavior of "reduce number of envelope points" dialog [p=2132696]
+ FX Browser: fix memory leak when updating custom FX tags, folders
+ FX Browser: fix preferences display of certain quoted filters
+ FX Browser: fix reading of smart folder filters that begin/end with quotes [t=220783]
+ Notation editor: add multi-tremolo support
+ Notation editor: fix musicxml slur export
+ Notation editor: fix tuplet/chord interaction display
+ Notation edltor: improve musicxml tuplet export
+ VST: improve default keyboard handling for ARA plug-ins
+ VST: show non-automatable parameters in generic parameter UI for accessibility purposes
# MIDI editor: adjust note/CC display when using custom track or media item colors
Full changelog / Latest pre-releases
|
|
|
05-13-2019, 11:07 AM
|
#2
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Devs, is there really no way to better handle this situation:
Disregard the earlier note changing velocity, that bug is fixed as you know - but the more annoying part of this is not being able to edit individual notes of a chord that begin at exactly the same time, WITHOUT any of notes being selected. We have handles now, those handles should enable easy modifications like this in case when multiple notes have the same starting time but different velocities!
|
|
|
05-13-2019, 11:11 AM
|
#3
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
I'd consider this a bug: track/media item coloring modes only color the lollipop but not the stem. For stem, looks like "source" color is used.
I'd expect the same color being used for the lollipop and the stem here.
|
|
|
05-13-2019, 11:25 AM
|
#4
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Quote:
Originally Posted by EvilDragon
I'd expect the same color being used for the lollipop and the stem here.
|
Oops yes, that's a typo, fixing.
|
|
|
05-13-2019, 11:48 AM
|
#5
|
Human being with feelings
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
|
Quote:
Originally Posted by EvilDragon
I'd expect the same color being used for the lollipop and the stem here.
|
Agreed.
I also don't see how a lollipop that small is useful. It seems like it makes editing velocities harder, not easier IMHO.
|
|
|
05-13-2019, 11:49 AM
|
#6
|
Human being with feelings
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
|
Quote:
Originally Posted by EvilDragon
Disregard the earlier note changing velocity, that bug is fixed as you know - but the more annoying part of this is not being able to edit individual notes of a chord that begin at exactly the same time, WITHOUT any of notes being selected.
|
I did have this behavior couple of dev versions ago, but not anymore. If I click/drag on any velocity handle, only that one will get selected and adjusted. My mouse modifier default actions for all the MIDI CC contexts are at defaults. I wonder if you have changed any of those?
|
|
|
05-13-2019, 12:18 PM
|
#7
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
I do have a different mouse modifier and I mentioned which one several dev threads ago. I use "Edit selected CC events if any, otherwise draw/edit" in both CC event and CC lane contexts.
It should still work like it does with the default modifier even in this setup, I'd say.
|
|
|
05-13-2019, 12:21 PM
|
#8
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Quote:
Originally Posted by Klangfarben
Agreed.
I also don't see how a lollipop that small is useful. It seems like it makes editing velocities harder, not easier IMHO.
|
It's not really small, honestly. Plus you don't need to click JUST on the lollipop, it has a wider hit area (the whole stem, and also additional area to the right of it).
|
|
|
05-13-2019, 12:22 PM
|
#9
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
Quote:
+ Notation editor: add multi-tremolo support
|
I'm really glad you went into this!
I'm afraid this first step is a little bit miss though. Please let me clarify bellow how multi-note trems are used.
On both pictures from Dorico, in the first bar there is a multi-note trem notation and in the second bar there is fully written out how that trem is played by musicians. Both pics are in 4/4. Three strokes are generally considered to be an unmeasured thing, but it also depends on a tempo and a conductor.
Notice how two half notes connected by a trem sign does not add into a whole note but both together represent a half-note length.
(Dorico)
If I do these trems with the current implementation, I get this. I also used disp_len offset (changed by script because with actions you cannot get so long offset):
(Reaper)
You just cannot get the proper notation when you must connect two existing MIDI notes. So that's why I suggested it to be a visual ornament and meant it to take the current Reaper's trill as a basis, not a slur.
The most important thing is to have selectable pitches and with that also selectable accidental notation. Different number of strokes (1..4) is not so important, but it's too easy addition not to add and will double usability of this. Optionable slur is a bonus.
As it would be drawn on a set distance, the easy part could be that you don't have to calculate trem beams and just use those from the font with set angle.
EDIT:For even more clarification, here's how Dorico handles its creation.
Last edited by bFooz; 05-13-2019 at 12:30 PM.
|
|
|
05-13-2019, 12:39 PM
|
#10
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Hmm. That's a fairly high level of complexity for what is entirely a display ornament that doesn't have any effect on the actual MIDI playback. We may mess with it a bit more, but most likely we'll just revert the feature.
|
|
|
05-13-2019, 12:51 PM
|
#11
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
Ok.
I just thought you already have almost everything needed - added visual notes from trill, accidental calculation, strokes from font, note length and orientation taken from the base note.
Again, horizontal distance from the base note would be set and unchangable, same for all base note lengths.
All would have to be exportable in musicXML to use the potential.
It does not affect the playback yet (here for me it definitelly does though) but all is needed is just a jsfx notation to midi interpreter. Some beginnings of that I saw on the forum some time ago.
EDIT: And also the pitch would be made by an offset, so it would stick to the base note as it would move up and down.
Last edited by bFooz; 05-13-2019 at 01:02 PM.
|
|
|
05-13-2019, 12:52 PM
|
#12
|
Human being with feelings
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
|
Quote:
Originally Posted by EvilDragon
It's not really small, honestly. Plus you don't need to click JUST on the lollipop, it has a wider hit area (the whole stem, and also additional area to the right of it).
|
Even with show note length in velocity lane disabled? I can miss the hit area pretty easily. It was harder to miss when the velocity "stick" was wider previous to the CC envelope dev cycle. So I really do think one of them needs to change, even if it's just the stick being wider.
|
|
|
05-13-2019, 01:02 PM
|
#13
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
With the note length display disabled, the hit area is actually the same size as when displaying velocity as a bar.
|
|
|
05-13-2019, 01:11 PM
|
#14
|
Human being with feelings
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
|
Quote:
Originally Posted by schwa
With the note length display disabled, the hit area is actually the same size as when displaying velocity as a bar.
|
Ok, thanks. Clearly psychogenic on my part then.
|
|
|
05-13-2019, 03:18 PM
|
#15
|
Human being with feelings
Join Date: Aug 2015
Posts: 3,672
|
Quote:
# MIDI editor: adjust note/CC display when using custom track or media item colors
|
nicely done. selected vs unselected notes pop now. consider me gruntled.
|
|
|
05-13-2019, 04:13 PM
|
#16
|
Human being with feelings
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
|
Quote:
Originally Posted by EvilDragon
I do have a different mouse modifier and I mentioned which one several dev threads ago. I use "Edit selected CC events if any, otherwise draw/edit" in both CC event and CC lane contexts.
It should still work like it does with the default modifier even in this setup, I'd say.
|
Yep, I can reproduce with those mouse modifier settings. I agree, it should work just the same.
|
|
|
05-13-2019, 05:37 PM
|
#17
|
Human being with feelings
Join Date: Dec 2011
Location: Finland
Posts: 792
|
Quote:
Originally Posted by schwa
Hmm. That's a fairly high level of complexity for what is entirely a display ornament that doesn't have any effect on the actual MIDI playback.
|
What about future proof for MIDI 2.0?
|
|
|
05-13-2019, 07:05 PM
|
#18
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by schwa
Oops yes, that's a typo, fixing.
|
It actually looks really good for a typo
|
|
|
05-14-2019, 04:20 AM
|
#19
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Quote:
Originally Posted by EvilDragon
not being able to edit individual notes of a chord that begin at exactly the same time, WITHOUT any of notes being selected. We have handles now, those handles should enable easy modifications like this in case when multiple notes have the same starting time but different velocities!
|
Why do you have the note selection disabled -- what preferred behavior does that allow? With note selection disabled, in this case, what should happen if you move the mouse leftward over the velocity stems themselves? Can you think of any behavior that would make sense here that doesn't require REAPER internally to track which note's horizontal line was originally clicked on, just as if it were selected? It seems like you want a behavior that is exactly like having a single note selected without actually selecting the note...
|
|
|
05-14-2019, 05:08 AM
|
#20
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
There is (now) this problem with musicxml:
Top is what was exported.
Bottom is imported back.
The problem seems that on export one staff of the grandstaff does consider project start offset and the other one does not. I have offset at -1 measure here.
|
|
|
05-14-2019, 05:16 AM
|
#21
|
Human being with feelings
Join Date: Oct 2013
Location: Argentina
Posts: 1,303
|
Quote:
Originally Posted by EvilDragon
Devs, is there really no way to better handle this situation:
Disregard the earlier note changing velocity, that bug is fixed as you know - but the more annoying part of this is not being able to edit individual notes of a chord that begin at exactly the same time, WITHOUT any of notes being selected. We have handles now, those handles should enable easy modifications like this in case when multiple notes have the same starting time but different velocities!
|
Completely agreed...
|
|
|
05-14-2019, 05:17 AM
|
#22
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Quote:
Originally Posted by bFooz
The problem seems that on export one staff of the grandstaff does consider project start offset and the other one does not. I have offset at -1 measure here.
|
Fixing, thanks.
Last edited by schwa; 05-14-2019 at 05:33 AM.
|
|
|
05-14-2019, 05:21 AM
|
#23
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
Quote:
Originally Posted by schwa
Thanks, I think the problem is actually on the import side.
|
I've tried importing to Dorico and it shows it shifted as well. Sibelius and MuseScore show it OK though.
|
|
|
05-14-2019, 05:27 AM
|
#24
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Quote:
Originally Posted by schwa
Why do you have the note selection disabled -- what preferred behavior does that allow? With note selection disabled, in this case, what should happen if you move the mouse leftward over the velocity stems themselves? Can you think of any behavior that would make sense here that doesn't require REAPER internally to track which note's horizontal line was originally clicked on, just as if it were selected?
|
It's slowing things down when you want to do a single note adjustment and you have nothing selected. Because then you need to unselect if you want to edit another note from the chord. It's the opposite of smooth and fast MIDI editing, which Reaper should strive for
Quote:
Originally Posted by schwa
It seems like you want a behavior that is exactly like having a single note selected without actually selecting the note...
|
That is exactly what I would want If the mouse modifier says "Edit selected CC events if any, otherwise draw/edit", I would expect it to edit only the event closest to the cursor - not the whole shebang of stacked notes with same starting time but different velocities.
Sorta "smart select" kind of thing? Is this an unrealistic expectation? I would consider the note length handle itself to be a hitzone for the associated velocity event. No?
Consider this scenario:
I would want to be able to drag each individual handle and change the velocity of the note that handle belongs to. Currently, Reaper doesn't allow us to do that without requiring you to select the event first, which slows things down. If we have the handles, we should be able to utilize them properly.
Wouldn't you consider this annoying? The handle is there, but it does nothing to its associated event, because only the rightmost note is considered important...
|
|
|
05-14-2019, 05:37 AM
|
#25
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Repeating a couple of questions here. You have the default "allow selecting a single event in a CC lane" (in Preferences > Editing Behavior > Mouse Modifiers) disabled, but you want a single velocity stem to act as if is selected when you click on it.
Why do you have the default disabled, what behavior does that allow that you can't get otherwise?
To get the behavior you want, REAPER would have to internally track which note's horizontal line was originally clicked on, just as if it were selected. So why not just enable that preference?
..Or maybe that preference should only apply to CC events, not velocity stems, and notes should always get selected when you click on the velocity stem? Maybe that is the best solution.
Quote:
Originally Posted by schwa
Why do you have the note selection disabled -- what preferred behavior does that allow? With note selection disabled, in this case, what should happen if you move the mouse leftward over the velocity stems themselves? Can you think of any behavior that would make sense here that doesn't require REAPER internally to track which note's horizontal line was originally clicked on, just as if it were selected? It seems like you want a behavior that is exactly like having a single note selected without actually selecting the note...
|
Last edited by schwa; 05-14-2019 at 05:51 AM.
|
|
|
05-14-2019, 05:46 AM
|
#26
|
Human being with feelings
Join Date: Oct 2013
Location: Argentina
Posts: 1,303
|
Quote:
Originally Posted by EvilDragon
...not being able to edit individual notes of a chord that begin at exactly the same time, WITHOUT any of notes being selected. We have handles now, those handles should enable easy modifications like this in case when multiple notes have the same starting time but different velocities!
|
@EvilDragon : I can get independent editing of velocities with the same start time having Ctrl+Shift modifier set to "Move CC event on one axis only", which is my default, to put an example :
The case is that, in spite of that, I agree that it should need no special configuration to work as you say. It would make editing velocities on the fly much easier...
|
|
|
05-14-2019, 07:07 AM
|
#27
|
Human being with feelings
Join Date: Oct 2015
Posts: 739
|
Quote:
Originally Posted by schwa
..Or maybe that preference should only apply to CC events, not velocity stems, and notes should always get selected when you click on the velocity stem? Maybe that is the best solution.
|
Yes, imo.
|
|
|
05-14-2019, 08:10 AM
|
#28
|
Human being with feelings
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
|
Quote:
Originally Posted by schwa
..Or maybe that preference should only apply to CC events, not velocity stems, and notes should always get selected when you click on the velocity stem? Maybe that is the best solution.
|
Also agreed.
This is for another day obviously, but I think there should be separate mouse modifiers for velocity and for CC. They really are two separate things as has been pointed out by the above example. They don't have much in common in terms of editing so separate mouse modifiers would solve a lot of problems.
|
|
|
05-14-2019, 08:17 AM
|
#29
|
Human being with feelings
Join Date: Dec 2012
Posts: 13,334
|
Quote:
Originally Posted by Klangfarben
This is for another day obviously, but I think there should be separate mouse modifiers for velocity and for CC. They really are two separate things as has been pointed out by the above example. They don't have much in common in terms of editing so separate mouse modifiers would solve a lot of problems.
|
Wise idea!
|
|
|
05-14-2019, 08:32 AM
|
#30
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Quote:
Originally Posted by schwa
You have the default "allow selecting a single event in a CC lane" (in Preferences > Editing Behavior > Mouse Modifiers) disabled, but you want a single velocity stem to act as if is selected when you click on it.
|
No, I have that option enabled.
Quote:
Originally Posted by schwa
To get the behavior you want, REAPER would have to internally track which note's horizontal line was originally clicked on, just as if it were selected.
|
This is exactly what I'd like to see! Note length lines actually becoming a hitzone.
Quote:
Originally Posted by schwa
..Or maybe that preference should only apply to CC events, not velocity stems, and notes should always get selected when you click on the velocity stem? Maybe that is the best solution.
|
Sounds like something worth testing for the next dev release!
|
|
|
05-14-2019, 09:00 AM
|
#31
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Quote:
Originally Posted by Klangfarben
Also agreed.
This is for another day obviously, but I think there should be separate mouse modifiers for velocity and for CC. They really are two separate things as has been pointed out by the above example. They don't have much in common in terms of editing so separate mouse modifiers would solve a lot of problems.
|
Exactly THIS!
And that:
Quote:
Originally Posted by EvilDragon
This is exactly what I'd like to see! Note length lines actually becoming a hitzone.
|
EDIT:
Let me add something here. It would be immensely helpful if while editing the velocity by dragging or trimming in the velocity lane that the note(s) were temporarily selected. And when letting go, the previous state was restored. And when clicking on the stick/lollipop the note was selected as suggested above. So, temporary note selection while dragging/trimming and permanent selection when clicking/selecting.
Last edited by _Stevie_; 05-14-2019 at 09:12 AM.
|
|
|
05-14-2019, 09:18 AM
|
#32
|
Human being with feelings
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
|
Quote:
Originally Posted by _Stevie_
It would be immensely helpful if while editing the velocity by dragging or trimming in the velocity lane that the note(s) were temporarily selected. And when letting go, the previous state was restored. And when clicking on the stick/lollipop the note was selected as suggested above. So, temporary note selection while dragging/trimming and permanent selection when clicking/selecting.
|
This is a really great idea, Stevie!!
Quote:
Originally Posted by EvilDragon
This is exactly what I'd like to see! Note length lines actually becoming a hitzone.
|
And yes, this seems most logical.
|
|
|
05-14-2019, 09:20 AM
|
#33
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Quote:
Originally Posted by Soli Deo Gloria
@EvilDragon : I can get independent editing of velocities with the same start time having Ctrl+Shift modifier set to "Move CC event on one axis only", which is my default, to put an example :
|
Exactly the example you show is why it's too slow. You're first marqueeing a velocity to tweak it by the handle (and using additional modifiers, to boot). That is one operation that is completely unnecessary. Just dragging the handle should allow you to edit ONLY the event that the handle belongs to.
ONLY in the case of multiple events that have the same starting point AND same velocity, should multiple events be edited simultaneously by a single handle!
|
|
|
05-14-2019, 09:28 AM
|
#34
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
2 questions for the devs while you're dealing with automation items.
1. Are you aware that many actions (select points, invert points, remove points etc...) affect underlying envelope even if it is bypassed and thus practically invisible and shouldn't respond to edits.
2. Edits through API don't affect automation items with shared pool (or other points in the same looped automation item). Is this a bug or a feature?
Last edited by Breeder; 05-14-2019 at 11:12 AM.
|
|
|
05-14-2019, 09:30 AM
|
#35
|
Human being with feelings
Join Date: Jan 2009
Posts: 1,030
|
Quote:
Originally Posted by schwa
Hmm. That's a fairly high level of complexity for what is entirely a display ornament that doesn't have any effect on the actual MIDI playback. We may mess with it a bit more, but most likely we'll just revert the feature.
|
I think this feature would be incredibly useful if the midi message contained enough information to allow a jsfx to trigger repeating notes or a keyswitch/channel change to trigger a tremolo sample.
|
|
|
05-15-2019, 03:33 AM
|
#36
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by Breeder
2 questions for the devs while you're dealing with automation items.
1. Are you aware that many actions (select points, invert points, remove points etc...) affect underlying envelope even if it is bypassed and thus practically invisible and shouldn't respond to edits.
2. Edits through API don't affect automation items with shared pool (or other points in the same looped automation item). Is this a bug or a feature?
|
Let me just try and get devs attention one more time.
There but be a way to work with automation item SOURCE directly instead of going through all the points of the looped item and doing all sorts of wacky calculations to determine what needs to get edited where.
Pooled automation items don't seem to pose much of a problem, but looped automation items...yikes!
What do you think, is it too much to ask for yet another API that deals exclusively with automation items source instead of currently visible points?
I'm thinking like this:
1) API to translate current point id to source point id. For example, if item is looped you could supply any point id and get the point id of the automation item source.
2) API to traverse only through points in source. This would probably have to all work in QN, not time units. Updating a point here would update all the points in the looped automation item. Maybe even update all the pooled copies too?
Maybe there's a better approach, but there must be a way to ease this
Last edited by Breeder; 05-15-2019 at 03:45 AM.
|
|
|
05-15-2019, 08:54 AM
|
#37
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Quote:
Originally Posted by Breeder
2. Edits through API don't affect automation items with shared pool (or other points in the same looped automation item). Is this a bug or a feature?
|
Seems to work here.
Here I'm setting 2nd point (index 1) of first AI, the point in the looped section follows as well as the points in the pooled AI.
Or am I misunderstanding?
|
|
|
05-15-2019, 09:08 AM
|
#38
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by nofish
Seems to work here.
Here I'm setting 2nd point (index 1) of first AI, the point in the looped section follows as well as the points in the pooled AI.
Or am I misunderstanding?
|
Doesn't work here. Maybe it's because you're not changing the position of the point?
This is a script that will fit points to time selection but it doesn't work with
1) Pooled items
2) Looped item
Code:
-- Misc functions ------------------------------------------------------------------------------------------------------
function msg(s)
reaper.ShowConsoleMsg(tostring(s) .. "\n")
end
local function SetToBounds (val, min, max)
if min > max then
min, max = max, min
end
if val < min then return min
elseif val > max then return max
else return val
end
end
local function TranslateRange (value, oldMin, oldMax, newMin, newMax)
local oldRange = oldMax - oldMin
local newRange = newMax - newMin
local newValue = ((value - oldMin) * newRange / oldRange) + newMin
return SetToBounds(newValue, newMin, newMax)
end
local function GetEnvelopeData (envelope, automationId)
local firstSelId = -1
local lastSelId = -1
local selectedPointsCount = 0
if automationId == -1 then
for i = 0, reaper.CountEnvelopePoints(envelope)-1 do
local _, _, _, _, _, selected = reaper.GetEnvelopePoint(envelope, i)
if selected == true then
if firstSelId == -1 then
firstSelId = i
end
lastSelId = i
selectedPointsCount = selectedPointsCount + 1
end
end
else
for i = 0, reaper.CountEnvelopePointsEx(envelope, automationId)-1 do
local _, _, _, _, _, selected = reaper.GetEnvelopePointEx(envelope, automationId, i)
if selected == true then
if firstSelId == -1 then
firstSelId = i
end
lastSelId = i
selectedPointsCount = selectedPointsCount + 1
end
end
end
return firstSelId, lastSelId, selectedPointsCount
end
-- Main ----------------------------------------------------------------------------------------------------------------
function Main ()
local envelope = reaper.GetSelectedEnvelope(0)
if envelope ~= nil then
-- Get time selection information
local timeSel = false
local timeSelStart, timeSelEnd = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
if timeSelStart ~= timeSelEnd then
timeSel = true
end
if timeSel == true and (timeSelStart + 0.000001 >= timeSelEnd) then
timeSel = false
end
-- Correct time selection for take envelope bounds and recheck again for minimum time selection length
local takeEnvelopeItemStart = 0
local takeEnvelopeItemEnd = 0
local takeEnvelopePlayRate = 1
if timeSel == true then
local br_envelope = reaper.BR_EnvAlloc(envelope, false)
local take = reaper.BR_EnvGetParentTake(br_envelope)
if take ~= nil then
local item = reaper.GetMediaItemTake_Item(take)
takeEnvelopeItemStart = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
takeEnvelopeItemEnd = reaper.GetMediaItemInfo_Value(item, "D_LENGTH") + takeEnvelopeItemStart
takeEnvelopePlayRate = reaper.GetMediaItemTakeInfo_Value(take, "D_PLAYRATE")
timeSelStart = SetToBounds(timeSelStart, takeEnvelopeItemStart, takeEnvelopeItemEnd)
timeSelEnd = SetToBounds(timeSelEnd, takeEnvelopeItemStart, takeEnvelopeItemEnd)
end
reaper.BR_EnvFree(envelope, false)
end
if timeSel == true and (timeSelStart + 0.000001 >= timeSelEnd) then
timeSel = false
end
-- Fit points
reaper.ClearConsole()
if timeSel == true then
-- Start
reaper.PreventUIRefresh(1)
local doUndo = false
-- Do envelope points
local firstSelId, lastSelId, selectedPointsCount = GetEnvelopeData(envelope, -1)
if selectedPointsCount >= 2 then
local _, firstPos = reaper.GetEnvelopePoint(envelope, firstSelId)
local _, lastPos = reaper.GetEnvelopePoint(envelope, lastSelId)
for i = 0, reaper.CountEnvelopePoints(envelope)-1 do
local p, t, v, shape, tension, s = reaper.GetEnvelopePoint(envelope, i)
if s == true then
if doUndo == false then
doUndo = true
reaper.Undo_BeginBlock()
end
reaper.SetEnvelopePoint(envelope, i, (TranslateRange(t / takeEnvelopePlayRate, firstPos / takeEnvelopePlayRate, lastPos / takeEnvelopePlayRate, timeSelStart, timeSelEnd) - takeEnvelopeItemStart) * takeEnvelopePlayRate, v, shape, tension, true, true)
end
end
end
-- Do points in automation items
for i = 0, reaper.CountAutomationItems(envelope)-1 do
local selected = reaper.GetSetAutomationItemInfo(envelope, i, "D_UISEL", 0, false)
local automationStart = reaper.GetSetAutomationItemInfo(envelope, i, "D_POSITION", 0, false)
local automationEnd = reaper.GetSetAutomationItemInfo(envelope, i, "D_LENGTH", 0, false) + automationStart
if (selected > 0 or selected == 0) and (automationStart + 0.000001 < automationEnd) then
local firstSelId, lastSelId, selectedPointsCount = GetEnvelopeData(envelope, i)
if selectedPointsCount >= 2 then
local _, firstPos = reaper.GetEnvelopePointEx(envelope, i, firstSelId)
local _, lastPos = reaper.GetEnvelopePointEx(envelope, i, lastSelId)
automationStart = SetToBounds(timeSelStart, automationStart, automationEnd)
automationEnd = SetToBounds(timeSelEnd, automationStart, automationEnd)
for j = 0, reaper.CountEnvelopePointsEx(envelope, i)-1 do
local p, t, v, shape, tension, s = reaper.GetEnvelopePointEx(envelope, i, j)
if s == true then
if doUndo == false then
doUndo = true
reaper.Undo_BeginBlock()
end
reaper.SetEnvelopePointEx(envelope, i, j, TranslateRange(t, firstPos, lastPos, automationStart, automationEnd), v, shape, tension, true, true)
end
end
end
end
end
-- Finish up
if doUndo == true then
reaper.Envelope_SortPoints(envelope)
reaper.Undo_EndBlock("Fit envelope points to time selection", 1 | 4)
end
reaper.UpdateArrange()
reaper.PreventUIRefresh(-1)
end
end
end
Main()
function NoUndoPoint () end -- Makes sure there is no unnecessary undo point created, see more
reaper.defer(NoUndoPoint) -- here: http://forum.cockos.com/showpost.php?p=1523953&postcount=67
This is a part of the script that deals with automation items:
Code:
for j = 0, reaper.CountEnvelopePointsEx(envelope, i)-1 do
local p, t, v, shape, tension, s = reaper.GetEnvelopePointEx(envelope, i, j)
if s == true then
if doUndo == false then
doUndo = true
reaper.Undo_BeginBlock()
end
reaper.SetEnvelopePointEx(envelope, i, j, TranslateRange(t, firstPos, lastPos, automationStart, automationEnd), v, shape, tension, true, true)
end
end
edit: it seems "noSort" flag in SetEnvelopePointEx is the culprit! If set to true it breaks looped and pooled items. Ok, I think we can live with this!
Last edited by Breeder; 05-15-2019 at 09:17 AM.
|
|
|
05-15-2019, 09:31 AM
|
#39
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Quote:
Originally Posted by Breeder
edit: it seems "noSort" flag in SetEnvelopePointEx is the culprit! If set to true it breaks looped and pooled items. Ok, I think we can live with this!
|
Tried calling Envelope_SortPointsEx() after AI points manipulation (when noSort==true)?
Seems to do the trick here.
|
|
|
05-15-2019, 09:57 AM
|
#40
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by nofish
Tried calling Envelope_SortPointsEx() after AI points manipulation (when noSort==true)?
Seems to do the trick here.
|
Good eyes, that was even easier. Thanks for having a look, I was pretty lost there devising a whole conquer-the-world scheme on how to approach this from a mathematical stand-point
|
|
|
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 12:24 AM.
|