Old 05-21-2019, 03:17 PM   #41
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 23,332
Default

That is not unlikely, could be.
EvilDragon is online now   Reply With Quote
Old 05-22-2019, 03:36 AM   #42
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,752
Default

Quote:
Originally Posted by schwa View Post
The API issue should be fixed with 5.978+dev0521a, which we just posted. Would you mind testing that?
int* and double* optionals now work fine.

I'm not sure how to get REAPER-specific datatypes, optional strings and HWNDs (void*) to work, though:

Quote:
Originally Posted by schwa View Post
Looking at the code on our side, optional arguments from Lua to extension-provided functions should work for REAPER-specific datatypes (like MediaTrack*, etc), but not int, double, etc. Does that match what you're seeing?

Last edited by juliansader; 05-22-2019 at 03:41 AM.
juliansader is offline   Reply With Quote
Old 05-22-2019, 04:09 AM   #43
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

Quote:
Originally Posted by gofer View Post
This modifier doesn't seem to work at all when "Allow selecting a single event in a CC lane with a mouse click" (Mouse modifiers, CC lane context) is disabled.
A lot of behaviors now don't seem to make a lot of sense when that option is disabled. I'm wondering if we should just deprecate the option, so CC events are always selected when you click on them. The single-click preference pre-dates mouse modifiers, and I think the functionality it was intended to enable is completely superseded by mouse modifiers.

Last edited by schwa; 05-23-2019 at 07:45 AM.
schwa is offline   Reply With Quote
Old 05-22-2019, 04:24 AM   #44
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,137
Default

Quote:
Originally Posted by schwa View Post
If possible, it would be really helpful to narrow down a specific example of a script or extension function that breaks with this build.
A lot of scripts using these functions:
Code:
v5.978+dev0515 - May 15 2019
  + Reascript: for automation items, CountEnvelopePointsEx, GetEnvelopePointEx, SetEnvelopePointEx, and DeleteEnvelopePointEx all use point index based on one full loop iteration (see documentation)
Please, roll it back...half of my own envelope scripts break and I'm sure there are countless scripts out there that share the same destiny. Both the old way and new way are useful and we can use both for different purposes.
Breeder is offline   Reply With Quote
Old 05-22-2019, 04:25 AM   #45
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

The API behavior was fixed yesterday, please download the dev0521a build.
schwa is offline   Reply With Quote
Old 05-22-2019, 04:27 AM   #46
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Twiddy, Alabama
Posts: 1,963
Default

Quote:
Originally Posted by ovnis View Post
In this exemple, we are not able to see the CC value inside the next MIDI item... It's not great to know the CC value.
added to the list of issues centered around active/inactive midi items
__________________
° 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 online now   Reply With Quote
Old 05-22-2019, 04:34 AM   #47
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,137
Default

Quote:
Originally Posted by schwa View Post
The API behavior was fixed yesterday, please download the dev0521a build.
I did just before posting and this script:

Code:
-- Script: Envelope - Select dips in envelope (obey time selection, if any).lua

-- Misc functions ------------------------------------------------------------------------------------------------------
local function IsUnderlyingEnvelopeBypassed (envelope)
	local isUnderlyingEnvelopeBypassed = false
	local _, envChunk = reaper.GetEnvelopeStateChunk(envelope, "", false)
	for line in envChunk:gmatch("([^\n]*)\n?") do
		local lineTokens = {}
		for token in line:gmatch("[^%s]+") do
			lineTokens[#lineTokens + 1] = token
		end
		if #lineTokens > 0 and lineTokens[1] == "ACT" then
			local automationToken = tonumber(lineTokens[3])
			function GetBit (val, bit) return (val & 1 << bit) ~= 0 end
			if automationToken == -1 then
				if GetBit(reaper.SNM_GetIntConfigVar("POOLEDENVATTACH", "0"), 2) then
					isUnderlyingEnvelopeBypassed = true
				end
			else
				if GetBit(automationToken, 2) then
					isUnderlyingEnvelopeBypassed = true
				end
			end
			break
		end
	end
	return isUnderlyingEnvelopeBypassed
end

-- Main ----------------------------------------------------------------------------------------------------------------
function Main ()
	local envelope = reaper.GetSelectedEnvelope(0)
	if envelope ~= nil then

		-- Start
		reaper.PreventUIRefresh(1)
		local doUndo  = false

		-- Get take envelope data
		local takeEnvelopeItemStart = 0
		local takeEnvelopePlayRate  = 1
		local br_envelope = reaper.BR_EnvAlloc(envelope, false)
		local take = reaper.BR_EnvGetParentTake(br_envelope)
		if take ~= nil then
			takeEnvelopeItemStart = reaper.GetMediaItemInfo_Value(reaper.GetMediaItemTake_Item(take), "D_POSITION")
			takeEnvelopePlayRate  = reaper.GetMediaItemTakeInfo_Value(take, "D_PLAYRATE")
		end
		reaper.BR_EnvFree(envelope, false)

		-- 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

		-- Check envelope points
		if IsUnderlyingEnvelopeBypassed(envelope) == false then
			for i = 1, reaper.CountEnvelopePoints(envelope)-1 do
				local p1, t1, v1, _,     _,       s1 = reaper.GetEnvelopePoint(envelope, i-1)
				local p2, t2, v2, shape, tension, s2 = reaper.GetEnvelopePoint(envelope, i)
				local p3, t3, v3, _,     _,       s3 = reaper.GetEnvelopePoint(envelope, i+1)

				local a_t2 = t2 / takeEnvelopePlayRate + takeEnvelopeItemStart
				if p3 == false then
					v3 = v2 + 1 -- treat last point as dip
				end

				if ((timeSel and a_t2 >= timeSelStart and a_t2 <= timeSelEnd) or timeSel == false) and (v2 < v1 and v2 < v3) then
					if s2 == false then
						doUndo = true
						reaper.SetEnvelopePoint(envelope, i, nil, nil, nil, nil, true, false)
					end
				else
					if s2 == true then
						doUndo = true
						reaper.SetEnvelopePoint(envelope, i, nil, nil, nil, nil, false, false)
					end
				end
			end
		end

		-- Check points in automation items
		for i = 0, reaper.CountAutomationItems(envelope)-1 do
			local selected = reaper.GetSetAutomationItemInfo(envelope, i, "D_UISEL", 0, false)
			if selected > 0 or selected == 0 then

				for j = 1, reaper.CountEnvelopePointsEx(envelope, i)-1 do
					local p1, t1, v1, _,     _,       s1 = reaper.GetEnvelopePointEx(envelope, i, j-1)
					local p2, t2, v2, shape, tension, s2 = reaper.GetEnvelopePointEx(envelope, i, j)
					local p3, t3, v3, _,     _,       s3 = reaper.GetEnvelopePointEx(envelope, i, j+1)

					if p3 == false then
						v3 = v2 + 1 -- treat last point as dip
					end

					if ((timeSel and t2 >= timeSelStart and t2 <= timeSelEnd) or timeSel == false) and (v2 < v1 and v2 < v3) then
						if s2 == false then
							doUndo = true
							reaper.SetEnvelopePointEx(envelope, i, j, nil, nil, nil, nil, true, false)
						end
					else
						if s2 == true then
							doUndo = true
							reaper.SetEnvelopePointEx(envelope, i, j, nil, nil, nil, nil, false, false)
						end
					end
				end
			end
		end

		-- Finish up
		if doUndo == true then
			if timeSel == true then
				reaper.Undo_OnStateChangeEx("Select envelope point dips in time selection", 1 | 4, -1)
			else
				reaper.Undo_OnStateChangeEx("Select envelope point dips",                   1 | 4, -1)
			end
		end
		reaper.UpdateArrange()
		reaper.PreventUIRefresh(-1)
	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
doesn't work properly if time selection if over other iterations other than the first. Works perfectly with 5.978
Breeder is offline   Reply With Quote
Old 05-22-2019, 04:51 AM   #48
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

Quote:
Originally Posted by Breeder View Post
Please, roll it back...
Ah, sorry, you had two quote blocks in your post, which referred to two completely different issues.

We're still thinking about what to do with the automation item API.
schwa is offline   Reply With Quote
Old 05-22-2019, 05:18 AM   #49
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,137
Default

Quote:
Originally Posted by schwa View Post
Ah, sorry, you had two quote blocks in your post, which referred to two completely different issues.

We're still thinking about what to do with the automation item API.
I just used a chance to jump in the conversation
Thank you for responding and thank you for taking this issue into consideration!
Breeder is offline   Reply With Quote
Old 05-22-2019, 07:54 AM   #50
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,601
Default

Quote:
Originally Posted by schwa View Post
The API behavior was fixed yesterday, please download the dev0521a build.
Aaah, the draw CCs got fixed too, thanks schwa.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 05-22-2019, 09:53 AM   #51
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

Quote:
Originally Posted by schwa View Post
A lot of behaviors now don't seem to make a lot of sense when that option is disabled. I'm wondering if we should just deprecate the option, so CC events are always selected when you click on them.
Bumping this hoping for feedback. The single-click preference predates mouse modifiers, and I think the functionality it was intended to enable is completely superseded by mouse modifiers
schwa is offline   Reply With Quote
Old 05-22-2019, 10:37 AM   #52
srdmusic
Human being with feelings
 
Join Date: Dec 2016
Posts: 599
Default

Quote:
Originally Posted by schwa View Post
Bumping this hoping for feedback. The single-click preference predates mouse modifiers, and I think the functionality it was intended to enable is completely superseded by mouse modifiers
I don't see any reason not to deprecate the option since it has the potential of unaccepted consequences. Probably clear without.
srdmusic is offline   Reply With Quote
Old 05-22-2019, 10:44 AM   #53
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,601
Default

Quote:
Originally Posted by schwa View Post
Bumping this hoping for feedback. The single-click preference predates mouse modifiers, and I think the functionality it was intended to enable is completely superseded by mouse modifiers
With both left and right points selected Using "Ctrl+Move CC segment ignoring time selection" it moves it moves both points up and down. With no points selected it only moves the left point up and down.

With no points selected or near the time selection, when using "Ctrl+Move CC segment" it creates both points at time selection positions and moves both points up and down. Is that the way it's supposed to be? Shouldn't the right point remain in it's position?

Incidentally, "Alt+Leftclick" still does not delete/erase the points. It sort of works when dragging it, but even then it's awkward and will even draw CCs if positioned just right.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music

Last edited by Tod; 05-22-2019 at 10:51 AM.
Tod is offline   Reply With Quote
Old 05-22-2019, 11:40 AM   #54
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 23,332
Default

I say deprecate it, I always have it enabled anyways.
EvilDragon is online now   Reply With Quote
Old 05-22-2019, 11:40 AM   #55
stillshaded
Human being with feelings
 
Join Date: Oct 2018
Posts: 73
Default

thanks for continuing to tweak the midi editor.

just curious.. is there a reason why there's marquee scroll in arrange view but not the piano roll?
stillshaded is offline   Reply With Quote
Old 05-23-2019, 07:51 AM   #56
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 10,252
Default

Quote:
Originally Posted by ovnis View Post
"# MIDI editor: add mouse modifier to move CC segment within time selection"

Is it possible to always display the CC segment, even when CC is set to 0 ?

With CC always displayed, we would be able to use this new fonctionnality (add mouse modifier to move CC segment within time selection) without the need to create a CC segment.
There is a difference between a MIDI event with a value of zero, and no MIDI event. If there is an event with a value of zero, the segment should be displayed and editable -- are you seeing something different?
schwa 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:55 AM.


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