### Configuration and Setup Source: https://context7.com/levitanus/reapy-boost/llms.txt APIs for configuring REAPER and establishing connections. ```APIDOC ## configure_reaper ### Description Configures REAPER to allow reapy_boost connections from external Python processes. This sets up Python support, creates a web interface for communication, and registers the required ReaScripts. ### Method Python function call ### Endpoint N/A ### Parameters #### Query Parameters - **resource_path** (string) - Optional - Path to REAPER resources directory. ### Request Example ```python import reapy_boost # Configure REAPER for external connections (run this once with REAPER open) reapy_boost.configure_reaper() # Or specify a custom resource path reapy_boost.configure_reaper(resource_path="/path/to/reaper/resources") ``` ### Response N/A ``` ```APIDOC ## connect ### Description Connects to a REAPER instance running on a specified host. Essential for controlling REAPER from external Python scripts. ### Method Python function call ### Endpoint N/A ### Parameters #### Query Parameters - **host** (string) - Optional - Hostname or IP address of the REAPER instance. Defaults to localhost. - **web_interface_port** (integer) - Optional - Port for the web interface. Defaults to 2308. ### Request Example ```python import reapy_boost # Connect to local REAPER instance reapy_boost.connect() # Connect to REAPER on a remote machine reapy_boost.connect("192.168.1.100") # Connect with custom host configuration host = reapy_boost.Host("192.168.1.100", web_interface_port=2309) reapy_boost.connect(host) ``` ### Response N/A ``` -------------------------------- ### Install reapy via pip Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/install_guide.rst Standard installation command for the reapy package. ```bash $ pip install python-reapy ``` ```bash pip install reapy ``` -------------------------------- ### Install reapy-boost via pip Source: https://github.com/levitanus/reapy-boost/blob/master/README.md Use this command to install the reapy-boost library using pip. ```bash pip install reapy-boost ``` -------------------------------- ### Check Python version Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/install_guide.rst Verify the installed Python version to ensure compatibility with reapy. ```bash py --version ``` ```bash python --version ``` -------------------------------- ### Accessing and Manipulating FX Parameters Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Shows how to access FX on a track, get the number of parameters, set and retrieve parameter values by index or name. ```python fx = track.fxs[0] fx.n_params fx.params[0] fx.params[0] = 0.3 # Manually set the parameter fx.params[0].name # Params have names! (if the VST is nice) fx.params["Dry Gain"] # You can access them by name too ``` -------------------------------- ### Connecting to a Remote REAPER Instance Source: https://github.com/levitanus/reapy-boost/blob/master/README.md Shows how to establish a connection to a REAPER instance running on a different machine using its IP address and port. Includes an example of testing the API connection. ```Python import ipaddress import reapy_boost # add Web Interface to Raper freferences at the given location. # reapy_boost.add_web_interface("/home/levitanus/.config/REAPER/", 4460) # Then we can start REAPER, and connect to it with IP and port. reapy_boost.connect( reapy_boost.Host(ipaddress.IPv4Address(reapy_boost.LOCALHOST), 4468) ) reapy_boost.test_api() ``` -------------------------------- ### Get REAPER Paths Source: https://context7.com/levitanus/reapy-boost/llms.txt Obtain the executable directory, resource path, and INI file path using reapy_boost.get_exe_dir(), reapy_boost.get_resource_path(), and reapy_boost.get_ini_file() respectively. ```python exe_dir = reapy_boost.get_exe_dir() resource_path = reapy_boost.get_resource_path() ini_file = reapy_boost.get_ini_file() print(f"Executable: {exe_dir}") print(f"Resources: {resource_path}") print(f"INI file: {ini_file}") ``` -------------------------------- ### Get User Inputs Source: https://context7.com/levitanus/reapy-boost/llms.txt Prompt the user for multiple inputs using reapy_boost.get_user_inputs(), providing captions for each input field. The returned dictionary uses captions as keys. ```python inputs = reapy_boost.get_user_inputs( title="Enter Values", captions=["Name", "Value", "Description"] ) print(f"Name: {inputs['Name']}") ``` -------------------------------- ### Getting Envelopes for a Track Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Demonstrates how to retrieve an envelope for a track using its index or name. It also shows how to compare envelopes. ```python envelope = track.get_envelope(index=0) envelope.name track.get_envelope(name="Volume") == envelope ``` -------------------------------- ### Get Main Window Handle Source: https://context7.com/levitanus/reapy-boost/llms.txt Retrieve the handle for REAPER's main window using reapy_boost.get_main_window(). ```python main_window = reapy_boost.get_main_window() ``` -------------------------------- ### Accessing Tracks in Reapy Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Illustrates how to access tracks within a Reapy project, including getting all tracks or selected tracks, and accessing track properties like name. ```python project = reapy.Project() track = project.tracks[2] # Second track track.name ``` -------------------------------- ### Implementing a Dynamic Track List with ReaImGui Source: https://github.com/levitanus/reapy-boost/blob/master/README.md This snippet shows how to create a dynamic table of tracks using reapy_boost.gui. It includes functionality to track rendered tracks using ExtState and allows users to toggle rendering status via checkboxes. ```Python from typing import Dict, Generator, Set import reapy_boost as rpr from reapy_boost import gui from sample_editor.project import RenderedTracks class TrackList(gui.Table): def len(self) -> int: return rpr.Project().n_tracks def make_rows(self, min_row: int, max_row: int) -> Generator[gui.TableRow, None, None]: project = rpr.Project() rendered_tracks: rpr.ExtState[Set[str]] = rpr.ExtState( "levitanus sample_editor", "rendered tracks", None, project=project) tracks = project.tracks def on_click(track: rpr.Track, value: bool) -> None: _tracks = rendered_tracks.value if _tracks is None: _tracks = [] else: _tracks = [rpr.Track.from_GUID(guid) for guid in value] if value: _tracks.append(track) else: _tracks.remove(track) rendered_tracks.value = set(track.GUID for track in _tracks) for row in range(min_row, max_row): if row >= project.n_tracks: break track = tracks[row] is_rendered = track in rendered_tracks.tracks yield gui.TableRow({ "#": str(row), "name": track.name, "is_rendered": gui.CheckBox("")\ .set_click(lambda value: on_click(track, value)) .set_value(is_rendered), }) dock_button = gui.CheckBox("dock") content = gui.Content( dock_button, gui.Button("greet")\ .set_click(lambda: rpr.print('hello'))\ .width(100), gui.Row( gui.Text("my text"), gui.Button("new"), spacing=100 ), TrackList("rendered tracks") ) root = gui.Window(name="sample editor", content=content) dock_button.state = root.docked root.run() ``` -------------------------------- ### Using ExtState for GUI Widget State Management Source: https://github.com/levitanus/reapy-boost/blob/master/README.md Demonstrates how to use the ExtState class to manage the state of GUI widgets. It shows initialization, value retrieval, modification, and deletion of the state. ```Python >>> state = reapy_boost.ExtState("my section", "my value", 5) ... print(state.value) 5 ... state.value = 3 ... print(state.value) 3 ... del state.value ... print(state.value) None ``` -------------------------------- ### Get REAPER Version Source: https://context7.com/levitanus/reapy-boost/llms.txt Retrieve the current REAPER version string using reapy_boost.get_reaper_version(). ```python version = reapy_boost.get_reaper_version() print(f"REAPER version: {version}") ``` -------------------------------- ### Retrieve open projects Source: https://context7.com/levitanus/reapy-boost/llms.txt Lists all projects currently open in the REAPER instance. ```python import reapy_boost # Get all open projects projects = reapy_boost.get_projects() for project in projects: print(f"Project: {project.name}, Tracks: {project.n_tracks}") ``` -------------------------------- ### MIDI Functions Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst Functions for managing MIDI input and output devices, including getting names and counts. ```APIDOC ## MIDI Functions ### Description Provides functions to interact with REAPER's MIDI system, such as querying input/output device names, and maximum available devices. ### Methods - **midi.get_input_names()**: Gets the names of available MIDI input devices. - **midi.get_output_names()**: Gets the names of available MIDI output devices. - **midi.get_max_inputs()**: Gets the maximum number of MIDI input devices supported. - **midi.get_max_outputs()**: Gets the maximum number of MIDI output devices supported. - **midi.get_n_inputs()**: Gets the number of currently available MIDI input devices. - **midi.get_n_outputs()**: Gets the number of currently available MIDI output devices. ### Endpoint N/A (These are direct function calls within the reapy library) ### Parameters N/A for most functions, specific parameters may apply to underlying ReaScript functions not detailed here. ### Request Body N/A ### Response - **midi.get_input_names()**: List of strings (MIDI input device names) - **midi.get_output_names()**: List of strings (MIDI output device names) - **midi.get_max_inputs()**: Integer (maximum MIDI inputs) - **midi.get_max_outputs()**: Integer (maximum MIDI outputs) - **midi.get_n_inputs()**: Integer (number of available MIDI inputs) - **midi.get_n_outputs()**: Integer (number of available MIDI outputs) ### Request Example ```python import reapy midi_inputs = reapy.midi.get_input_names() print(f"MIDI Inputs: {midi_inputs}") ``` ### Response Example ```json { "midi_inputs": ["MIDI Device 1", "MIDI Device 2"] } ``` ``` -------------------------------- ### Audio Functions Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst Functions for managing audio input and output, including getting names, latencies, and counts. ```APIDOC ## Audio Functions ### Description Provides functions to interact with REAPER's audio system, such as querying input/output channel names, latencies, and counts. ### Methods - **audio.quit()**: Quits the audio system. - **audio.get_input_names()**: Gets the names of available audio input channels. - **audio.get_input_latency()**: Gets the current input latency. - **audio.get_output_latency()**: Gets the current output latency. - **audio.get_n_inputs()**: Gets the number of available audio input channels. - **audio.get_n_outputs()**: Gets the number of available audio output channels. - **audio.get_output_names()**: Gets the names of available audio output channels. ### Endpoint N/A (These are direct function calls within the reapy library) ### Parameters N/A for most functions, specific parameters may apply to underlying ReaScript functions not detailed here. ### Request Body N/A ### Response - **audio.quit()**: None - **audio.get_input_names()**: List of strings (input channel names) - **audio.get_input_latency()**: Float (input latency in seconds) - **audio.get_output_latency()**: Float (output latency in seconds) - **audio.get_n_inputs()**: Integer (number of input channels) - **audio.get_n_outputs()**: Integer (number of output channels) - **audio.get_output_names()**: List of strings (output channel names) ### Request Example ```python import reapy input_names = reapy.audio.get_input_names() print(f"Input names: {input_names}") ``` ### Response Example ```json { "input_names": ["Input 1", "Input 2"] } ``` ``` -------------------------------- ### Configure REAPER for external connections Source: https://context7.com/levitanus/reapy-boost/llms.txt Sets up Python support and the web interface required for external communication. Run this once while REAPER is open. ```python import reapy_boost # Configure REAPER for external connections (run this once with REAPER open) reapy_boost.configure_reaper() # Or specify a custom resource path reapy_boost.configure_reaper(resource_path="/path/to/reaper/resources") ``` -------------------------------- ### Get REAPER Command Name from ID Source: https://context7.com/levitanus/reapy-boost/llms.txt Retrieve the name of a REAPER action given its command ID using reapy_boost.get_command_name(). ```python cmd_name = reapy_boost.get_command_name(40001) ``` -------------------------------- ### Manage Markers Source: https://context7.com/levitanus/reapy-boost/llms.txt Adding and listing project markers. ```python import reapy_boost project = reapy_boost.Project() # Add a marker marker = project.add_marker( position=10.0, # Position in seconds name="Verse 1", color=(255, 128, 0) # RGB color ) # Access all markers markers = project.markers for m in markers: print(f"Marker {m.index}: {m.name} at {m.position}s") # Marker count print(f"Number of markers: {project.n_markers}") ``` -------------------------------- ### Get REAPER Command ID from Name Source: https://context7.com/levitanus/reapy-boost/llms.txt Find the command ID for a given action name string using reapy_boost.get_command_id(). ```python cmd_id = reapy_boost.get_command_id("_RS12345...") ``` -------------------------------- ### Project Methods in Reapy Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Shows how to use methods available for a Reapy Project, such as making it current, adding tracks, and playing the project. ```python project = reapy.Project() project.make_current_project() track = project.add_track() project.play() # Hit the play button ``` -------------------------------- ### Manage persistent extended state Source: https://context7.com/levitanus/reapy-boost/llms.txt Shows how to set, get, check, and delete persistent key-value data, including support for pickled Python objects. ```python import reapy_boost # Set extended state (persists across sessions) reapy_boost.set_ext_state( section="MyScript", key="last_used_preset", value="Default", persist=True # Save to disk ) # Get extended state value = reapy_boost.get_ext_state("MyScript", "last_used_preset") print(f"Value: {value}") # Check if state exists if reapy_boost.has_ext_state("MyScript", "last_used_preset"): print("State exists") # Delete extended state reapy_boost.delete_ext_state("MyScript", "last_used_preset", persist=True) # Store complex Python objects (pickled) data = {"setting1": 42, "setting2": [1, 2, 3]} reapy_boost.set_ext_state("MyScript", "config", data, pickled=True) retrieved_data = reapy_boost.get_ext_state("MyScript", "config", pickled=True) ``` -------------------------------- ### Manage Regions Source: https://context7.com/levitanus/reapy-boost/llms.txt Adding and listing project regions. ```python import reapy_boost project = reapy_boost.Project() # Add a region region = project.add_region( start=0.0, end=30.0, name="Intro", color=(0, 255, 0) ) # Access all regions regions = project.regions for r in regions: print(f"Region {r.index}: {r.name} ({r.start}s - {r.end}s)") # Region count print(f"Number of regions: {project.n_regions}") ``` -------------------------------- ### Manage REAPER projects Source: https://context7.com/levitanus/reapy-boost/llms.txt Access project properties, transport controls, and time selection settings. ```python import reapy_boost # Get the current project project = reapy_boost.Project() # Access project properties print(f"Project: {project.name}") print(f"BPM: {project.bpm}") print(f"Length: {project.length} seconds") print(f"Number of tracks: {project.n_tracks}") # Modify project tempo project.bpm = 120.0 # Transport controls project.play() project.pause() project.stop() project.record() # Get cursor and playhead positions print(f"Cursor position: {project.cursor_position}") print(f"Play position: {project.play_position}") # Set time selection project.time_selection = (10.0, 20.0) # Start, end in seconds ``` -------------------------------- ### Pythonic API for project cursor position Source: https://github.com/levitanus/reapy-boost/blob/master/README.md Shows the more Pythonic way to get and set the current project's cursor position using the reapy_boost.Project object. ```python import reapy_boost project = reapy_boost.Project() # Current project project.cursor_position project.cursor_position = 1 project.cursor_position ``` -------------------------------- ### Execute Core REAPER Functions Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Demonstrates basic interaction with the REAPER API, such as printing to the console, clearing the console, and managing ReaScripts. ```python >>> import reapy >>> reapy.print("Hello world!") >>> reapy.clear_console() >>> reapy.get_reaper_version() '5.965/x64' >>> command_id = reapy.add_reascript(r"C:\path\to\my\reascript.py") >>> command_id 53007 >>> reapy.get_command_name(command_id) '_RSbcbf8f64cb92ff8062457098ee1194c7742e6431' ``` -------------------------------- ### Connect to REAPER instance Source: https://context7.com/levitanus/reapy-boost/llms.txt Establishes a connection to a local or remote REAPER instance for external script execution. ```python import reapy_boost # Connect to local REAPER instance reapy_boost.connect() # Connect to REAPER on a remote machine reapy_boost.connect("192.168.1.100") # Connect with custom host configuration host = reapy_boost.Host("192.168.1.100", web_interface_port=2309) reapy_boost.connect(host) ``` -------------------------------- ### Pythonic REAPER Project Interaction with reapy Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/index.rst Illustrates the more Pythonic way to interact with REAPER projects using reapy's object-oriented API, such as getting and setting the cursor position. ```python >>> import reapy >>> project = reapy.Project() # current project >>> project.cursor_position 0.0 >>> project.cursor_position = 1 >>> project.cursor_position 1.0 ``` -------------------------------- ### FX Preset Management Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst Load, save, and navigate through effect presets. ```APIDOC ## TakeFX_GetPreset ### Description Gets the name of the current preset for an effect. ### Method GET ### Endpoint /TakeFX_GetPreset ### Parameters #### Path Parameters - **fx_idx** (int) - Required - The index of the effect on the take. ### Response #### Success Response (200) - **preset_name** (str) - The name of the current preset. ## TakeFX_GetPresetIndex ### Description Gets the index of the current preset for an effect. ### Method GET ### Endpoint /TakeFX_GetPresetIndex ### Parameters #### Path Parameters - **fx_idx** (int) - Required - The index of the effect on the take. ### Response #### Success Response (200) - **preset_index** (int) - The index of the current preset. ## TakeFX_GetUserPresetFilename ### Description Gets the filename of the user-selected preset for an effect. ### Method GET ### Endpoint /TakeFX_GetUserPresetFilename ### Parameters #### Path Parameters - **fx_idx** (int) - Required - The index of the effect on the take. ### Response #### Success Response (200) - **preset_filename** (str) - The filename of the user preset. ## TakeFX_NavigatePresets ### Description Navigates to the next or previous preset for an effect. ### Method POST ### Endpoint /TakeFX_NavigatePresets ### Parameters #### Path Parameters - **fx_idx** (int) - Required - The index of the effect on the take. - **direction** (str) - Required - 'next' to go to the next preset, 'previous' to go to the previous preset. ## TakeFX_SetPreset ### Description Sets the current preset for an effect by its name. ### Method POST ### Endpoint /TakeFX_SetPreset ### Parameters #### Path Parameters - **fx_idx** (int) - Required - The index of the effect on the take. - **preset_name** (str) - Required - The name of the preset to set. ## TakeFX_SetPresetByIndex ### Description Sets the current preset for an effect by its index. ### Method POST ### Endpoint /TakeFX_SetPresetByIndex ### Parameters #### Path Parameters - **fx_idx** (int) - Required - The index of the effect on the take. - **preset_index** (int) - Required - The index of the preset to set. ``` -------------------------------- ### Project Tempo and Play Rate Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst APIs for retrieving and setting the project's tempo and playback rate. ```APIDOC ## GET /api/project/bpm ### Description Retrieves the current tempo (BPM) of the project. ### Method GET ### Endpoint /api/project/bpm ### Parameters None ### Response #### Success Response (200) - **bpm** (float) - The current beats per minute of the project. #### Response Example ```json { "bpm": 120.0 } ``` ## GET /api/project/play_rate ### Description Retrieves the current playback rate of the project. ### Method GET ### Endpoint /api/project/play_rate ### Parameters None ### Response #### Success Response (200) - **play_rate** (float) - The current playback rate. #### Response Example ```json { "play_rate": 1.0 } ``` ## GET /api/project/get_play_rate ### Description Retrieves the playback rate at a specific time. ### Method GET ### Endpoint /api/project/get_play_rate ### Parameters - **time** (float) - The time in seconds at which to get the play rate. ### Response #### Success Response (200) - **play_rate** (float) - The playback rate at the specified time. #### Response Example ```json { "play_rate": 1.0 } ``` ``` -------------------------------- ### Access and Modify Project Properties Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Demonstrates accessing and setting properties like BPM and length for a Reapy Project. Note that 'length' cannot be set manually. ```python project = reapy.Project() project.bpm project.bpm = 100 # Set the tempo in REAPER to 100 project.length = 10 # Doesn't make sense to manually set length! ``` -------------------------------- ### Manage FX Source: https://context7.com/levitanus/reapy-boost/llms.txt Adding, accessing, configuring, and manipulating FX plugins on tracks. ```python import reapy_boost project = reapy_boost.Project() track = project.tracks[0] # Add FX to track compressor = track.add_fx("ReaComp") eq = track.add_fx("ReaEQ", even_if_exists=True) # Access FX list fx_list = track.fxs print(f"Number of FX: {len(fx_list)}") # Access FX by index or name fx = fx_list[0] fx = fx_list["VST: ReaComp (Cockos)"] # FX properties print(f"FX name: {fx.name}") print(f"Enabled: {fx.is_enabled}") print(f"Preset: {fx.preset}") # Enable/disable FX fx.disable() fx.enable() fx.is_enabled = True # Presets fx.preset = "Factory Preset 1" # By name fx.preset = 5 # By index fx.use_next_preset() fx.use_previous_preset() # FX UI fx.open_ui() fx.close_ui() fx.open_floating_window() fx.close_floating_window() # Move/copy FX fx.copy_to_track(project.tracks[1], index=0) fx.move_to_track(project.tracks[2], index=0) # Delete FX fx.delete() ``` -------------------------------- ### Print to REAPER Console Source: https://context7.com/levitanus/reapy-boost/llms.txt Use reapy_boost.print() for standard output and reapy_boost.show_console_message() for messages that include newlines. ```python reapy_boost.print("Hello from reapy_boost!") ``` ```python reapy_boost.show_console_message("Another message\n") ``` -------------------------------- ### Manage Project Items Source: https://context7.com/levitanus/reapy-boost/llms.txt Basic operations for accessing, modifying, creating, splitting, and deleting items within a project. ```python item = items[0] print(f"Position: {item.position} seconds") print(f"Length: {item.length} seconds") # Modify item properties item.position = 5.0 item.length = 10.0 # Create new items new_item = track.add_item(start=0, end=5) # Start and end in seconds midi_item = track.add_midi_item(start=0, end=4) # Empty MIDI item # Split an item left, right = item.split(position=2.5) # Split at 2.5 seconds # Delete an item item.delete() # Select/deselect items item.is_selected = True project.select_all_items(selected=True) ``` -------------------------------- ### Project Time Signature and Tempo API Mapping Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst Mapping of ReaScript functions for project time signature and tempo markers. ```APIDOC ## Project Time Signature and Tempo Functions ### Description Functions for retrieving project time signature and tempo information. ### Mappings - **GetProjectTimeSignature2** -> `Project.bpm`, `Project.bpi` ``` -------------------------------- ### Project Playback and Position Control Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst APIs for controlling playback, cursor position, and time selection within a REAPER project. ```APIDOC ## GET /api/project/play_position ### Description Retrieves the current playback position of the project. ### Method GET ### Endpoint /api/project/play_position ### Parameters None ### Response #### Success Response (200) - **position** (float) - The current playback position in seconds. #### Response Example ```json { "position": 123.45 } ``` ## GET /api/project/buffer_position ### Description Retrieves the buffer playback position of the project. ### Method GET ### Endpoint /api/project/buffer_position ### Parameters None ### Response #### Success Response (200) - **position** (float) - The current buffer playback position in seconds. #### Response Example ```json { "position": 123.45 } ``` ## GET /api/project/play_state ### Description Retrieves the current playback state of the project (playing, paused, stopped, recording). ### Method GET ### Endpoint /api/project/play_state ### Parameters None ### Response #### Success Response (200) - **state** (string) - The current playback state (e.g., "playing", "paused", "stopped", "recording"). #### Response Example ```json { "state": "playing" } ``` ## GET /api/project/is_playing ### Description Checks if the project is currently playing. ### Method GET ### Endpoint /api/project/is_playing ### Parameters None ### Response #### Success Response (200) - **is_playing** (boolean) - True if the project is playing, false otherwise. #### Response Example ```json { "is_playing": true } ``` ## GET /api/project/is_paused ### Description Checks if the project is currently paused. ### Method GET ### Endpoint /api/project/is_paused ### Parameters None ### Response #### Success Response (200) - **is_paused** (boolean) - True if the project is paused, false otherwise. #### Response Example ```json { "is_paused": false } ``` ## GET /api/project/is_stopped ### Description Checks if the project is currently stopped. ### Method GET ### Endpoint /api/project/is_stopped ### Parameters None ### Response #### Success Response (200) - **is_stopped** (boolean) - True if the project is stopped, false otherwise. #### Response Example ```json { "is_stopped": false } ``` ## GET /api/project/is_recording ### Description Checks if the project is currently recording. ### Method GET ### Endpoint /api/project/is_recording ### Parameters None ### Response #### Success Response (200) - **is_recording** (boolean) - True if the project is recording, false otherwise. #### Response Example ```json { "is_recording": false } ``` ## POST /api/project/play ### Description Starts playback of the project. ### Method POST ### Endpoint /api/project/play ### Parameters None ### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Playback started." } ``` ## POST /api/project/pause ### Description Pauses playback of the project. ### Method POST ### Endpoint /api/project/pause ### Parameters None ### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Playback paused." } ``` ## POST /api/project/stop ### Description Stops playback of the project. ### Method POST ### Endpoint /api/project/stop ### Parameters None ### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Playback stopped." } ``` ## PUT /api/project/cursor_position ### Description Sets the edit cursor position for the project. ### Method PUT ### Endpoint /api/project/cursor_position ### Parameters None ### Request Body - **position** (float) - The desired cursor position in seconds. ### Request Example ```json { "position": 150.75 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Cursor position set." } ``` ## PUT /api/project/time_selection ### Description Sets the time selection range for the project. ### Method PUT ### Endpoint /api/project/time_selection ### Parameters None ### Request Body - **start** (float) - The start time of the selection in seconds. - **end** (float) - The end time of the selection in seconds. ### Request Example ```json { "start": 100.0, "end": 200.0 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Time selection set." } ``` ``` -------------------------------- ### Navigation and Control Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst APIs for navigating markers, regions, and controlling edit cursor. ```APIDOC ## POST /api/navigation/goto_marker ### Description Navigates the project to a specific marker. ### Method POST ### Endpoint /api/navigation/goto_marker ### Parameters - **marker_index** (integer) - The index of the marker to navigate to. ### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Navigated to marker." } ``` ## POST /api/navigation/goto_region ### Description Navigates the project to a specific region. ### Method POST ### Endpoint /api/navigation/goto_region ### Parameters - **region_index** (integer) - The index of the region to navigate to. ### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Navigated to region." } ``` ## POST /api/navigation/move_edit_cursor ### Description Moves the edit cursor to a specified position. ### Method POST ### Endpoint /api/navigation/move_edit_cursor ### Parameters - **position** (float) - The desired position for the edit cursor in seconds. ### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Edit cursor moved." } ``` ``` -------------------------------- ### Project Management Source: https://context7.com/levitanus/reapy-boost/llms.txt APIs for managing REAPER projects. ```APIDOC ## Project ### Description Represents the main entry point for working with REAPER projects. Provides access to tracks, items, markers, regions, and transport controls. ### Method Class instantiation ### Endpoint N/A ### Parameters N/A ### Request Example ```python import reapy_boost # Get the current project project = reapy_boost.Project() # Access project properties print(f"Project: {project.name}") print(f"BPM: {project.bpm}") print(f"Length: {project.length} seconds") print(f"Number of tracks: {project.n_tracks}") # Modify project tempo project.bpm = 120.0 # Transport controls project.play() project.pause() project.stop() project.record() # Get cursor and playhead positions print(f"Cursor position: {project.cursor_position}") print(f"Play position: {project.play_position}") # Set time selection project.time_selection = (10.0, 20.0) # Start, end in seconds ``` ### Response - **name** (string) - The name of the project. - **bpm** (float) - The current tempo of the project. - **length** (float) - The total length of the project in seconds. - **n_tracks** (integer) - The number of tracks in the project. - **cursor_position** (float) - The current cursor position in seconds. - **play_position** (float) - The current playback position in seconds. - **time_selection** (tuple) - A tuple representing the start and end of the time selection in seconds. ``` ```APIDOC ## open_project ### Description Opens a REAPER project file and returns the Project object. ### Method Python function call ### Endpoint N/A ### Parameters #### Path Parameters - **filepath** (string) - Required - The path to the REAPER project file (.rpp). #### Query Parameters - **in_new_tab** (boolean) - Optional - Whether to open the project in a new tab. Defaults to False. - **make_current_project** (boolean) - Optional - Whether to make this the current project. Defaults to True. ### Request Example ```python import reapy_boost # Open a project file project = reapy_boost.open_project("/path/to/project.rpp") # Open in a new tab project = reapy_boost.open_project("/path/to/project.rpp", in_new_tab=True) # Open without making it the current project project = reapy_boost.open_project( "/path/to/project.rpp", in_new_tab=True, make_current_project=False ) ``` ### Response - **Project** (object) - The opened Project object. ``` ```APIDOC ## get_projects ### Description Returns a list of all currently open projects in REAPER. ### Method Python function call ### Endpoint N/A ### Parameters N/A ### Request Example ```python import reapy_boost # Get all open projects projects = reapy_boost.get_projects() for project in projects: print(f"Project: {project.name}, Tracks: {project.n_tracks}") ``` ### Response - **projects** (list) - A list of Project objects. ``` -------------------------------- ### Access and manipulate track automation envelopes Source: https://context7.com/levitanus/reapy-boost/llms.txt Demonstrates how to access track envelopes, retrieve them by index, and add points to an envelope. ```python import reapy_boost project = reapy_boost.Project() track = project.tracks[0] # Access track envelopes envelopes = track.envelopes print(f"Number of envelopes: {track.n_envelopes}") # Get envelope by index env = envelopes[0] print(f"Envelope name: {env.name}") # Add envelope points env.add_point(time=0.0, value=0.5) env.add_point(time=5.0, value=1.0) env.add_point(time=10.0, value=0.0) ``` -------------------------------- ### Access REAPER Projects Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_guide.rst Instantiate reapy.Project objects to interact with specific project tabs in REAPER. ```python >>> reapy.Project() # Current project Project("(ReaProject*)0x0000000006D3AFF0") >>> reapy.Project(index=1) # Project in REAPER's second tab Project("(ReaProject*)0x000000000440A2D0") >>> reapy.Project(index=-1) # Current project Project("(ReaProject*)0x0000000006D3AFF0") ``` -------------------------------- ### Browse for File Source: https://context7.com/levitanus/reapy-boost/llms.txt Open a file browser dialog with a specified window title and file extension filter using reapy_boost.browse_for_file(). ```python filepath = reapy_boost.browse_for_file( window_title="Select Audio File", extension="wav" ) ``` -------------------------------- ### Open REAPER project files Source: https://context7.com/levitanus/reapy-boost/llms.txt Opens specific project files, optionally in new tabs or without setting them as the active project. ```python import reapy_boost # Open a project file project = reapy_boost.open_project("/path/to/project.rpp") # Open in a new tab project = reapy_boost.open_project("/path/to/project.rpp", in_new_tab=True) # Open without making it the current project project = reapy_boost.open_project( "/path/to/project.rpp", in_new_tab=True, make_current_project=False ) ``` -------------------------------- ### Console and UI interaction Source: https://context7.com/levitanus/reapy-boost/llms.txt Placeholder for console and UI interaction functions. ```python import reapy_boost ``` -------------------------------- ### Optimizing external API calls with map and inside_reaper Source: https://github.com/levitanus/reapy-boost/blob/master/README.md Illustrates performance optimization for external API calls using both the `map` method on reapy_boost objects and the `inside_reaper` context manager. The `map` method reduces socket connection overhead, while `inside_reaper` ensures efficient execution within REAPER. ```python import reapy_boost take = reapy_boost.Project().selected_items[0].active_take @reapy_boost.inside_reaper() def test(): for i in [6.0] * 1000000: take.time_to_ppq(6.0) def test_map(): take.map('time_to_ppq', iterables={'time': [6.0] * 1000000}) test() # runs 140s test_map() # runs 12s as from outside as from inside ``` -------------------------------- ### Performance Optimization Source: https://context7.com/levitanus/reapy-boost/llms.txt Utilize ReaPy Boost features for efficient batch operations. ```APIDOC ## Performance Optimization Utilize ReaPy Boost features for efficient batch operations. ### `inside_reaper` #### Description Context manager and decorator for efficient batch operations when running from outside REAPER. #### Usage ```python import reapy_boost # Context manager - reduces network overhead for multiple calls project = reapy_boost.Project() with reapy_boost.inside_reaper(): # All operations inside this block are batched for track in project.tracks: for item in track.items: print(f"{track.name}: {item.position}") # Decorator for functions @reapy_boost.inside_reaper() def process_all_tracks(): project = reapy_boost.Project() for track in project.tracks: track.color = (255, 0, 0) ``` ### `reapy_boost.map` #### Description Efficiently map a function to iterables with reduced network overhead. #### Usage ```python import reapy_boost import time project = reapy_boost.Project() take = project.items[0].active_take # Slow approach - each call is a network roundtrip start_time = time.time() with reapy_boost.inside_reaper(): ppqs = [take.time_to_ppq(t) for t in range(10000)] print(f"Inside reaper: {time.time() - start_time:.1f}s") # Fast approach - all calls batched start_time = time.time() ppqs = reapy_boost.map(take.time_to_ppq, list(range(10000))) print(f"With reapy.map: {time.time() - start_time:.1f}s") ``` ### `prevent_ui_refresh` #### Description Context manager to prevent UI updates during batch operations. #### Usage ```python import reapy_boost project = reapy_boost.Project() # Prevent UI refresh during bulk operations with reapy_boost.prevent_ui_refresh(): for i in range(100): project.add_track(name=f"Track {i}") ``` ``` -------------------------------- ### Configure REAPER for reapy Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/install_guide.rst Command to register reapy with the REAPER application. Requires REAPER to be open during execution. ```bash $ python -c "import reapy; reapy.configure_reaper()" ``` ```bash py -c "import reapy; reapy.configure_reaper()" ``` ```bash python -c "import reapy; reapy.configure_reaper()" ``` -------------------------------- ### Item and Take Management Source: https://context7.com/levitanus/reapy-boost/llms.txt APIs for managing media items and takes within a REAPER track. ```APIDOC ## Item ### Description Represents a media item on a track with position, length, and take information. ### Method Access via Track object ### Endpoint N/A ### Parameters N/A ### Request Example ```python import reapy_boost project = reapy_boost.Project() track = project.tracks[0] # Get items on a track items = track.items print(f"Number of items: {len(items)}") ``` ### Response - **length** (float) - The length of the item in seconds. - **position** (float) - The start position of the item in seconds. - **takes** (list) - A list of Take objects associated with the item. ``` -------------------------------- ### Perform MIDI Operations Source: https://context7.com/levitanus/reapy-boost/llms.txt Methods for adding notes, CC events, SysEx events, and converting between time units in a MIDI take. ```python import reapy_boost project = reapy_boost.Project() track = project.tracks[0] # Create a MIDI item midi_item = track.add_midi_item(start=0, end=4) take = midi_item.active_take # Add MIDI notes take.add_note( start=0.0, # Start time end=0.5, # End time pitch=60, # MIDI note number (C4) velocity=100, # Note velocity (0-127) channel=0, # MIDI channel (0-15) selected=False, muted=False, unit="seconds" # Can be "seconds", "ppq", or "beats" ) # Add multiple notes efficiently (disable sorting until done) for i in range(8): take.add_note( start=i * 0.5, end=(i + 1) * 0.5, pitch=60 + i, velocity=100, sort=False # Don't sort after each note ) take.sort_events() # Sort all events at once # Add CC events take.add_event( message=(0xB0, 64, 127), # CC64 (sustain pedal) on, channel 1 position=0.0, unit="seconds" ) # Add SysEx events take.add_sysex( message=(0x7E, 0x00, 0x06, 0x01), # Identity request position=1.0, unit="seconds" ) # Convert between time units ppq = take.time_to_ppq(1.0) # Seconds to MIDI ticks time = take.ppq_to_time(960) # MIDI ticks to seconds ``` -------------------------------- ### Command and Render API Mapping Source: https://github.com/levitanus/reapy-boost/blob/master/docs/source/api_table.rst Mapping of ReaScript functions for command arming and region rendering. ```APIDOC ## Command and Render Functions ### Description Functions for handling command states and region render matrices. ### Mappings - **ArmCommand** -> `arm_command`, `disarm_command` - **GetArmedCommand** -> `get_armed_command` - **SetRegionRenderMatrix** -> `Region.add_rendered_track`, `Region.remove_rendered_track` ```