Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 03-26-2023, 05:50 AM   #1
robotron
Human being with feelings
 
Join Date: May 2020
Posts: 132
Default Inserting pitch bend value via a script?

I'm trying to insert pitch bend values using a shortcut key/script. I've downloaded a script that works well for inserting CC values at the edit cursor (example below for inserting cc1 value 100). Could this be easily adapted to insert Pitch Bend or are there any other scripts out there that do this?

function main()
channel = 0
MIDIEditor = reaper.MIDIEditor_GetActive()
if MIDIEditor == nil then return end
take = reaper.MIDIEditor_GetTake(MIDIEditor)
if take == nil then return end
item = reaper.GetMediaItemTake_Item(take)
itempos = reaper.GetMediaItemInfo_Value(item, 'D_POSITION')
if reaper.TakeIsMIDI(take) == false then return end
pos = reaper.GetCursorPosition()
ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos)
reaper.MIDI_InsertCC(take,
false,--boolean selected,
false,--boolean muted,
ppq,--number ppqpos,
176,--integer chanmsg,
channel,--integer chan,
1,
100)
reaper.UpdateItemInProject(item)
end
robotron is offline   Reply With Quote
Old 03-26-2023, 07:03 AM   #2
robotron
Human being with feelings
 
Join Date: May 2020
Posts: 132
Default Resolved

Just found a script that does this with a dialogue box

https://forum.cockos.com/showthread.php?t=235638
robotron 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 09:18 PM.


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