Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 06-15-2019, 04:16 PM   #1
Kostik Vento
Human being with feelings
 
Join Date: Nov 2013
Location: Yekaterinburg, Russia
Posts: 11
Default [Reascript] CreateNewMIDIItemInProj seems to misinterpret qnIn parameter (FIXED)

CreateNewMIDIItemInProj's docs state that the last parameter qnIn indicates whether parameters start and end are in seconds (qnIn=false) or beats (qnIn=true).

In fact it behaves in a strange manner. The code that follows is supposed to create two items on different tracks:

Code:
reaper.InsertTrackAtIndex(0, false)
reaper.InsertTrackAtIndex(1, false)

t1 = reaper.GetTrack(0, 0)
t2 = reaper.GetTrack(0, 1)

reaper.CreateNewMIDIItemInProj(t1, 0, 7, false)
reaper.CreateNewMIDIItemInProj(t2, 3, 7, true)
The first tracks's item should start at second 3, and end at second 7 beind 4 seconds long.
The second track's item should start at beat 3, and end at beat 7 being 4 beats long.

What actually does this script do? The first item is ok.
The second tracks's item starts at second 3, ends at second 7, beind 4 seconds long!
The difference is that the second item's loop is just 4 beats long!

It is even better visible if we start off second 0, and try to insert 8 beats:

Code:
reaper.CreateNewMIDIItemInProj(t1, 0, 8, false)
reaper.CreateNewMIDIItemInProj(t2, 0, 8, true)
Second item's length is 8 seconds, but the loop mark is right at beat 8.

P.S. The Python version behaves the same way (actually, I run into the bug playing exactly with Python API).
P.P.S. The setting Loop source for new MIDI items in REAPER Preferences -> Project -> Media Item Defaults does not affect MIDI items created via Reascript (( They're always looped.
P.P.P.S. REAPER 5.978 on Mac OS Sierra 10.12.6 (16G2016).
Kostik Vento is offline   Reply With Quote
Old 11-11-2019, 07:41 PM   #2
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

Quote:
Originally Posted by Kostik Vento View Post
P.P.S. The setting Loop source for new MIDI items in REAPER Preferences -> Project -> Media Item Defaults does not affect MIDI items created via Reascript (( They're always looped.
Confirmed at least this part of it. Encountered this, and Google brought me here.
tack is online now   Reply With Quote
Old 11-11-2019, 08:38 PM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Oops, yeah. Fixing (both things).

Last edited by Justin; 11-11-2019 at 08:52 PM.
Justin 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 06:27 PM.


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