Old 04-05-2020, 03:28 PM   #1
LUX2152
Human being with feelings
 
Join Date: Apr 2020
Posts: 17
Default Help with Script

Hi all. I am down to the last part of my script and there are things I don't fully understand in the Reaper API. I have everything working except the insert

boolean reaper.MIDI_InsertTextSysexEvt(MediaItem_Take take, boolean selected, boolean muted, number ppqpos, integer type, string bytestr)

I don't how to tell it the MediaItem Take, and I don't know if the selected and muted even mater or what I should put.
Sorry if this is basic stuff. Your help is greatly appreciated.
LUX2152 is offline   Reply With Quote
Old 04-05-2020, 06:36 PM   #2
dangguidan
Human being with feelings
 
Join Date: Jan 2019
Location: China
Posts: 662
Default

MIDI scripts generally have the following code:
Code:
local editor=reaper.MIDIEditor_GetActive()
local take=reaper.MIDIEditor_GetTake(editor)
If you use item to locate take, you usually need this Code:
take = reaper.GetTake(MediaItem, 0)
dangguidan is offline   Reply With Quote
Old 04-05-2020, 11:12 PM   #3
LUX2152
Human being with feelings
 
Join Date: Apr 2020
Posts: 17
Default

Thanks that part works. Apparently I don't know what ppqpos is though or how to get it. I assumed it was the play head location. I can not find documentation on it.
Also, a lot of functions require MediaItem, I know what a media item is in Reaper, but no idea how they are referenced in script.
LUX2152 is offline   Reply With Quote
Old 04-06-2020, 04:03 AM   #4
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 5,859
Default

Quote:
Originally Posted by LUX2152 View Post
Thanks that part works. Apparently I don't know what ppqpos is though or how to get it. I assumed it was the play head location. I can not find documentation on it.
Also, a lot of functions require MediaItem, I know what a media item is in Reaper, but no idea how they are referenced in script.
ppq stands for 'Pulses per quarter' (note):
You can search/filter for available 'ppq'-functions here: https://www.extremraym.com/cloud/reascript-doc/


In case you haven't already found it: there's a dedicated scripting section (for posting script related questions, etc.): https://forum.cockos.com/forumdisplay.php?f=3
__________________
ReaLauncher

Last edited by solger; 04-06-2020 at 04:18 AM.
solger 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 05:53 PM.


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