Plugin API Reference

Reference for UI, score, audio, and project APIs exposed to plugins.

The roneat_api object is injected automatically.

Import the modules you need inside your plugin code.

No external installation is required for these built-in modules.

Import pattern

import roneat_api.ui
import roneat_api.score
import roneat_api.audio
import roneat_api.project

roneat_api.ui

UI APIs control windows, notifications, theming, and language.

  • get_main_window() returns the underlying MainWindow CustomTkinter object

  • show_toast(message: str, level: str = "info", duration: int = 3000) shows a floating notification

  • show_dialog(title: str, message: str, dialog_type: str = "info") shows a blocking dialog

  • add_menu_item(menu_name: str, label: str, command: Callable) adds a utility action inside the plugin area

  • create_window(title: str, width: int = 400, height: int = 300) creates a themed CTkToplevel window that matches the current light or dark app theme

  • get_theme_colors() returns the current theme dictionary, such as {\"accent\": \"#HEX\", \"bg\": \"#HEX\"}

  • set_theme_color(key: str, hex_color: str) overrides a theme color and repaints the UI

  • set_language(lang_code: str) changes the UI language at runtime

Use UI APIs for

  • toasts and dialogs

  • plugin actions and controls

  • theme changes

  • language changes

  • custom tool windows

roneat_api.score

Score APIs work on the active musical score document.

  • get_raw_text() -> str returns the full editor text

  • replace_text(text: str) replaces the entire score

  • insert_at_cursor(text: str) inserts text at the current caret position

  • add_note(bar_index: int, time: float, duration: float) appends a formatted note

  • set_tempo(bpm: int) updates the BPM value

  • get_all_notes() -> list[dict] parses notes into actionable dictionaries

Use score APIs for

  • note insertion

  • note analysis

  • score cleanup

  • score transformation tools

roneat_api.audio

Audio APIs interact with the SoundDevice playback engine.

  • play_note(bar_index: int, duration: float) plays a Roneat block through the active synth

  • play_frequency(hz: float, duration: float) synthesizes a raw frequency asynchronously without freezing the GUI

  • stop_all() stops all playback buffers

  • is_playing() -> bool returns the global playback state

Use audio APIs for

  • preview tools

  • plugin-generated tones

  • validation signals

  • playback-aware utilities

roneat_api.project

Project APIs read and manipulate user sessions.

  • get_data() -> dict returns internal project metadata

  • save() opens the save flow or overwrites the current file

  • load(filepath: str) loads a .roneat file from disk and replaces the current session

Use project APIs for

  • save helpers

  • project automation

  • metadata inspection

  • workflow plugins

Practical usage pattern

Start from the smallest possible integration:

  1. show a toast

  2. add one plugin action

  3. read the score

  4. write a small score mutation

  5. add cleanup logic

That sequence makes debugging much easier.

Last updated

Was this helpful?