View on GitHub

clap-mml-render-tui

clap-mml-render-tui

clap-mml-render-tui

Usage

Tech Stack

Prerequisites

Please install Surge XT.

winget install "Surge XT"

Install

cargo install --force --git https://github.com/cat2151/clap-mml-render-tui

Run

cmrt

You can input MML in the TUI screen and play around.

Configuration

config.toml is automatically created on first launch. It’s located in the OS standard configuration directory.

In TUI / DAW NORMAL mode, pressing e opens config.toml in an editor. After closing the editor, restart the application.

Here’s an example of the current configuration.

# [REQUIRED] CLAP plugin to use
plugin_path = 'C:\Program Files\Common Files\CLAP\Surge Synth Team\Surge XT.clap'

# Editor candidates for opening config.toml (tried in order from left)
editors = ["fresh", "zed", "code", "edit", "nano", "vim"]

input_midi  = "input.mid"

# output_midi and output_wav are automatically saved under the
# clap-mml-render-tui/phrase/ or clap-mml-render-tui/daw/ subdirectories
# of the configuration directory. The following values are used internally.
output_midi = "output.mid"
output_wav  = "output.wav"

sample_rate = 48000
buffer_size = 512

# Number of concurrent offline renders for DAW (1-16)
offline_render_workers = 2

# Offline rendering backend
# in_process: Renders within the main cmrt process.
# render_server: Renders by POSTing to /render on a render-server child process.
offline_render_backend = "in_process"
offline_render_server_workers = 4
offline_render_server_port = 62153
offline_render_server_command = ""

# Real-time playback backend
realtime_audio_backend = "in_process"
realtime_play_server_port = 62154
realtime_play_server_command = ""

# List of directories to search for Surge XT patches
patches_dirs = [
  'C:\ProgramData\Surge XT\patches_factory',
  'C:\ProgramData\Surge XT\patches_3rdparty',
]

The configuration items are as follows:

Item Default Value Description
plugin_path OS-specific default Surge XT CLAP path Path to the CLAP plugin to use.
editors ["fresh", "zed", "code", "edit", "nano", "vim"] Editor candidates, tried in order from left to right.
input_midi input.mid Input MIDI filename for internal processing.
output_midi output.mid Output MIDI filename for internal processing.
output_wav output.wav Output WAV filename for internal processing.
sample_rate 48000 Sample rate for rendering.
buffer_size 512 Buffer size for rendering.
offline_render_workers 2 Number of concurrent renders for the in_process backend.
offline_render_backend in_process Destination for offline rendering.
offline_render_server_workers 4 Number of concurrent workers for render_server.
offline_render_server_port 62153 Localhost port for render_server.
offline_render_server_command Empty string Command to launch render_server.
realtime_audio_backend in_process Destination for real-time playback.
realtime_play_server_port 62154 Localhost port for play_server.
realtime_play_server_command Empty string Command to launch play_server.
patches_dirs OS-specific default Surge XT patches directories List of directories to search for patches when selecting sounds.

The default plugin_path values per OS are as follows:

The default patches_dirs values per OS are as follows:

If offline_render_backend = "render_server", the TUI does not directly load the CLAP plugin. Instead, it sends MML to 127.0.0.1:<offline_render_server_port>/render and receives WAV data. If the connection to the render-server fails, cmrt launches a child process and, in case of a communication error, retries after restarting once.

Update Command

cmrt update

Server Mode

cmrt --server

Breaking Changes

Future Plans

Concept Notes

Out of Scope