View Single Post
Old 11-24-2019, 12:54 PM   #22
Human being with feelings
Join Date: Dec 2017
Posts: 69

I'm finding two problems with the script I wrote below. (1) the MIDI notes are not added to the take until I manually double-click on the take to open it, see the MIDI notes, and then click one of the MIDI notes. Then, suddenly they all appear in the main Reaper window. (2) action 41824 (render project) requires a confirm button be pressed in the GUI, which freezes Python. Is there a way to automate the whole rendering process from Python?

#load Reaper library/API
import reapy
from random import randint as r, choice

class note():
    def __init__(self,pitch,start,end,velocity):
        self.pitch = pitch
        self.start = start
        self.end = end
        self.velocity = velocity

def add_pattern_Reaper(pattern,channel=1):
    for n in range(len(pattern)):
        note = pattern[n]

project = reapy.Project()
track = project.add_track(name="synth")
track.add_fx("Ultra Analog Session 2")
item = track.add_midi_item(start=0,end=12)
take = item.active_take
# (created pitches, durations, velocities, and spacings here)


Last edited by d.vyd; 11-27-2019 at 08:44 AM.
d.vyd is offline   Reply With Quote