├── .gitignore ├── .vscode └── settings.json ├── config.json ├── library ├── renoise │ ├── views.lua │ ├── song │ │ ├── instrument │ │ │ ├── midi_input.lua │ │ │ ├── midi_output.lua │ │ │ ├── sample_device_chain.lua │ │ │ ├── macro.lua │ │ │ ├── phrase_script.lua │ │ │ ├── plugin.lua │ │ │ └── phrase.lua │ │ ├── pattern │ │ │ ├── track.lua │ │ │ ├── automation.lua │ │ │ └── line.lua │ │ ├── pattern.lua │ │ ├── device.lua │ │ ├── pattern_iterator.lua │ │ ├── sequencer.lua │ │ ├── track.lua │ │ └── transport.lua │ ├── views │ │ ├── chooser.lua │ │ ├── stack.lua │ │ ├── value.lua │ │ ├── popup.lua │ │ ├── checkbox.lua │ │ ├── valuefield.lua │ │ ├── minislider.lua │ │ ├── rotary.lua │ │ ├── link.lua │ │ ├── switch.lua │ │ ├── aligner.lua │ │ ├── rack.lua │ │ ├── textfield.lua │ │ ├── multiline_textfield.lua │ │ ├── text.lua │ │ ├── multiline_text.lua │ │ ├── slider.lua │ │ ├── scrollbar.lua │ │ ├── valuebox.lua │ │ ├── control.lua │ │ ├── xypad.lua │ │ ├── bitmap.lua │ │ ├── button.lua │ │ └── view.lua │ ├── osc.lua │ ├── application │ │ ├── theme.lua │ │ └── window.lua │ ├── midi.lua │ ├── viewbuilder.lua │ └── socket.lua └── renoise.lua ├── LICENSE ├── plugin.lua └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | test.lua 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Lua.misc.parameters": ["--develop=true"], 3 | "Lua.runtime.plugin": "plugin.lua", 4 | "Lua.runtime.version" : "LuaJIT", 5 | "Lua.runtime.builtin": {"ffi": "disable"}, 6 | } 7 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "renoise", 3 | "words": [ 4 | "%s*renoise%.%w+" 5 | ], 6 | "has_plugin": true, 7 | "settings": { 8 | "Lua.runtime.version": "LuaJIT", 9 | "Lua.runtime.builtin": { 10 | "ffi": "disable" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /library/renoise/views.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views 11 | 12 | ---Namespace for renoise view widgets. 13 | ---@see renoise.ViewBuilder 14 | ---@class renoise.Views 15 | local Views = {} 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024-2025 by the renoise authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/midi_input.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.InstrumentMidiInputProperties 11 | 12 | ---@class renoise.InstrumentMidiInputProperties 13 | renoise.InstrumentMidiInputProperties = {} 14 | 15 | ---### properties 16 | 17 | ---@class renoise.InstrumentMidiInputProperties 18 | --- 19 | ---When setting new devices, device names must be one of 20 | ---`renoise.Midi.available_input_devices()` or "Renoise OSC Device". 21 | ---To close a device and disconnect it from the instrument, assign 22 | ---an empty string. 23 | ---@field device_name string 24 | ---@field device_name_observable renoise.Document.Observable 25 | ---@field channel integer Range: (1 - 16) 0 = Omni 26 | ---@field channel_observable renoise.Document.Observable 27 | ---Table of two numbers in range (0-119) where C-4 is 48 28 | ---@field note_range integer[] 29 | ---@field note_range_observable renoise.Document.Observable 30 | ---Range: (1 - song.sequencer_track_count) 0 = Current track 31 | ---@field assigned_track integer 32 | ---@field assigned_track_observable renoise.Document.Observable 33 | -------------------------------------------------------------------------------- /library/renoise/views/chooser.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.Chooser 11 | 12 | ---A radio button like set of vertically stacked items. Only one value can be 13 | ---selected at a time. 14 | ---```text 15 | --- . Item A 16 | --- o Item B 17 | --- . Item C 18 | ---``` 19 | ---@class renoise.Views.Chooser : renoise.Views.Control 20 | ---@field items ItemLabels 21 | ---@field value SelectedItem 22 | local Chooser = {} 23 | 24 | ---### functions 25 | 26 | ---Add index change notifier 27 | ---@param notifier IntegerValueNotifierFunction 28 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 29 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 30 | function Chooser:add_notifier(notifier) end 31 | 32 | ---Remove index change notifier 33 | ---@param notifier IntegerValueNotifierFunction 34 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 35 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 36 | function Chooser:remove_notifier(notifier) end 37 | 38 | -------------------------------------------------------------------------------- 39 | 40 | ---@class ChooserProperties : ControlProperties 41 | ---@field bind ViewNumberObservable? 42 | ---@field value SelectedItem? 43 | ---@field notifier IntegerNotifier? 44 | ---@field items ItemLabels? 45 | -------------------------------------------------------------------------------- /library/renoise/views/stack.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.Stack 11 | 12 | ---When set to true, the width and height of the stack will be automatically 13 | ---calculated and updated from the stack's child views, to ensure all views fit 14 | ---into the stack. 15 | ---When disabled, the width and height must be set manually. 16 | ---* Default: true 17 | ---@alias StackAutoSize boolean 18 | 19 | ---The stack view's optional child views. 20 | ---Views can later on also be added and removed dynamically after construction via 21 | ---`stack:add_view(child)` and `stack:remove_view(child)` 22 | ---@alias StackChildViews renoise.Views.View[] 23 | 24 | ---A Stack has no content on its own. It only *stacks* it's child views. 25 | ---The position of the child views in the stack can be freely set by using 26 | ---the `origin` property of the views. 27 | ---@class renoise.Views.Stack : renoise.Views.View 28 | ---@field autosize StackAutoSize 29 | ---@field background ViewBackgroundStyle 30 | local Stack = {} 31 | 32 | -------------------------------------------------------------------------------- 33 | 34 | ---@class StackViewProperties : ViewProperties 35 | ---@field autosize StackAutoSize? 36 | ---@field background ViewBackgroundStyle? 37 | ---@field mouse_handler MouseHandler? 38 | ---@field mouse_events MouseEventTypes? 39 | ---@field views StackChildViews? 40 | -------------------------------------------------------------------------------- /library/renoise/views/value.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.Value 11 | 12 | ---A static text view. Shows a string representation of a number and 13 | ---allows custom "number to string" conversion. 14 | ---@see renoise.Views.ValueField for a value text field that can be edited by the user. 15 | ---```text 16 | --- +---+-------+ 17 | --- | 12.1 dB | 18 | --- +---+-------+ 19 | ---``` 20 | ---@class renoise.Views.Value : renoise.Views.View 21 | ---@field value SliderNumberValue 22 | ---@field font TextFontStyle 23 | ---@field align TextAlignment 24 | local Value = {} 25 | 26 | ---### functions 27 | 28 | ---Add value change notifier 29 | ---@param notifier NumberValueNotifierFunction 30 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 31 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 32 | function Value:add_notifier(notifier) end 33 | 34 | ---Remove value change notifier 35 | ---@param notifier NumberValueNotifierFunction 36 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 37 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 38 | function Value:remove_notifier(notifier) end 39 | 40 | -------------------------------------------------------------------------------- 41 | 42 | ---@class ValueViewProperties : ViewProperties 43 | ---@field bind ViewNumberObservable? 44 | ---@field value SliderNumberValue? 45 | ---@field notifier NumberValueNotifier? 46 | ---@field align TextAlignment? 47 | ---@field font TextFontStyle? 48 | ---@field tostring ShowNumberAsString? 49 | -------------------------------------------------------------------------------- /library/renoise.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | -- ## renoise 11 | 12 | ---Holds all renoise related API functions and classes. 13 | ---@class renoise 14 | renoise = {} 15 | 16 | ---### constants 17 | 18 | ---Currently 6.2. Any changes in the API which are not backwards compatible, 19 | ---will increase the internal API's major version number (e.g. from 1.4 -> 2.0). 20 | ---All other backwards compatible changes, like new functionality, new functions 21 | ---and classes which do not break existing scripts, will increase only the minor 22 | ---version number (e.g. 1.0 -> 1.1). 23 | ---@type number 24 | renoise.API_VERSION = 6.2 25 | 26 | ---Renoise Version "Major.Minor.Revision[AlphaBetaRcVersion][Demo]" 27 | ---@type string 28 | renoise.RENOISE_VERSION = "Major.Minor.Revision[AlphaBetaRcVersion][Demo]" 29 | 30 | ---### functions 31 | 32 | ---Global access to the Renoise Application. 33 | ---@return renoise.Application 34 | function renoise.app() end 35 | 36 | ---Global access to the Renoise Song. 37 | --- 38 | ---NB: The song instance changes when a new song is loaded or created in Renoise, 39 | ---so tools can not memorize the song instance globally once, but must instead 40 | ---react on the application's `new_document_observable` 41 | ---observable. 42 | ---@return renoise.Song? 43 | function renoise.song() end 44 | 45 | ---Global access to the Renoise Scripting Tool (your XRNX tool). 46 | --- 47 | ---This is only valid when getting called from a tool and not when e.g. using the 48 | ---scripting terminal and editor in Renoise. 49 | ---@return renoise.ScriptingTool 50 | function renoise.tool() end 51 | -------------------------------------------------------------------------------- /library/renoise/views/popup.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | ------------------------------------------------------------------------------- 10 | 11 | ---A list of buttons labels to show in order 12 | ---The list can be empty, then "None" is displayed and the value won't change. 13 | ---@alias PopupItemLabels string[] 14 | 15 | -------------------------------------------------------------------------------- 16 | ---## renoise.Views.Popup 17 | 18 | ---A drop-down menu which shows the currently selected value when closed. 19 | ---When clicked, it pops up a list of all available items. 20 | ---```text 21 | --- +--------------++---+ 22 | --- | Current Item || ^ | 23 | --- +--------------++---+ 24 | ---``` 25 | ---@class renoise.Views.Popup : renoise.Views.Control 26 | ---@field items PopupItemLabels 27 | ---@field value SelectedItem 28 | local Popup = {} 29 | 30 | ---### functions 31 | 32 | ---Add index change notifier 33 | ---@param notifier IntegerValueNotifierFunction 34 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 35 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 36 | function Popup:add_notifier(notifier) end 37 | 38 | ---Remove index change notifier 39 | ---@param notifier IntegerValueNotifierFunction 40 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 41 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 42 | function Popup:remove_notifier(notifier) end 43 | 44 | -------------------------------------------------------------------------------- 45 | 46 | ---@class PopUpMenuProperties : ControlProperties 47 | ---@field bind ViewNumberObservable? 48 | ---@field value SelectedItem? 49 | ---@field notifier IntegerNotifier? 50 | ---@field items PopupItemLabels? 51 | -------------------------------------------------------------------------------- /library/renoise/views/checkbox.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---The current state of the checkbox, expressed as boolean. 12 | ---* Default: false 13 | ---@alias CheckBoxBoolean boolean 14 | 15 | ---A notifier for when the checkbox is toggled 16 | ---@alias CheckBoxBooleanNotifier BooleanValueNotifierFunction|BooleanValueNotifierMethod1|BooleanValueNotifierMethod2 17 | 18 | -------------------------------------------------------------------------------- 19 | ---## renoise.Views.CheckBox 20 | 21 | ---A single button with a checkbox bitmap, which can be used to toggle 22 | ---something on/off. 23 | ---```text 24 | --- +----+ 25 | --- | _/ | 26 | --- +----+ 27 | ---``` 28 | ---@class renoise.Views.CheckBox : renoise.Views.Control 29 | ---@field value CheckBoxBoolean 30 | local CheckBox = {} 31 | 32 | ---### functions 33 | 34 | ---Add value change notifier 35 | ---@param notifier BooleanValueNotifierFunction 36 | ---@overload fun(self, notifier: BooleanValueNotifierMethod1) 37 | ---@overload fun(self, notifier: BooleanValueNotifierMethod2) 38 | function CheckBox:add_notifier(notifier) end 39 | 40 | ---Remove value change notifier 41 | ---@param notifier BooleanValueNotifierFunction 42 | ---@overload fun(self, notifier: BooleanValueNotifierMethod1) 43 | ---@overload fun(self, notifier: BooleanValueNotifierMethod2) 44 | function CheckBox:remove_notifier(notifier) end 45 | 46 | -------------------------------------------------------------------------------- 47 | 48 | ---@class CheckBoxProperties : ControlProperties 49 | ---@field bind ViewBooleanObservable? 50 | ---@field value CheckBoxBoolean? 51 | ---@field notifier CheckBoxBooleanNotifier? 52 | -------------------------------------------------------------------------------- /library/renoise/views/valuefield.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.ValueField 11 | 12 | ---A text view, which shows a string representation of a number and allows 13 | ---custom "number to string" conversion. The value's text can be edited by the 14 | ---user. 15 | ---```lua 16 | --- +---+-------+ 17 | --- | 12.1 dB | 18 | --- +---+-------+ 19 | ---``` 20 | ---@class renoise.Views.ValueField : renoise.Views.Control 21 | ---@field min SliderMinValue 22 | ---@field max SliderMaxValue 23 | ---@field value SliderNumberValue 24 | ---@field align TextAlignment 25 | local ValueField = {} 26 | 27 | ---### functions 28 | 29 | ---Add value change notifier 30 | ---@param notifier NumberValueNotifierFunction 31 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 32 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 33 | function ValueField:add_notifier(notifier) end 34 | 35 | ---Remove value change notifier 36 | ---@param notifier NumberValueNotifierFunction 37 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 38 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 39 | function ValueField:remove_notifier(notifier) end 40 | 41 | -------------------------------------------------------------------------------- 42 | 43 | ---@class ValueFieldProperties : ControlProperties 44 | ---@field bind ViewNumberObservable? 45 | ---@field value SliderNumberValue? 46 | ---@field notifier NumberValueNotifier? 47 | ---@field min SliderMinValue? 48 | ---@field max SliderMaxValue? 49 | ---@field align TextAlignment? 50 | ---@field tostring PairedShowNumberAsString? 51 | ---@field tonumber PairedParseStringAsNumber? 52 | -------------------------------------------------------------------------------- /library/renoise/views/minislider.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.MiniSlider 11 | 12 | ---Same as a slider, but without arrow buttons and a really tiny height. Just 13 | ---like the slider, a mini slider can be horizontal or vertical. It will flip 14 | ---its orientation according to the set width and height. By default horizontal. 15 | ---```text 16 | --- --------[] 17 | ---``` 18 | ---@class renoise.Views.MiniSlider : renoise.Views.Control 19 | ---@field polarity SliderPolarity 20 | ---@field min SliderMinValue 21 | ---@field max SliderMaxValue 22 | ---@field default SliderDefaultValue 23 | ---@field value SliderNumberValue 24 | local MiniSlider = {} 25 | 26 | ---### functions 27 | 28 | ---Add value change notifier 29 | ---@param notifier NumberValueNotifierFunction 30 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 31 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 32 | function MiniSlider:add_notifier(notifier) end 33 | 34 | ---Remove value change notifier 35 | ---@param notifier NumberValueNotifierFunction 36 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 37 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 38 | function MiniSlider:remove_notifier(notifier) end 39 | 40 | -------------------------------------------------------------------------------- 41 | 42 | ---@class MiniSliderProperties : ControlProperties 43 | ---@field bind ViewNumberObservable? 44 | ---@field value SliderNumberValue? 45 | ---@field notifier NumberValueNotifier? 46 | ---@field polarity SliderPolarity? 47 | ---@field min SliderMinValue? 48 | ---@field max SliderMaxValue? 49 | ---@field default SliderDefaultValue? 50 | -------------------------------------------------------------------------------- /library/renoise/views/rotary.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.RotaryEncoder 11 | 12 | ---A slider which looks like a potentiometer. 13 | ---Note: when changing the size, the minimum of either width or height will be 14 | ---used to draw and control the rotary, therefore you should always set both 15 | ---equally when possible. 16 | ---```text 17 | --- +-+ 18 | --- / \ \ 19 | --- | o | 20 | --- \ | / 21 | --- +-+ 22 | ---``` 23 | ---@class renoise.Views.RotaryEncoder : renoise.Views.Control 24 | ---@field polarity SliderPolarity 25 | ---@field min SliderMinValue 26 | ---@field max SliderMaxValue 27 | ---@field default SliderDefaultValue 28 | ---@field value SliderNumberValue 29 | local RotaryEncoder = {} 30 | 31 | ---### functions 32 | 33 | ---Add value change notifier 34 | ---@param notifier NumberValueNotifierFunction 35 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 36 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 37 | function RotaryEncoder:add_notifier(notifier) end 38 | 39 | ---Remove value change notifier 40 | ---@param notifier NumberValueNotifierFunction 41 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 42 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 43 | function RotaryEncoder:remove_notifier(notifier) end 44 | 45 | -------------------------------------------------------------------------------- 46 | 47 | ---@class RotaryEncoderProperties : ControlProperties 48 | ---@field bind ViewNumberObservable? 49 | ---@field value SliderNumberValue? 50 | ---@field notifier NumberValueNotifier? 51 | ---@field polarity SliderPolarity? 52 | ---@field min SliderMinValue? 53 | ---@field max SliderMaxValue? 54 | ---@field default SliderDefaultValue? 55 | -------------------------------------------------------------------------------- /plugin.lua: -------------------------------------------------------------------------------- 1 | --- LuaLS plugin to add [Luabind class](https://luabind.sourceforge.net/docs.html#class_lua) support. 2 | --- Part of the [Renoise Lua API definitions](https://github.com/renoise/definitions). 3 | --- 4 | --- To use it in your workspace, set the LuaLS "Lua.runtime.plugin" to "PATH_TO_THIS/plugin.lua" 5 | --- See [LuaLS Settings](https://luals.github.io/wiki/settings/#runtimeplugin) 6 | 7 | local str_find = string.find 8 | local str_sub = string.sub 9 | local str_gmatch = string.gmatch 10 | 11 | print("RNS class plugin: loading...") 12 | 13 | function OnSetText(uri, text) 14 | -- print("RNS class plugin:", uri) 15 | 16 | -- ignore .vscode dir, extension files (i.e. natives), and other meta files 17 | if str_find(uri, "[\\/]%.vscode[\\/]") or str_sub(text, 1, 8) == "---@meta" then 18 | return 19 | end 20 | 21 | local diffs = {} 22 | 23 | -- add class annotation and global class table registration for luabind classes 24 | -- detects: 25 | -- class "SomeClass" 26 | -- class "SomeClass" (OptionalBaseClass) 27 | -- and then adds: 28 | -- ---@class SomeClass : OptionalBaseClass 29 | -- ---@overload fun(...:unknown?):SomeClass 30 | -- SomeClass = {} 31 | 32 | local class_match = "()(%-?%-?)[ \t]*class[ \t]*['\"]([^'^\"^\n]+)['\"]([^\n]*)\n" 33 | for pos, comments, class, rest in str_gmatch(text, class_match) do 34 | -- print("RNS class plugin:", pos, comments, class, rest) 35 | if comments == "" then 36 | local base_class = string.match(rest, "%s*%(([^%(^%)]+)%)") 37 | local class_def = base_class ~= nil 38 | and ("---@class %s : %s"):format(class, base_class) 39 | or ("---@class %s"):format(class) 40 | local constructor_def = ("---@overload fun(...:unknown?):%s"):format(class) 41 | local class_table_def = ("%s = {}"):format(class) 42 | table.insert(diffs, { 43 | start = pos, 44 | finish = pos - 1, 45 | text = ("%s\n%s\n%s"):format(class_def, constructor_def, class_table_def) 46 | }) 47 | end 48 | end 49 | 50 | return diffs 51 | end 52 | -------------------------------------------------------------------------------- /library/renoise/views/link.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | ----------------------------------------------------------------------------- 10 | ---## renoise.Views.TextLink 11 | 12 | ---Shows a text string which is highlighted when hovering with the mouse, 13 | ---and which can be clicked to perform some action. 14 | ---To create a hyperlink alike text, add a notifier which opens an url via: 15 | ---`renoise.app():open_url("https://some.url.com")` 16 | ---property. 17 | ---```text 18 | --- *Text, * 19 | ---``` 20 | ---@class renoise.Views.TextLink : renoise.Views.Text 21 | ---@field active ControlActive 22 | ---@field midi_mapping ControlMidiMappingString? 23 | local TextLink = {} 24 | 25 | ---### functions 26 | 27 | ---Add/remove text link hit/release notifier functions. 28 | ---@param notifier NotifierFunction 29 | ---@overload fun(self, notifier: NotifierMethod1) 30 | ---@overload fun(self, notifier: NotifierMethod2) 31 | function TextLink:add_pressed_notifier(notifier) end 32 | 33 | ---@param notifier NotifierFunction 34 | ---@overload fun(self, notifier: NotifierMethod1) 35 | ---@overload fun(self, notifier: NotifierMethod2) 36 | function TextLink:add_released_notifier(notifier) end 37 | 38 | ---@param notifier NotifierFunction 39 | ---@overload fun(self, notifier: NotifierMethod1) 40 | ---@overload fun(self, notifier: NotifierMethod2) 41 | function TextLink:remove_pressed_notifier(notifier) end 42 | 43 | ---@param notifier NotifierFunction 44 | ---@overload fun(self, notifier: NotifierMethod1) 45 | ---@overload fun(self, notifier: NotifierMethod2) 46 | function TextLink:remove_released_notifier(notifier) end 47 | 48 | ----------------------------------------------------------------------------- 49 | 50 | ---@class TextLinkViewProperties : TextViewProperties 51 | ---@field active ControlActive? 52 | ---@field midi_mapping ControlMidiMappingString? 53 | ---@field notifier ButtonNotifier? 54 | ---@field pressed ButtonNotifier? 55 | ---@field released ButtonNotifier? 56 | -------------------------------------------------------------------------------- /library/renoise/views/switch.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---A list of buttons labels to show in order. Must have more than one item. 12 | ---@alias ItemLabels string[] 13 | 14 | ---The currently selected item's index 15 | ---@alias SelectedItem integer 16 | 17 | ---Set up a notifier that will be called whenever a new item is picked 18 | ---@alias IntegerNotifier IntegerValueNotifierFunction|IntegerValueNotifierMethod1|IntegerValueNotifierMethod2 19 | 20 | -------------------------------------------------------------------------------- 21 | ---## renoise.Views.Switch 22 | 23 | ---A set of horizontally aligned buttons, where only one button can be enabled 24 | ---at the same time. Select one of multiple choices, indices. 25 | ---```text 26 | --- +-----------+------------+----------+ 27 | --- | Button A | +Button+B+ | Button C | 28 | --- +-----------+------------+----------+ 29 | ---``` 30 | ---@class renoise.Views.Switch : renoise.Views.Control 31 | ---@field items ItemLabels 32 | ---@field value SelectedItem 33 | local Switch = {} 34 | 35 | ---### functions 36 | 37 | ---Add index change notifier 38 | ---@param notifier IntegerValueNotifierFunction 39 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 40 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 41 | function Switch:add_notifier(notifier) end 42 | 43 | ---Remove index change notifier 44 | ---@param notifier IntegerValueNotifierFunction 45 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 46 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 47 | function Switch:remove_notifier(notifier) end 48 | 49 | -------------------------------------------------------------------------------- 50 | 51 | ---@class ButtonSwitchProperties : ControlProperties 52 | ---@field bind ViewNumberObservable? 53 | ---@field value SelectedItem? 54 | ---@field notifier IntegerNotifier? 55 | ---@field items ItemLabels? 56 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/midi_output.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.InstrumentMidiOutputProperties 11 | 12 | ---@class renoise.InstrumentMidiOutputProperties 13 | renoise.InstrumentMidiOutputProperties = {} 14 | 15 | ---### constants 16 | 17 | ---@enum renoise.InstrumentMidiOutputProperties.Type 18 | ---@diagnostic disable-next-line: missing-fields 19 | renoise.InstrumentMidiOutputProperties = { 20 | TYPE_EXTERNAL = 1, 21 | TYPE_LINE_IN_RET = 2, 22 | TYPE_INTERNAL = 3, -- REWIRE 23 | } 24 | 25 | ---### properties 26 | 27 | ---@class renoise.InstrumentMidiOutputProperties 28 | --- 29 | -- Note: ReWire device always start with "ReWire: " in the device_name and 30 | -- will always ignore the instrument_type and channel properties. MIDI 31 | -- channels are not configurable for ReWire MIDI, and instrument_type will 32 | -- always be "TYPE_INTERNAL" for ReWire devices. 33 | ---@field instrument_type renoise.InstrumentMidiOutputProperties.Type 34 | ---@field instrument_type_observable renoise.Document.Observable 35 | --- 36 | -- When setting new devices, device names must be one of: 37 | -- renoise.Midi.available_output_devices. 38 | -- Devices are automatically opened when needed. To close a device, set its name 39 | -- to "", e.g. an empty string. 40 | ---@field device_name string 41 | ---@field device_name_observable renoise.Document.Observable 42 | --- 43 | ---@field channel integer Range: (1 - 16) 44 | ---@field channel_observable renoise.Document.Observable 45 | --- 46 | ---@field transpose integer Range: (-120 - 120) 47 | ---@field transpose_observable renoise.Document.Observable 48 | --- 49 | ---@field program integer Range: (1 - 128) 0 = OFF 50 | ---@field program_observable renoise.Document.Observable 51 | --- 52 | ---@field bank integer Range: (1 - 65536) 0 = OFF 53 | ---@field bank_observable renoise.Document.Observable 54 | --- 55 | ---@field delay integer Range: (0 - 100) 56 | ---@field delay_observable renoise.Document.Observable 57 | --- 58 | ---@field duration integer Range: (1 - 8000) 8000 = INF 59 | ---@field duration_observable renoise.Document.Observable 60 | -------------------------------------------------------------------------------- /library/renoise/views/aligner.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | --------------------------------------------------------------------------------- 10 | 11 | ---* Default: "left" (for horizontal_aligner) "top" (for vertical_aligner) 12 | ---@alias AlignerMode 13 | ---| "left" # align from left to right (for horizontal_aligner only) 14 | ---| "right" # align from right to left (for horizontal_aligner only) 15 | ---| "top" # align from top to bottom (for vertical_aligner only) 16 | ---| "bottom" # align from bottom to top (for vertical_aligner only) 17 | ---| "center" # center all views 18 | ---| "justify" # keep outer views at the borders, distribute the rest 19 | ---| "distribute" # equally distributes views over the aligners width/height 20 | 21 | ---The aligner view's initial child views. 22 | ---Views can later on also be added and removed dynamically after construction via 23 | ---`aligner:add_view(child)` and `aligner:remove_view(child)` 24 | ---@alias AlignerChildViews renoise.Views.View[] 25 | 26 | --------------------------------------------------------------------------------- 27 | ---## renoise.Views.Aligner 28 | 29 | ---Just like a Rack, the Aligner shows no content on its own. It just aligns 30 | ---child views vertically or horizontally. As soon as children are added, the 31 | ---Aligner will expand itself to make sure that all children are visible 32 | ---(including spacing & margins). 33 | ---To make use of modes like "center", you manually have to setup a size that 34 | ---is bigger than the sum of the child sizes. 35 | --- 36 | ---@class renoise.Views.Aligner : renoise.Views.View 37 | ---@field margin RackMargin 38 | ---@field spacing RackSpacing 39 | ---@field mode AlignerMode 40 | ---@field background ViewBackgroundStyle 41 | local Aligner = {} 42 | 43 | --------------------------------------------------------------------------------- 44 | 45 | ---@class AlignerViewProperties : ViewProperties 46 | ---@field margin RackMargin? 47 | ---@field spacing RackSpacing? 48 | ---@field mode AlignerMode? 49 | ---@field background ViewBackgroundStyle? 50 | ---@field mouse_handler MouseHandler? 51 | ---@field mouse_events MouseEventTypes? 52 | ---@field views AlignerChildViews? 53 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/sample_device_chain.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.SampleDeviceChain 11 | 12 | ---@class renoise.SampleDeviceChain 13 | renoise.SampleDeviceChain = {} 14 | 15 | ---### properties 16 | 17 | ---@class renoise.SampleDeviceChain 18 | --- 19 | ---Name of the audio effect chain. 20 | ---@field name string 21 | ---@field name_observable renoise.Document.Observable 22 | --- 23 | ---**READ-ONLY** Allowed, available devices for 'insert_device_at'. 24 | ---@field available_devices string[] 25 | --- 26 | ---**READ-ONLY** Returns a list of tables containing more information about 27 | ---the devices. 28 | ---@see renoise.Track.available_device_infos 29 | ---@field available_device_infos AudioDeviceInfo[] 30 | --- 31 | ---**READ-ONLY** Device access. 32 | ---@field devices renoise.AudioDevice[] 33 | ---@field devices_observable renoise.Document.ObservableList 34 | --- 35 | ---**READ-ONLY** Output routing. 36 | ---@field available_output_routings string[] 37 | --- 38 | ---One of 'available_output_routings' 39 | ---@see renoise.SampleDeviceChain.available_output_routings 40 | ---@field output_routing string 41 | ---@field output_routing_observable renoise.Document.Observable 42 | 43 | ---### functions 44 | 45 | ---Insert a new device at the given position. "device_path" must be an available device 46 | ---@see renoise.SampleDeviceChain.available_devices 47 | ---@param device_path string 48 | ---@param index integer 49 | ---@return renoise.AudioDevice new_device 50 | function renoise.SampleDeviceChain:insert_device_at(device_path, index) end 51 | 52 | ---Delete an existing device from a chain. The mixer device at index 1 can not 53 | ---be deleted. 54 | ---@param index integer 55 | function renoise.SampleDeviceChain:delete_device_at(index) end 56 | 57 | ---Swap the positions of two devices in the device chain. The mixer device at 58 | ---index 1 can not be swapped or moved. 59 | ---@param index1 integer 60 | ---@param index2 integer 61 | function renoise.SampleDeviceChain:swap_devices_at(index1, index2) end 62 | 63 | ---Access to a single device in the chain. 64 | ---@param index integer 65 | ---@return renoise.AudioDevice 66 | function renoise.SampleDeviceChain:device(index) end 67 | -------------------------------------------------------------------------------- /library/renoise/views/rack.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | ------------------------------------------------------------------------------- 10 | 11 | ---Set the "borders" of a rack (left, right, top and bottom inclusively) 12 | ---* Default: 0 (no borders) 13 | ---@alias RackMargin integer 14 | 15 | ---Set the amount stacked child views are separated by (horizontally in 16 | ---rows, vertically in columns). 17 | ---* Default: 0 (no spacing) 18 | ---@alias RackSpacing integer 19 | 20 | ---When set to true, all child views in the rack are automatically resized to 21 | ---the max size of all child views (width in ViewBuilder.column, height in 22 | ---ViewBuilder.row). This can be useful to automatically align all sub 23 | ---columns/panels to the same size. Resizing is done automatically, as soon 24 | ---as a child view size changes or new children are added. 25 | ---* Default: false 26 | ---@alias RackUniformity boolean 27 | 28 | ---The rack view's initial child views. 29 | ---Views can later on also be added and removed dynamically after construction via 30 | ---`rack:add_view(child)` and `rack:remove_view(child)` 31 | ---@alias RackChildViews renoise.Views.View[] 32 | 33 | ------------------------------------------------------------------------------- 34 | ---## renoise.Views.Rack 35 | 36 | ---A Rack has no content on its own. It only stacks child views. Either 37 | ---vertically (ViewBuilder.column) or horizontally (ViewBuilder.row). It allows 38 | ---you to create view layouts. 39 | ---@class renoise.Views.Rack : renoise.Views.View 40 | ---@field margin RackMargin 41 | ---@field spacing RackSpacing 42 | ---@field background ViewBackgroundStyle 43 | ---@field uniform RackUniformity 44 | ---**Deprecated** Use `background` instead. 45 | ---@deprecated 46 | ---@field style ViewBackgroundStyle 47 | local Rack = {} 48 | 49 | ------------------------------------------------------------------------------- 50 | 51 | ---@class RackViewProperties : ViewProperties 52 | ---@field margin RackMargin? 53 | ---@field spacing RackSpacing? 54 | ---@field background ViewBackgroundStyle? 55 | ---@field uniform RackUniformity? 56 | ---@field mouse_handler MouseHandler? 57 | ---@field mouse_events MouseEventTypes? 58 | ---@field views RackChildViews? 59 | ---**Deprecated** Use `background` instead. 60 | ---@deprecated 61 | ---@field style ViewBackgroundStyle? 62 | -------------------------------------------------------------------------------- /library/renoise/views/textfield.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---When false, text is displayed but can not be entered/modified by the user. 12 | ---* Default: true 13 | ---@alias TextActive boolean 14 | 15 | ---The currently shown text. The text will not be updated when editing, 16 | ---rather only after editing is complete (return is pressed, or focus is lost). 17 | ---* Default: "" 18 | ---@alias TextValue string 19 | 20 | ---Exactly the same as "value"; provided for consistency. 21 | ---* Default: "" 22 | ---@alias TextValueAlias string 23 | 24 | ---True when the text field is focused. setting it at run-time programmatically 25 | ---will focus the text field or remove the focus (focus the dialog) accordingly. 26 | ---* Default: false 27 | ---@alias TextEditMode boolean 28 | 29 | ---Set up a notifier for text changes 30 | ---@alias StringChangeNotifier StringValueNotifierFunction|StringValueNotifierMethod1|StringValueNotifierMethod2 31 | 32 | -------------------------------------------------------------------------------- 33 | ---## renoise.Views.TextField 34 | 35 | ---Shows a text string that can be clicked and edited by the user. 36 | ---```text 37 | --- +----------------+ 38 | --- | Editable Te|xt | 39 | --- +----------------+ 40 | ---``` 41 | ---@class renoise.Views.TextField : renoise.Views.View 42 | ---@field active TextActive 43 | ---@field value TextValue 44 | ---@field text TextValueAlias 45 | ---@field align TextAlignment Only used when not editing. 46 | ---@field edit_mode TextEditMode 47 | local TextField = {} 48 | 49 | ---### functions 50 | 51 | ---Add value change (text change) notifier 52 | ---@param notifier StringValueNotifierFunction 53 | ---@overload fun(self, notifier: StringValueNotifierMethod1) 54 | ---@overload fun(self, notifier: StringValueNotifierMethod2) 55 | function TextField:add_notifier(notifier) end 56 | 57 | ---Remove value change (text change) notifier 58 | ---@param notifier StringValueNotifierFunction 59 | ---@overload fun(self, notifier: StringValueNotifierMethod1) 60 | ---@overload fun(self, notifier: StringValueNotifierMethod2) 61 | function TextField:remove_notifier(notifier) end 62 | 63 | -------------------------------------------------------------------------------- 64 | 65 | ---@class TextFieldProperties : ViewProperties 66 | ---@field bind ViewStringObservable? 67 | ---@field active TextActive? 68 | ---@field value TextValue? 69 | ---@field notifier StringChangeNotifier? 70 | ---@field text TextValueAlias? 71 | ---@field align TextAlignment? 72 | ---@field edit_mode TextEditMode? 73 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/macro.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.InstrumentMacro 11 | 12 | ---@class renoise.InstrumentMacro 13 | renoise.InstrumentMacro = {} 14 | 15 | ---### properties 16 | 17 | ---@class renoise.InstrumentMacro 18 | --- 19 | ---Macro name as visible in the GUI when mappings are presents. 20 | ---@field name string 21 | ---@field name_observable renoise.Document.Observable 22 | --- 23 | ---Macro value 24 | ---@field value number Range: (0 - 1) 25 | ---@field value_observable renoise.Document.Observable 26 | --- 27 | ---Macro value string 28 | ---@field value_string string Range: (0 - 100) 29 | ---@field value_string_observable renoise.Document.Observable 30 | --- 31 | ---**READ-ONLY** Macro mappings, target parameters 32 | ---@field mappings renoise.InstrumentMacroMapping[] 33 | ---@field mappings_observable renoise.Document.ObservableList 34 | 35 | ---### functions 36 | 37 | ---Access to a single attached parameter mapping by index. Use property 38 | ---'mappings' to query mapping count. 39 | ---@param index integer 40 | ---@return renoise.InstrumentMacroMapping 41 | function renoise.InstrumentMacro:mapping(index) end 42 | 43 | -------------------------------------------------------------------------------- 44 | ---## renoise.InstrumentMacroMapping 45 | 46 | ---@class renoise.InstrumentMacroMapping 47 | renoise.InstrumentMacroMapping = {} 48 | 49 | ---### constants 50 | 51 | ---@enum renoise.InstrumentMacroMapping.Scaling 52 | ---@diagnostic disable-next-line: missing-fields 53 | renoise.InstrumentMacroMapping = { 54 | SCALING_LOG_FAST = 1, 55 | SCALING_LOG_SLOW = 2, 56 | SCALING_LINEAR = 3, 57 | SCALING_EXP_SLOW = 4, 58 | SCALING_EXP_FAST = 5, 59 | } 60 | 61 | ---### properties 62 | 63 | ---@class renoise.InstrumentMacroMapping 64 | --- 65 | --- 66 | ---**READ-ONLY** Linked parameter. 67 | ---Can be a sample FX- or modulation parameter. Never nil. 68 | ---@field parameter renoise.DeviceParameter 69 | --- 70 | ---Min/max range in which the macro applies its value to the target parameter. 71 | ---Max can be < than Min. Mapping is then flipped. 72 | ---@field parameter_min number Range: (0 - 1) 73 | ---@field parameter_min_observable renoise.Document.Observable 74 | --- 75 | ---@field parameter_max number Range: (0 - 1) 76 | ---@field parameter_max_observable renoise.Document.Observable 77 | --- 78 | ---Scaling which gets applied within the min/max range to set the dest value. 79 | ---@field parameter_scaling renoise.InstrumentMacroMapping.Scaling 80 | ---@field parameter_scaling_observable renoise.Document.Observable 81 | -------------------------------------------------------------------------------- /library/renoise/views/multiline_textfield.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Views.MultiLineTextField 11 | 12 | ---Shows multiple text lines of text, auto-wrapping paragraphs into lines. The 13 | ---text can be edited by the user. 14 | ---```text 15 | --- +--------------------------+-+ 16 | --- | Editable Te|xt. |+| 17 | --- | | | 18 | --- | With multiple paragraphs | | 19 | --- | and auto-wrapping |+| 20 | --- +--------------------------+-+ 21 | ---``` 22 | ---@class renoise.Views.MultiLineTextField : renoise.Views.View 23 | ---@field active TextActive 24 | ---@field value TextMultilineString 25 | ---@field text TextValueAlias 26 | ---@field selected_text TextMultilineSelectedString 27 | ---@field paragraphs TextParagraphs 28 | ---@field font TextFontStyle 29 | ---@field style TextBackgroundStyle Default: "border" 30 | ---@field edit_mode TextEditMode 31 | local MultiLineTextField = {} 32 | 33 | ---### functions 34 | 35 | ---Add value change (text change) notifier 36 | ---@param notifier StringValueNotifierFunction 37 | ---@overload fun(self, notifier: StringValueNotifierMethod1) 38 | ---@overload fun(self, notifier: StringValueNotifierMethod2) 39 | function MultiLineTextField:add_notifier(notifier) end 40 | 41 | ---Remove value change (text change) notifier 42 | ---@param notifier StringValueNotifierFunction 43 | ---@overload fun(self, notifier: StringValueNotifierMethod1) 44 | ---@overload fun(self, notifier: StringValueNotifierMethod2) 45 | function MultiLineTextField:remove_notifier(notifier) end 46 | 47 | ---When a scroll bar is visible, scroll the text to show the last line. 48 | function MultiLineTextField:scroll_to_last_line() end 49 | 50 | ---When a scroll bar is visible, scroll the text to show the first line. 51 | function MultiLineTextField:scroll_to_first_line() end 52 | 53 | ---Append a new text to the existing text. Newline characters in the string will 54 | ---create new paragraphs, otherwise a single paragraph is appended. 55 | ---@param text string 56 | function MultiLineTextField:add_line(text) end 57 | 58 | ---Clear the whole text. 59 | function MultiLineTextField:clear() end 60 | 61 | -------------------------------------------------------------------------------- 62 | 63 | ---@class MultilineTextFieldProperties : ViewProperties 64 | ---@field bind ViewStringListObservable? 65 | ---@field active TextActive? 66 | ---@field value TextMultilineString? 67 | ---@field notifier StringChangeNotifier? 68 | ---@field text TextValueAlias? 69 | ---@field paragraphs TextParagraphs? 70 | ---@field font TextFontStyle? 71 | ---@field style TextBackgroundStyle? 72 | ---@field edit_mode TextEditMode? 73 | -------------------------------------------------------------------------------- /library/renoise/views/text.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | ----------------------------------------------------------------------------- 10 | 11 | ---The style that the text should be displayed with. 12 | ---@alias TextFontStyle 13 | ---| "normal" # (Default) 14 | ---| "big" # big text 15 | ---| "bold" # bold font 16 | ---| "italic" # italic font 17 | ---| "mono" # monospace font 18 | ---| "code" # monospace code font 19 | 20 | ---Get/set the color style the text should be displayed with. 21 | ---@alias TextStyle 22 | ---| "normal" # (Default) 23 | ---| "strong" # highlighted color 24 | ---| "disabled" # greyed out color 25 | ---| "custom" # custom color 26 | 27 | ---When set, the text will be drawn in the specified color. 28 | ---Set style to something else than "custom" or color to `{0, 0, 0}` 29 | ---to enable the default theme color for the text again. 30 | ---@alias TextColor RGBColor|ThemeColor 31 | 32 | ---Setup the text's alignment. Applies only when the view's size is larger than 33 | ---the needed size to draw the text 34 | ---@alias TextAlignment 35 | ---| "left" # (Default) 36 | ---| "right" # aligned to the right 37 | ---| "center" # center text 38 | 39 | ---Setup the texts's orientation (writing direction). 40 | ---@alias TextOrientation 41 | ---| "horizontal" # Draw from left to right (Default) 42 | ---| "horizontal-rl" # Draw from right to left 43 | ---| "vertical" # Draw from bottom to top 44 | ---| "vertical-tb" # Draw from top to bottom 45 | 46 | ---The text that should be displayed. Setting a new text will resize 47 | ---the view in order to make the text fully visible (expanding only). 48 | ---* Default: "" 49 | ---@alias TextSingleLineString string 50 | 51 | ----------------------------------------------------------------------------- 52 | ---## renoise.Views.Text 53 | 54 | ---Shows a "static" text string. Static just means that its not linked, bound 55 | ---to some value and has no notifiers. The text can not be edited by the user. 56 | ---Nevertheless you can of course change the text at run-time with the "text" 57 | ---property. 58 | ---```text 59 | --- Text, Bla 1 60 | ---``` 61 | ---@see renoise.Views.TextField for texts that can be edited by the user. 62 | ---@class renoise.Views.Text : renoise.Views.View 63 | ---@field text TextSingleLineString 64 | ---@field font TextFontStyle 65 | ---@field style TextStyle 66 | ---@field color TextColor 67 | ---@field orientation TextOrientation 68 | ---@field align TextAlignment 69 | local Text = {} 70 | 71 | ----------------------------------------------------------------------------- 72 | 73 | ---@class TextViewProperties : ViewProperties 74 | ---@field text TextSingleLineString? 75 | ---@field font TextFontStyle? 76 | ---@field style TextStyle? 77 | ---@field color TextColor? 78 | ---@field orientation TextOrientation? 79 | ---@field align TextAlignment? 80 | -------------------------------------------------------------------------------- /library/renoise/views/multiline_text.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---**READ-ONLY** The currently selected text, if any. 12 | ---Newlines (Windows, Mac or Unix styled) will use the unix newline format. 13 | ---@alias TextMultilineSelectedString string 14 | 15 | ---The text that should be displayed. 16 | ---Newlines (Windows, Mac or Unix styled) in the text can be used to create 17 | ---paragraphs. 18 | ---@alias TextMultilineString string 19 | 20 | ---A table of text lines to be used instead of specifying a single text 21 | ---line with newline characters like "text" 22 | ---* Default: [] 23 | ---@alias TextParagraphs string[] 24 | 25 | ---Setup the text view's background: 26 | ---@alias TextBackgroundStyle 27 | ---| "body" # simple text color with no background 28 | ---| "strong" # stronger text color with no background 29 | ---| "border" # text on a bordered background 30 | 31 | -------------------------------------------------------------------------------- 32 | ---## renoise.Views.MultiLineText 33 | 34 | ---Shows multiple lines of text, auto-formatting and auto-wrapping paragraphs 35 | ---into lines. Size is not automatically set. As soon as the text no longer fits 36 | ---into the view, a vertical scroll bar will be shown. 37 | --- 38 | ---@see renoise.Views.MultiLineTextField for multiline texts that can be edited 39 | ---by the user. 40 | ---```text 41 | --- +--------------+-+ 42 | --- | Text, Bla 1 |+| 43 | --- | Text, Bla 2 | | 44 | --- | Text, Bla 3 | | 45 | --- | Text, Bla 4 |+| 46 | --- +--------------+-+ 47 | ---``` 48 | ---@class renoise.Views.MultiLineText : renoise.Views.View 49 | ---@field text TextMultilineString 50 | ---@field selected_text TextMultilineSelectedString 51 | ---@field paragraphs TextParagraphs 52 | ---@field font TextFontStyle 53 | ---@field style TextBackgroundStyle Default: "body" 54 | local MultiLineText = {} 55 | 56 | ---### functions 57 | 58 | ---When a scroll bar is visible (needed), scroll the text to show the last line. 59 | function MultiLineText:scroll_to_last_line() end 60 | 61 | ---When a scroll bar is visible, scroll the text to show the first line. 62 | function MultiLineText:scroll_to_first_line() end 63 | 64 | ---Append text to the existing text. Newlines in the text will create new 65 | ---paragraphs, just like in the "text" property. 66 | ---@param text string 67 | function MultiLineText:add_line(text) end 68 | 69 | ---Clear the whole text, same as multiline_text.text="". 70 | function MultiLineText:clear() end 71 | 72 | -------------------------------------------------------------------------------- 73 | 74 | ---@class MultilineTextViewProperties : ViewProperties 75 | ---@field text TextMultilineString? 76 | ---@field paragraphs TextParagraphs? 77 | ---@field font TextFontStyle? 78 | ---@field style TextBackgroundStyle? 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Renoise 2 | 3 | ## LuaCATS definitions for the Renoise Lua API 4 | 5 | This is a [Renoise Tools API](https://github.com/renoise/xrnx) add-on for the [LuaLS Language Server](https://github.com/LuaLS/lua-language-server). 6 | 7 | 8 | LuaLS provides various features for Lua in code editors, such as autocompletion, type hovers, dynamic type checking, diagnostics and more via [LuaCATS](https://github.com/LuaCATS) annotations. 9 | 10 | ### HTML API Docs 11 | 12 | A pretty online API reference book based on this definition and general guide to scripting development in Renoise can be read here: [Renoise Scripting Development Book](https://renoise.github.io/xrnx) 13 | 14 | The scripting development book, latest API definition and example tools, can be downloaded as a "scripting starter pack" bundle file from the [XRNX Repository](https://github.com/renoise/xrnx/releases). 15 | 16 | ### Status 17 | 18 | The API definitions is usable as is is now, but still a work in progress. Please report bugs or improvements as issues here and/or create a merge request. 19 | 20 | #### Known issues 21 | 22 | * __eq, __lt, __le meta methods can't be annotated via LuaLS at the moment. 23 | They are specified in `### operators` as plain comments and should be converted as soon as LuaLS supports them. 24 | 25 | * __index meta methods currently can't be annotated via LuaLS. 26 | They are currently mentioned as @operator index, but won't be picked up by the language server and should be converted as soon as LuaLS supports them. 27 | 28 | * Return types for main class constructors (`renoise.app()`, `.tool()`, `.song()` etc.) should be specified as an instance to allow the LSP to warn when trying to access non-constant properties on the classes themselves (like `renoise.Song.selected_track`). 29 | 30 | * The LuaLS type system allows setting non-existent properties for constructor tables, which then causes runtime crash (for example `vb:text { margin = 100 }`), using [(exact)](https://luals.github.io/wiki/annotations/#class) for `@class` annotations doesn't help. 31 | 32 | ### Usage 33 | 34 | To use the definition in e.g. vscode, first install the **sumneko.lua vscode extension** as described here: 35 | https://luals.github.io/#vscode-install 36 | 37 | Then clone or download a copy of this repository, and configure your workspace to use the Renoise definition files: 38 | 39 | In your project's `/.vscode/settings.json` file, add: 40 | ```json 41 | { 42 | "Lua.workspace.library": ["PATH/TO/RENOISE_DEFINITION_FOLDER"], 43 | "Lua.runtime.plugin": "PATH/TO/RENOISE_DEFINITION_FOLDER/plugin.lua" 44 | } 45 | ``` 46 | 47 | Note: The `Lua.runtime.plugin` setting only is needed in order to automatically annotate the custom `class` keyword. 48 | 49 | See the [XRNX Development](https://renoise.github.io/xrnx/start/development.html) in the Renoise Scripting Book for more detailed information on how to install and use the definitions in vscode and other editors. 50 | 51 | 52 | ### Contribute 53 | 54 | Contributions are welcome! 55 | 56 | Please report issues [here](https://github.com/renoise/definitions/issues) or fork the latest git repository and create a feature or bugfix branch. 57 | -------------------------------------------------------------------------------- /library/renoise/views/slider.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---Value polarity of the control. Bipolar controls show the value from the 12 | ---center to left and right or up and down and typically controls a range 13 | ---around zero, e.g. -1 to 1. Unipolar controls show the value from left to 14 | ---right or bottom to top. 15 | ---* Default: "unipolar" 16 | ---@alias SliderPolarity "unipolar"|"bipolar" 17 | 18 | ---The minimum value that can be set using the view 19 | ---* Default: 0 20 | ---@alias SliderMinValue number 21 | 22 | ---The maximum value that can be set using the view 23 | ---* Default: 1.0 24 | ---@alias SliderMaxValue number 25 | 26 | ---The default value that will be re-applied on double-click 27 | ---@alias SliderDefaultValue number 28 | 29 | ---The current value of the view 30 | ---@alias SliderNumberValue number 31 | 32 | ---A table containing two numbers representing the step amounts for incrementing 33 | ---and decrementing by clicking the <> buttons. 34 | ---The first value is the small step (applied on left clicks) 35 | ---second value is the big step (applied on right clicks) 36 | ---@alias SliderStepAmounts {[1] : number, [2] : number} 37 | 38 | -------------------------------------------------------------------------------- 39 | ---## renoise.Views.Slider 40 | 41 | ---A slider with arrow buttons, which shows and allows editing of values in a 42 | ---custom range. A slider can be horizontal or vertical; will flip its 43 | ---orientation according to the set width and height. By default horizontal. 44 | ---```text 45 | --- +---+---------------+ 46 | --- |<|>| --------[] | 47 | --- +---+---------------+ 48 | ---``` 49 | ---@class renoise.Views.Slider : renoise.Views.Control 50 | ---@field polarity SliderPolarity 51 | ---@field min SliderMinValue 52 | ---@field max SliderMaxValue 53 | ---@field steps SliderStepAmounts 54 | ---@field default SliderDefaultValue 55 | ---@field value SliderNumberValue 56 | local Slider = {} 57 | 58 | ---### functions 59 | 60 | ---Add value change notifier 61 | ---@param notifier NumberValueNotifierFunction 62 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 63 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 64 | function Slider:add_notifier(notifier) end 65 | 66 | ---Remove value change notifier 67 | ---@param notifier NumberValueNotifierFunction 68 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 69 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 70 | function Slider:remove_notifier(notifier) end 71 | 72 | -------------------------------------------------------------------------------- 73 | 74 | ---@class SliderProperties : ControlProperties 75 | ---@field bind ViewNumberObservable? 76 | ---@field value SliderNumberValue? 77 | ---@field notifier NumberValueNotifier? 78 | ---@field polarity SliderPolarity? 79 | ---@field min SliderMinValue? 80 | ---@field max SliderMaxValue? 81 | ---@field steps SliderStepAmounts? 82 | ---@field default SliderDefaultValue? 83 | -------------------------------------------------------------------------------- /library/renoise/views/scrollbar.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---Default 0. Minimum offset value. 12 | ---@alias ScrollbarMin integer 13 | ---Default 100. Maximum offset value. 14 | ---@alias ScrollbarMax integer 15 | ---Default 0. Offset value in range `min to max - pagestep`. 16 | ---@alias ScrollbarValue integer 17 | 18 | ---Default 100. Size of the currently visible area. 19 | ---@alias ScrollbarPagestep integer 20 | 21 | ---Default 1. Amount the mouse-wheel or additional +/- buttons in the scroll bar 22 | ---move the scrollable area. 23 | ---@alias ScrollbarStep integer 24 | 25 | ---Default: false. When true, view gets automatically hidden when no scrolling is needed 26 | ---@alias ScrollbarAutoHide boolean 27 | 28 | -------------------------------------------------------------------------------- 29 | ---## renoise.Views.ScrollBar 30 | 31 | ---A special slider alike control to scroll through some content. 32 | --- 33 | ---`min` and `max` define to the scrollable area's range. `pagesize` is the 34 | ---currently visible area within that range and `value` is the offset from 35 | --`min` to `max - pagestep` within the whole scrollable area: 36 | --- 37 | ---```text 38 | ---min value max 39 | --- | [xxxxxxxxxxxxxx] | 40 | --- <---pagestep---> 41 | --- <---------scroll-area------------> 42 | ---``` 43 | --- 44 | ---Note that the *minimum offset value* is `min` and the *maximum offset 45 | ---value* is `max - pagestep`. 46 | --- 47 | ---A scrollbar can be horizontal or vertical. It will flip its orientation 48 | ---according to the set width and height. By default it's horizontal. 49 | ---@class renoise.Views.ScrollBar : renoise.Views.Control 50 | ---@field min ScrollbarMin 51 | ---@field max ScrollbarMax 52 | ---@field value ScrollbarValue 53 | ---@field step ScrollbarStep 54 | ---@field pagestep ScrollbarPagestep 55 | ---@field background ViewBackgroundStyle 56 | ---@field autohide ScrollbarAutoHide 57 | local ScrollBar = {} 58 | 59 | ---### functions 60 | 61 | ---Add offset value change notifier 62 | ---@param notifier IntegerValueNotifierFunction 63 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 64 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 65 | function ScrollBar:add_notifier(notifier) end 66 | 67 | ---Remove offset value change notifier 68 | ---@param notifier IntegerValueNotifierFunction 69 | ---@overload fun(self, notifier: IntegerValueNotifierMethod1) 70 | ---@overload fun(self, notifier: IntegerValueNotifierMethod2) 71 | function ScrollBar:remove_notifier(notifier) end 72 | 73 | -------------------------------------------------------------------------------- 74 | 75 | ---@class ScrollBarProperties : ControlProperties 76 | ---@field bind ViewNumberObservable? 77 | ---@field value ScrollbarValue? 78 | ---@field notifier NumberValueNotifier? 79 | ---@field min ScrollbarMin? 80 | ---@field max ScrollbarMax? 81 | ---@field step ScrollbarStep? 82 | ---@field pagestep ScrollbarPagestep? 83 | ---@field background ViewBackgroundStyle? 84 | ---@field autohide ScrollbarAutoHide? 85 | -------------------------------------------------------------------------------- /library/renoise/views/valuebox.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---The minimum value that can be set using the view 12 | ---* Default: 0 13 | ---@alias ValueBoxMinValue number 14 | ---The maximum value that can be set using the view 15 | ---* Default: 100 16 | ---@alias ValueBoxMaxValue number 17 | 18 | ---Set a custom rule on how a number value should be displayed. 19 | ---Useful for showing units like decibel or note values etc. 20 | ---If none are set, a default string/number conversion is done, which 21 | ---simply shows the number with 3 digits after the decimal point. 22 | ---Note: When the callback fails with an error, it will be disabled to avoid 23 | ---a flood of error messages. 24 | ---@alias ShowNumberAsString fun(value : number) : string? 25 | 26 | ---Make sure to also set `tonumber` if you set this. 27 | ---@alias PairedShowNumberAsString ShowNumberAsString 28 | 29 | ---Set a custom function to parse a number value from a user-provided string. 30 | ---When returning nil, no conversion will be done and the value will not change. 31 | ---Note: When the callback fails with an error, it will be disabled to avoid 32 | ---a flood of error messages. 33 | ---@alias ParseStringAsNumber fun(value : string) : number? 34 | 35 | ---Make sure to also set `tostring` if you set this. 36 | ---@alias PairedParseStringAsNumber fun(value : string) : number? 37 | 38 | ---Set up a value notifier that will be called whenever the value changes 39 | ---@alias NumberValueNotifier NumberValueNotifierFunction|NumberValueNotifierMethod1|NumberValueNotifierMethod2 40 | 41 | -------------------------------------------------------------------------------- 42 | ---## renoise.Views.ValueBox 43 | 44 | ---A box with arrow buttons and a text field that can be edited by the user. 45 | ---Allows showing and editing natural numbers in a custom range. 46 | ---```text 47 | --- +---+-------+ 48 | --- |<|>| 12 | 49 | --- +---+-------+ 50 | ---``` 51 | ---@class renoise.Views.ValueBox : renoise.Views.Control 52 | ---@field min ValueBoxMinValue 53 | ---@field max ValueBoxMaxValue 54 | ---@field steps SliderStepAmounts 55 | ---@field value SliderNumberValue 56 | local ValueBox = {} 57 | 58 | ---### functions 59 | 60 | ---Add value change notifier 61 | ---@param notifier NumberValueNotifierFunction 62 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 63 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 64 | function ValueBox:add_notifier(notifier) end 65 | 66 | ---Remove value change notifier 67 | ---@param notifier NumberValueNotifierFunction 68 | ---@overload fun(self, notifier: NumberValueNotifierMethod1) 69 | ---@overload fun(self, notifier: NumberValueNotifierMethod2) 70 | function ValueBox:remove_notifier(notifier) end 71 | 72 | -------------------------------------------------------------------------------- 73 | 74 | ---@class ValueBoxProperties : ControlProperties 75 | ---@field bind ViewNumberObservable? 76 | ---@field value SliderNumberValue? 77 | ---@field notifier NumberValueNotifier? 78 | ---@field min ValueBoxMinValue? 79 | ---@field max ValueBoxMaxValue? 80 | ---@field steps SliderStepAmounts? 81 | ---@field tostring PairedShowNumberAsString? 82 | ---@field tonumber PairedParseStringAsNumber? 83 | -------------------------------------------------------------------------------- /library/renoise/views/control.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---Instead of making a control invisible, you can also make it inactive. 12 | ---Deactivated controls will still be shown, and will still show their 13 | ---currently assigned values, but will not allow changes. Most controls will 14 | ---display as "grayed out" to visualize the deactivated state. 15 | ---@alias ControlActive boolean 16 | 17 | ---When set, the control will be highlighted when Renoise's MIDI mapping dialog 18 | ---is open. When clicked, it selects the specified string as a MIDI mapping 19 | ---target action. This target acton can either be one of the globally available 20 | ---mappings in Renoise, or those that were created by the tool itself. 21 | ---Target strings are not verified. When they point to nothing, the mapped MIDI 22 | ---message will do nothing and no error is fired. 23 | ---@alias ControlMidiMappingString string 24 | 25 | -------------------------------------------------------------------------------- 26 | 27 | ---Bind the view's value to a renoise.Document.ObservableBoolean object. 28 | ---Automatically keep them in sync. 29 | ---The view will change the Observable value as soon as its value changes 30 | ---and change the view's value as soon as the Observable's value changes. 31 | ---Notifiers can be added to either the view or the Observable object. 32 | ---@alias ViewBooleanObservable renoise.Document.ObservableBoolean 33 | 34 | ---Bind the view's value to a renoise.Document.ObservableNumber object. 35 | ---Automatically keep them in sync. 36 | ---The view will change the Observable value as soon as its value changes 37 | ---and change the view's value as soon as the Observable's value changes. 38 | ---Notifiers can be added to either the view or the Observable object. 39 | ---@alias ViewNumberObservable renoise.Document.ObservableNumber 40 | 41 | ---Bind the view's value to a renoise.Document.ObservableString object. 42 | ---Automatically keep them in sync. 43 | ---The view will change the Observable value as soon as its value changes 44 | ---and change the view's value as soon as the Observable's value changes. 45 | ---Notifiers can be added to either the view or the Observable object. 46 | ---@alias ViewStringObservable renoise.Document.ObservableString 47 | 48 | ---Bind the view's value to a renoise.Document.ObservableStringList object. 49 | ---Automatically keep them in sync. 50 | ---The view will change the Observable value as soon as its value changes 51 | ---and change the view's value as soon as the Observable's value changes. 52 | ---Notifiers can be added to either the view or the Observable object. 53 | ---@alias ViewStringListObservable renoise.Document.ObservableStringList 54 | 55 | -------------------------------------------------------------------------------- 56 | ---## renoise.Views.Control 57 | 58 | ---Control is the base class for all views which let the user change a value or 59 | ---some "state" from the UI. 60 | ---@class renoise.Views.Control : renoise.Views.View 61 | ---@field active ControlActive 62 | ---@field midi_mapping ControlMidiMappingString 63 | local Control = {} 64 | 65 | -------------------------------------------------------------------------------- 66 | 67 | ---@class ControlProperties : ViewProperties 68 | ---@field active ControlActive? 69 | ---@field midi_mapping ControlMidiMappingString? 70 | -------------------------------------------------------------------------------- /library/renoise/song/pattern/track.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.PatternTrack 11 | 12 | ---@class renoise.PatternTrack 13 | renoise.PatternTrack = {} 14 | 15 | ---### properties 16 | 17 | ---@class renoise.PatternTrack 18 | --- 19 | ---Ghosting (aliases) 20 | ---@field is_alias boolean **READ-ONLY** 21 | --- 22 | ---Pattern index the pattern track is aliased or 0 when its not aliased. 23 | ---@field alias_pattern_index integer index or 0 when no alias is present 24 | ---@field alias_pattern_index_observable renoise.Document.Observable 25 | ---- 26 | ---@field color RGBColor? slot color of the pattern in the matrix, nil when no slot color is set 27 | ---@field color_observable renoise.Document.Observable 28 | --- 29 | ---Returns true when all the track lines are empty. Does not look at automation. 30 | ---@field is_empty boolean 31 | ---@field is_empty_observable renoise.Document.Observable 32 | --- 33 | ---**READ-ONLY** Get all lines in range [1, number_of_lines_in_pattern]. 34 | ---Use `renoise.Pattern:add/remove_line_notifier` for change notifications. 35 | ---@field lines renoise.PatternLine[] 36 | --- 37 | ---Automation. 38 | ---@field automation renoise.PatternTrackAutomation[] 39 | ---@field automation_observable renoise.Document.ObservableList 40 | 41 | ---### functions 42 | 43 | ---Deletes all lines & automation. 44 | function renoise.PatternTrack:clear() end 45 | 46 | ---Copy contents from other pattern tracks, including automation when possible. 47 | ---@param other renoise.PatternTrack 48 | function renoise.PatternTrack:copy_from(other) end 49 | 50 | ---Access to a single line by index. Line must be in Range: (1 - MAX_NUMBER_OF_LINES). 51 | ---This is a !lot! more efficient than calling the property: lines[index] to 52 | ---randomly access lines. 53 | ---@param index integer 54 | ---@return renoise.PatternLine 55 | function renoise.PatternTrack:line(index) end 56 | 57 | ---Get a specific line range. Index must be Range: (1 - Pattern.MAX_NUMBER_OF_LINES) 58 | ---@param index_from integer 59 | ---@param index_to integer 60 | ---@return renoise.PatternLine[] 61 | function renoise.PatternTrack:lines_in_range(index_from, index_to) end 62 | 63 | ---Returns the automation for the given device parameter or nil when there is 64 | ---none. 65 | ---@param parameter renoise.DeviceParameter 66 | ---@return renoise.PatternTrackAutomation? 67 | function renoise.PatternTrack:find_automation(parameter) end 68 | 69 | ---Creates a new automation for the given device parameter. 70 | ---Fires an error when an automation for the given parameter already exists. 71 | ---Returns the newly created automation. Passed parameter must be automatable, 72 | ---which can be tested with 'parameter.is_automatable'. 73 | ---@param parameter renoise.DeviceParameter 74 | ---@return renoise.PatternTrackAutomation 75 | function renoise.PatternTrack:create_automation(parameter) end 76 | 77 | ---Remove an existing automation the given device parameter. Automation 78 | ---must exist. 79 | ---@param parameter renoise.DeviceParameter 80 | function renoise.PatternTrack:delete_automation(parameter) end 81 | 82 | ---### operators 83 | 84 | ---Compares line content and automation. All other properties are ignored. 85 | ---operator==(pattern_track, pattern_track): boolean 86 | ---operator~=(pattern_track, pattern_trac): boolean 87 | 88 | -------------------------------------------------------------------------------- 89 | ---### renoise.PatternTrackLine 90 | 91 | ---**Deprecated** Use `renoise.PatternLine` instead. 92 | ---@deprecated 93 | ---@alias renoise.PatternTrackLine renoise.PatternLine 94 | -------------------------------------------------------------------------------- /library/renoise/views/xypad.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---A table of the XYPad's current values on each axis 12 | ---@alias XYPadValues { x : SliderNumberValue, y : SliderNumberValue } 13 | 14 | ---A table of allowed minimum values for each axis 15 | ---* Default: {x: 0.0, y: 0.0} 16 | ---@alias XYPadMinValues { x : SliderMinValue, y : SliderMinValue } 17 | 18 | ---A table of allowed maximum values for each axis 19 | ---* Default: {x: 1.0, y: 1.0} 20 | ---@alias XYPadMaxValues { x : SliderMaxValue, y : SliderMaxValue } 21 | 22 | ---A table of snapback values for each axis 23 | ---When snapback is enabled, the pad will revert its values to the specified 24 | ---snapback values as soon as the mouse button is released in the pad. 25 | ---When disabled, releasing the mouse button will not change the value. 26 | ---You can disable snapback at runtime by setting it to nil or an empty table. 27 | ---@alias XYPadSnapbackValues { x : number, y : number } 28 | 29 | ---@alias XYValueNotifierFunction fun(value: XYPadValues) 30 | ---@alias XYValueNotifierMemberFunction fun(self: NotifierMemberContext, value: XYPadValues) 31 | ---@alias XYValueNotifierMethod1 {[1]:NotifierMemberContext, [2]:XYValueNotifierMemberFunction} 32 | ---@alias XYValueNotifierMethod2 {[1]:XYValueNotifierMemberFunction, [2]:NotifierMemberContext} 33 | 34 | ---Set up a value notifier function that will be used whenever the pad's values change 35 | ---@alias XYValueNotifier XYValueNotifierFunction|XYValueNotifierMethod1|XYValueNotifierMethod2 36 | --- 37 | ---Bind the view's value to a pair of renoise.Document.ObservableNumber objects. 38 | ---Automatically keep both values in sync. 39 | ---Will change the Observables' values as soon as the view's value changes, 40 | ---and change the view's values as soon as the Observable's value changes. 41 | ---Notifiers can be added to either the view or the Observable object. 42 | ---Just like in the other XYPad properties, a table with the fields X and Y 43 | ---is expected here and not a single value. So you have to bind two 44 | ---ObservableNumber object to the pad. 45 | ---@alias XYPadObservables { x: renoise.Document.ObservableNumber, y: renoise.Document.ObservableNumber } 46 | 47 | -------------------------------------------------------------------------------- 48 | ---## renoise.Views.XYPad 49 | 50 | ---A slider like pad which allows for controlling two values at once. By default 51 | ---it freely moves the XY values, but it can also be configured to snap back to 52 | ---a predefined value when releasing the mouse button. 53 | --- 54 | ---All values, notifiers, current value or min/max properties will act just 55 | ---like a slider or a rotary's properties, but nstead of a single number, a 56 | ---table with the fields `{x = xvalue, y = yvalue}` is expected, returned. 57 | ---```text 58 | --- +-------+ 59 | --- | o | 60 | --- | + | 61 | --- | | 62 | --- +-------+ 63 | ---``` 64 | ---@class renoise.Views.XYPad : renoise.Views.Control 65 | ---@field min XYPadMinValues 66 | ---@field max XYPadMaxValues 67 | ---@field value XYPadValues 68 | ---@field snapback XYPadSnapbackValues? 69 | local XYPad = {} 70 | 71 | ---### functions 72 | 73 | ---Add value change notifier 74 | ---@param notifier XYValueNotifierFunction 75 | ---@overload fun(self, notifier: XYValueNotifierMethod1) 76 | ---@overload fun(self, notifier: XYValueNotifierMethod2) 77 | function XYPad:add_notifier(notifier) end 78 | 79 | ---Remove value change notifier 80 | ---@param notifier XYValueNotifierFunction 81 | ---@overload fun(self, notifier: XYValueNotifierMethod1) 82 | ---@overload fun(self, notifier: XYValueNotifierMethod2) 83 | function XYPad:remove_notifier(notifier) end 84 | 85 | -------------------------------------------------------------------------------- 86 | 87 | ---@class XYPadProperties : ControlProperties 88 | ---@field bind XYPadObservables? 89 | ---@field value XYPadValues? 90 | ---@field snapback XYPadSnapbackValues? 91 | ---@field notifier XYValueNotifier? 92 | ---@field min XYPadMinValues? 93 | ---@field max XYPadMaxValues? 94 | -------------------------------------------------------------------------------- /library/renoise/views/bitmap.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---Setup how the bitmap should be drawn, recolored. Available modes are: 12 | ---@alias BitmapMode 13 | ---| "plain" # bitmap is drawn as is, no recoloring is done (Default) 14 | ---| "transparent" # same as plain, but black pixels will be fully transparent 15 | ---| "button_color" # recolor the bitmap, using the theme's button color 16 | ---| "body_color" # same as 'button_back' but with body text/back color 17 | ---| "main_color" # same as 'button_back' but with main text/back colors 18 | ---| "custom_color" # Recolor the bitmap using a custom color set by the `color' 19 | --- property. Use bitmaps with an alpha channel, such as PNG 20 | --- bitmaps, for custom colored bitmaps. 21 | 22 | ---You can load an image from your tool's directory, 23 | ---or use one from Renoise's built-in icons. 24 | ---* For the built-in icons, use "Icons/ArrowRight.bmp" 25 | ---* For custom images, use a path relative to your tool's root folder. 26 | --- 27 | ---For example "Images/MyBitmap.bmp" will load the image from 28 | ---"com.me.MyTool.xrnx/Images/MyBitmap.bmp". 29 | ---If your custom path matches a built-in icon's (like "Icons/ArrowRight.bmp"), 30 | ---your image will be loaded instead of the one from Renoise. 31 | --- 32 | ---If you want to support high DPI UI scaling with your bitmaps like the 33 | ---built-in Icons, include high resolution versions with their filenames ending 34 | ---with "@4x" 35 | ---The following rules will be used when loading bitmaps 36 | ---* When UI scaling is 100%, only the base bitmaps are used. 37 | ---* When UI scaling is 125%, the base bitmaps are used, except if there is a 38 | ---` BitmapName@x1.25.bmp` variant. 39 | ---* For all other UI scaling > 125% the "@4x" variants are used and 40 | --- downscaled as needed, except when there is an exact match for the current 41 | --- UI scaling factor (e.g. `BitmapName@1.5x.bmp` for 150%) 42 | ---@alias BitmapImagePath string 43 | 44 | ---Supported bitmap file formats are *.bmp, *.png or *.tif (no transparency). 45 | ---@alias BitmapPath BitmapImagePath 46 | 47 | ---When set, the bitmap will be drawn in the specified color and `mode` is set 48 | ---to `custom_color`. Set `mode` to something else than `custom_color` or the 49 | ---`color` to `{0, 0, 0}` to enable a `plain` display mode. 50 | ---@alias BitmapColor RGBColor|ThemeColor 51 | 52 | ---A click notifier 53 | ---@alias ButtonNotifier NotifierFunction|NotifierMethod1|NotifierMethod2 54 | 55 | -------------------------------------------------------------------------------- 56 | ---## renoise.Views.Bitmap 57 | 58 | ---Draws a bitmap, or a draws a bitmap which acts like a button (as soon as a 59 | ---notifier is specified). The notifier is called when clicking the mouse 60 | ---somewhere on the bitmap. When using a re-colorable style (see 'mode'), the 61 | ---bitmap is automatically recolored to match the current theme's colors. Mouse 62 | ---hover is also enabled when notifiers are present, to show that the bitmap can 63 | ---be clicked. 64 | ---```text 65 | --- * 66 | --- *** 67 | --- + * 68 | --- / \ 69 | --- +---+ 70 | --- | O | o 71 | --- +---+ | 72 | --- |||||||||||| 73 | ---``` 74 | ---@class renoise.Views.Bitmap : renoise.Views.Control 75 | ---@field mode BitmapMode 76 | ---@field color BitmapColor 77 | ---@field bitmap BitmapPath 78 | local Bitmap = {} 79 | 80 | ---### functions 81 | 82 | ---Add mouse click notifier 83 | ---@param notifier NotifierFunction 84 | ---@overload fun(self, notifier: NotifierMethod1) 85 | ---@overload fun(self, notifier: NotifierMethod2) 86 | function Bitmap:add_notifier(notifier) end 87 | 88 | ---Remove mouse click notifier 89 | ---@param notifier NotifierFunction 90 | ---@overload fun(self, notifier: NotifierMethod1) 91 | ---@overload fun(self, notifier: NotifierMethod2) 92 | function Bitmap:remove_notifier(notifier) end 93 | 94 | -------------------------------------------------------------------------------- 95 | 96 | ---@class BitmapViewProperties : ControlProperties 97 | ---@field mode BitmapMode? 98 | ---@field color BitmapColor? 99 | ---@field bitmap BitmapPath? 100 | ---@field notifier ButtonNotifier? 101 | -------------------------------------------------------------------------------- /library/renoise/views/button.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---The text label of the button 12 | ---* Default: "" 13 | ---@alias ButtonLabel string 14 | 15 | ---If set, existing text is removed and the loaded image is displayed instead. 16 | ---Supported bitmap file formats are ".bmp", ".png" and ".tiff". 17 | ---Colors in bitmaps will be overridden by the button's theme color, using black 18 | ---as the transparent color for BMPs and TIFFS, and the alpha channel for PNGs. 19 | ---All other colors are mapped to the theme color according to their grey value, 20 | ---so plain white is the target theme color, and all other colors blend into the 21 | ---button's background color of the theme. 22 | ---@alias ButtonBitmapPath BitmapImagePath 23 | 24 | ---Setup the buttons text's or bitmap's alignment within the button. 25 | ---@alias ButtonAlignment 26 | ---| "left" # aligned to the left 27 | ---| "right" # aligned to the right 28 | ---| "center" # center (default) 29 | 30 | ---When set, the unpressed button's background will be drawn in the specified color. 31 | ---A text color is automatically selected unless explicitly set, to make sure its 32 | ---always visible. 33 | ---Set color {0,0,0} to enable the theme colors for the button again. 34 | ---@alias ButtonColor RGBColor|ThemeColor 35 | 36 | ---When set, the unpressed button's background text or bitmap will be drawn in the 37 | ---specified color. 38 | ---Set color {0,0,0} to enable the theme colors for the button again. 39 | ---@alias ButtonSecondaryColor RGBColor|ThemeColor 40 | 41 | ---Get/set the style a button should be displayed with. 42 | ---@alias ButtonStyle 43 | ---| "normal" # (Default) 44 | ---| "rounded" # rounded corners on all sides 45 | ---| "rounded_left" # rounded left side 46 | ---| "rounded_right" # rounded right side 47 | ---| "rounded_top" # rounded left side 48 | ---| "rounded_bottom" # rounded right side 49 | 50 | -------------------------------------------------------------------------------- 51 | ---## renoise.Views.Button 52 | 53 | ---A simple button that calls a custom notifier function when clicked. 54 | ---Supports text or bitmap labels. 55 | ---```text 56 | --- +--------+ 57 | --- | Button | 58 | --- +--------+ 59 | ---``` 60 | ---@class renoise.Views.Button : renoise.Views.Control 61 | ---@field text ButtonLabel 62 | ---@field bitmap ButtonBitmapPath 63 | ---@field align ButtonAlignment 64 | ---@field font TextFontStyle 65 | ---@field color ButtonColor 66 | ---@field secondary_color ButtonSecondaryColor 67 | ---@field style ButtonStyle 68 | local Button = {} 69 | 70 | ---### functions 71 | 72 | ---Add/remove button hit/release notifier functions. 73 | ---When a "pressed" notifier is set, the release notifier is guaranteed to be 74 | ---called as soon as the mouse is released, either over your button or anywhere 75 | ---else. When a "release" notifier is set, it is only called when the mouse 76 | ---button is pressed !and! released over your button. 77 | ---@param notifier NotifierFunction 78 | ---@overload fun(self, notifier: NotifierMethod1) 79 | ---@overload fun(self, notifier: NotifierMethod2) 80 | function Button:add_pressed_notifier(notifier) end 81 | 82 | ---@param notifier NotifierFunction 83 | ---@overload fun(self, notifier: NotifierMethod1) 84 | ---@overload fun(self, notifier: NotifierMethod2) 85 | function Button:add_released_notifier(notifier) end 86 | 87 | ---@param notifier NotifierFunction 88 | ---@overload fun(self, notifier: NotifierMethod1) 89 | ---@overload fun(self, notifier: NotifierMethod2) 90 | function Button:remove_pressed_notifier(notifier) end 91 | 92 | ---@param notifier NotifierFunction 93 | ---@overload fun(self, notifier: NotifierMethod1) 94 | ---@overload fun(self, notifier: NotifierMethod2) 95 | function Button:remove_released_notifier(notifier) end 96 | 97 | -------------------------------------------------------------------------------- 98 | 99 | ---@class ButtonProperties : ControlProperties 100 | ---@field text ButtonLabel? 101 | ---@field bitmap ButtonBitmapPath? 102 | ---@field align ButtonAlignment? 103 | ---@field font TextFontStyle? 104 | ---@field color ButtonColor? 105 | ---@field secondary_color ButtonColor? 106 | ---@field style ButtonStyle? 107 | ---@field notifier ButtonNotifier? 108 | ---@field pressed ButtonNotifier? 109 | ---@field released ButtonNotifier? 110 | -------------------------------------------------------------------------------- /library/renoise/osc.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | ---Have a look at http://opensoundcontrol.org for general info about OSC. 9 | --- 10 | ---For some small examples on how to use the OSC and Sockets API, have a 11 | ---look at the code snippets in the Renoise Documentation "Snippets/Osc.lua". 12 | --- 13 | 14 | -------------------------------------------------------------------------------- 15 | ---## renoise.Osc 16 | 17 | ---OSC (Open Sound Control) support for Lua scripts in Renoise. 18 | ---@class renoise.Osc 19 | renoise.Osc = {} 20 | 21 | ---De-packetizing raw (socket) data to OSC messages or bundles: 22 | ---Converts the binary data to an OSC message or bundle. If the data does not 23 | ---look like an OSC message, or the message contains errors, nil is returned 24 | ---as first argument and the second return value will contain the error. 25 | ---If de-packetizing was successful, either a renoise.Osc.Bundle or Message 26 | ---object is returned. Bundles may contain multiple messages or nested bundles. 27 | ---@param binary_data string 28 | ---@return (renoise.Osc.Bundle|renoise.Osc.Message)?, string? 29 | function renoise.Osc.from_binary_data(binary_data) end 30 | 31 | -------------------------------------------------------------------------------- 32 | ---## renoise.Osc.Message 33 | 34 | ---@class renoise.Osc.Message 35 | --- 36 | ---**READ-ONLY** The message pattern (e.g. "/renoise/transport/start") 37 | ---@field pattern string 38 | --- 39 | ---**READ-ONLY** Table of `{tag="X", value=SomeValue}` that represents the 40 | ---message arguments. See `renoise.Osc.Message.create` for more info. 41 | ---@field arguments OscValue[] 42 | --- 43 | ---**READ-ONLY** Raw binary representation of the message, as needed when e.g. 44 | ---sending the message over the network through sockets. 45 | ---@field binary_data string 46 | renoise.Osc.Message = {} 47 | 48 | ---### functions 49 | 50 | ---@alias OscTag 51 | ---| "i" # int32 52 | ---| "f" # float32 53 | ---| "s" # OSC-string 54 | ---| "b" # OSC-blob (raw string) 55 | ---| "h" # 64 bit big-endian two's complement integer 56 | ---| "t" # OSC-timetag 57 | ---| "d" # 64 bit ("double") IEEE 754 floating point number 58 | ---| "S" # Alternate type represented as an OSC-string 59 | ---| "c" # An ascii character, sent as 32 bits 60 | ---| "r" # 32 bit RGBA color 61 | ---| "m" # 4 byte MIDI message. Bytes from MSB to LSB are: port id, status byte, data1, data2 62 | ---| "T" # True. No value needs to be specified. 63 | ---| "F" # False. No value needs to be specified. 64 | ---| "N" # Nil. No value needs to be specified. 65 | ---| "I" # Infinitum. No value needs to be specified. 66 | -- -| "[" "]" # Indicates the beginning, end of an array. (currently not supported) 67 | 68 | 69 | ---`tag` is a standard OSC type tag. `value` is the arguments value expressed 70 | ---by a Lua type. The value must be convertible to the specified tag, which 71 | ---means, you cannot for example specify an "i" (integer) as type and then pass 72 | ---a string as the value. Use a number value instead. Not all tags require a 73 | ---value, like the T,F boolean tags. Then a `value` field should not be 74 | ---specified. For more info, see: http://opensoundcontrol.org/spec-1_0 75 | ---@class OscValue 76 | ---@field tag OscTag 77 | ---@field value (number|string|boolean)? 78 | 79 | ---Create a new OSC message with the given pattern and optional arguments. 80 | ---@param pattern string 81 | ---@param arguments OscValue[]? 82 | ---@return renoise.Osc.Message 83 | function renoise.Osc.Message(pattern, arguments) end 84 | 85 | -------------------------------------------------------------------------------- 86 | ---## renoise.Osc.Bundle 87 | 88 | ---@class renoise.Osc.Bundle 89 | --- 90 | ---**READ-ONLY** Time value of the bundle. 91 | ---@field timetag number 92 | --- 93 | ---**READ-ONLY** Access to the bundle elements (table of messages or bundles) 94 | ---@field elements (renoise.Osc.Message|renoise.Osc.Bundle)[] 95 | --- 96 | -- **READ-ONLY** Raw binary representation of the bundle, as needed when e.g. 97 | ---sending the message over the network through sockets. 98 | ---@field binary_data string 99 | renoise.Osc.Bundle = {} 100 | 101 | ---Create a new bundle by specifying a time-tag and one or more messages. 102 | ---If you do not know what to do with the time-tag, use `os.clock()`, 103 | ---which simply means "now". Messages must be renoise.Osc.Message objects. 104 | ---Nested bundles (bundles in bundles) are right now not supported. 105 | ---@param time integer 106 | ---@param arguments renoise.Osc.Message|renoise.Osc.Message[] 107 | ---@return renoise.Osc.Bundle 108 | function renoise.Osc.Bundle(time, arguments) end 109 | -------------------------------------------------------------------------------- /library/renoise/song/pattern.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Pattern 11 | 12 | ---@class renoise.Pattern 13 | renoise.Pattern = {} 14 | 15 | ---### constants 16 | 17 | ---Maximum number of lines that can be present in a pattern. 18 | renoise.Pattern.MAX_NUMBER_OF_LINES = 512 19 | 20 | ---### properties 21 | 22 | ---@class renoise.Pattern 23 | --- 24 | ---Quickly check if any track in a pattern has some non empty pattern lines. 25 | ---This does not look at track automation. 26 | ---@field is_empty boolean 27 | --- 28 | ---Name of the pattern, as visible in the pattern sequencer. 29 | ---@field name string 30 | ---@field name_observable renoise.Document.Observable 31 | --- 32 | ---Number of lines the pattern currently has. 64 by default. Max is 33 | ---renoise.Pattern.MAX_NUMBER_OF_LINES, min is 1. 34 | ---@field number_of_lines integer 35 | ---@field number_of_lines_observable renoise.Document.Observable 36 | --- 37 | ---**READ-ONLY** Access to the pattern tracks. Each pattern has 38 | ---#renoise.song().tracks amount of tracks. 39 | ---@field tracks renoise.PatternTrack[] 40 | 41 | ---### functions 42 | 43 | ---Deletes all lines & automation. 44 | function renoise.Pattern:clear() end 45 | 46 | ---Copy contents from other patterns, including automation, when possible. 47 | ---@param other renoise.Pattern 48 | function renoise.Pattern:copy_from(other) end 49 | 50 | ---Access to a single pattern track by index. Use properties 'tracks' to 51 | ---iterate over all tracks and to query the track count. 52 | ---@param index integer 53 | ---@return renoise.PatternTrack 54 | function renoise.Pattern:track(index) end 55 | 56 | ---@alias PatternLineChangeCallback fun(pos: PatternLinePosition) 57 | ---@alias PatternLineChangeCallbackWithContext fun(obj: table|userdata, pos: PatternLinePosition) 58 | 59 | ---Check/add/remove notifier functions or methods, which are called by Renoise 60 | ---as soon as any of the pattern's lines have changed. 61 | ---The notifiers are called as soon as a new line is added, an existing line 62 | ---is cleared, or existing lines are somehow changed (notes, effects, anything) 63 | -- 64 | ---A single argument is passed to the notifier function: "pos", a table with the 65 | ---fields "pattern", "track" and "line", which defines where the change has 66 | ---happened. 67 | --- 68 | ---### examples: 69 | ---```lua 70 | ---function my_pattern_line_notifier(pos) 71 | --- -- check pos.pattern, pos.track, pos.line (all are indices) 72 | ---end 73 | ---``` 74 | ---Please be gentle with these notifiers, don't do too much stuff in there. 75 | ---Ideally just set a flag like "pattern_dirty" which then gets picked up by 76 | ---an app_idle notifier: The danger here is that line change notifiers can 77 | ---be called hundreds of times when, for example, simply clearing a pattern. 78 | -- 79 | ---If you are only interested in changes that are made to the currently edited 80 | ---pattern, dynamically attach and detach to the selected pattern's line 81 | ---notifiers by listening to "renoise.song().selected_pattern_observable". 82 | ---@param func PatternLineChangeCallbackWithContext 83 | ---@param obj table|userdata 84 | ---@return boolean 85 | ---@overload fun(self, func: PatternLineChangeCallback): boolean 86 | function renoise.Pattern:has_line_notifier(func, obj) end 87 | 88 | ---@param func PatternLineChangeCallbackWithContext 89 | ---@param obj table|userdata 90 | ---@overload fun(self, func: PatternLineChangeCallback): boolean 91 | function renoise.Pattern:add_line_notifier(func, obj) end 92 | 93 | ---@param func PatternLineChangeCallbackWithContext 94 | ---@param obj table|userdata 95 | ---@overload fun(self, func: PatternLineChangeCallback): boolean 96 | function renoise.Pattern:remove_line_notifier(func, obj) end 97 | 98 | ---Same as `line_notifier`, but the notifier only fires when the user 99 | ---added, changed or deleted a line with the computer or MIDI keyboard. 100 | ---@param func PatternLineChangeCallbackWithContext 101 | ---@param obj table|userdata 102 | ---@overload fun(self, func: PatternLineChangeCallback): boolean 103 | ---@return boolean 104 | function renoise.Pattern:has_line_edited_notifier(func, obj) end 105 | 106 | ---@param func PatternLineChangeCallbackWithContext 107 | ---@param obj table|userdata 108 | ---@overload fun(self, func: PatternLineChangeCallback): boolean 109 | function renoise.Pattern:add_line_edited_notifier(func, obj) end 110 | 111 | ---@param func PatternLineChangeCallbackWithContext 112 | ---@param obj table|userdata 113 | ---@overload fun(self, func: PatternLineChangeCallback): boolean 114 | function renoise.Pattern:remove_line_edited_notifier(func, obj) end 115 | 116 | ---### operators 117 | 118 | ---Compares all tracks and lines, including automation. 119 | ---operator==(pattern, pattern): boolean 120 | ---operator~=(pattern, pattern): boolean 121 | -------------------------------------------------------------------------------- /library/renoise/song/pattern/automation.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.PatternTrackAutomation 11 | 12 | ---Graphical automation of a device parameter within a pattern track. 13 | --- 14 | ---General remarks: Automation "time" is specified in lines + optional 1/256 15 | ---line fraction for the sub line grid. The sub line grid has 256 units per 16 | ---line. All times are internally quantized to this sub line grid. 17 | ---For example a time of 1.5 means: line 1 with a note column delay of 128 18 | ---@class renoise.PatternTrackAutomation 19 | renoise.PatternTrackAutomation = {} 20 | 21 | ---### constants 22 | 23 | ---@enum renoise.PatternTrackAutomation.Playmode 24 | ---@diagnostic disable-next-line: missing-fields 25 | renoise.PatternTrackAutomation = { 26 | PLAYMODE_POINTS = 1, 27 | PLAYMODE_LINES = 2, 28 | PLAYMODE_CURVES = 3 29 | } 30 | 31 | ---### properties 32 | 33 | ---Single point within a pattern track automation envelope. 34 | ---@class EnvelopePoint 35 | ---Automation point's time in pattern lines in Range: (1 - NUM_LINES_IN_PATTERN). 36 | ---@field time integer 37 | ---Automation point value in Range: (0 - 1.0) 38 | ---@field value number 39 | ---Automation point scaling. Used in 'lines' playback mode only - 0.0 is linear. 40 | ---@field scaling number 41 | 42 | ---@class renoise.PatternTrackAutomation 43 | --- 44 | ---Destination device. Can in some rare circumstances be nil, i.e. when 45 | ---a device or track is about to be deleted. 46 | ---@field dest_device renoise.AudioDevice? 47 | --- 48 | ---Destination device's parameter. Can in some rare circumstances be nil, 49 | ---i.e. when a device or track is about to be deleted. 50 | ---@field dest_parameter renoise.DeviceParameter? 51 | --- 52 | ---play-mode (interpolation mode). 53 | ---@field playmode renoise.PatternTrackAutomation.Playmode 54 | ---@field playmode_observable renoise.Document.Observable 55 | --- 56 | ---**READ-ONLY** Max length (time in lines) of the automation. 57 | ---Will always fit the patterns length. 58 | ---@field length integer Range: (1 - NUM_LINES_IN_PATTERN) 59 | --- 60 | ---Selection range as visible in the automation editor. always valid. 61 | ---returns the automation range no selection is present in the UI. 62 | ---@field selection_start integer Range: (1 - automation.length + 1) 63 | ---@field selection_start_observable renoise.Document.Observable 64 | ---@field selection_end integer Range: (1 - automation.length + 1) 65 | ---@field selection_end_observable renoise.Document.Observable 66 | --- 67 | ---Get or set selection range. when setting an empty table, the existing 68 | ---selection, if any, will be cleared. 69 | ---array of two numbers [] OR Range: (1 - automation.length + 1) 70 | ---@field selection_range integer[] 71 | ---@field selection_range_observable renoise.Document.Observable 72 | --- 73 | ---Get all points of the automation. When setting a new list of points, 74 | ---items may be unsorted by time, but there may not be multiple points 75 | ---for the same time. Returns a copy of the list, so changing 76 | ---`points[1].value` will not do anything. Instead, change them via 77 | ---`points = { modified_points }`. 78 | ---@field points EnvelopePoint[] 79 | ---@field points_observable renoise.Document.ObservableList 80 | 81 | ---### functions 82 | 83 | ---Removes all points from the automation. Will not delete the automation 84 | ---from tracks[]:automation, instead the resulting automation will not do 85 | ---anything at all. 86 | function renoise.PatternTrackAutomation:clear() end 87 | 88 | ---Remove all existing points in the given [from, to) time range from the 89 | ---automation. 90 | ---@param from_time integer 91 | ---@param to_time integer 92 | function renoise.PatternTrackAutomation:clear_range(from_time, to_time) end 93 | 94 | ---Copy all points and playback settings from another track automation. 95 | ---@param other renoise.PatternTrackAutomation 96 | function renoise.PatternTrackAutomation:copy_from(other) end 97 | 98 | ---Test if a point exists at the given time 99 | ---@param time integer lines 100 | ---@return boolean 101 | function renoise.PatternTrackAutomation:has_point_at(time) end 102 | 103 | ---Insert a new point, or change an existing one, if a point in 104 | ---time already exists. 105 | ---@param time integer 106 | ---@param value number 107 | ---@param scaling number? 108 | function renoise.PatternTrackAutomation:add_point_at(time, value, scaling) end 109 | 110 | ---Removes a point at the given time. Point must exist. 111 | ---@param time integer 112 | function renoise.PatternTrackAutomation:remove_point_at(time) end 113 | 114 | ---### operators 115 | 116 | ---Compares automation content only, ignoring dest parameters. 117 | ---operator==(pattern_automation, pattern_automation): boolean 118 | ---operator~=(pattern_automation, pattern_automation): boolean 119 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/phrase_script.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## RenderScriptOptions 11 | 12 | ---Options for the render functions. All undefined properties will fall back to the 13 | ---user preferences values from the script preview 14 | ---@class RenderScriptOptions 15 | ---Lines per beat of the target phrase. 16 | ---@field lpb number? 17 | ---Maximum events (not pattern lines) that will be rendered 18 | ---@field max_events number? 19 | 20 | -------------------------------------------------------------------------------- 21 | ---## renoise.InstrumentPhraseScript 22 | 23 | ---@class renoise.InstrumentPhraseScript 24 | renoise.InstrumentPhraseScript = {} 25 | 26 | ---### properties 27 | 28 | ---@class renoise.InstrumentPhraseScript 29 | --- 30 | ---When false, a preview of the script is shown instead of a text editor. 31 | ---@field editor_visible boolean 32 | ---fired, when the editor visibility changed. 33 | ---@field editor_visible_observable renoise.Document.Observable 34 | --- 35 | --- **READ-ONLY** List of script input parameters, if any. 36 | ---@field parameters renoise.DeviceParameter[] 37 | ---fired, when the input parameter set changed. 38 | ---@field parameters_observable renoise.Document.ObservableList 39 | --- 40 | ---Script content. When changing paragraphs, changes are visible in the 41 | ---script editor, but are not applied for playback until they get committed. 42 | ---See also @function `commit` and @field `committed_observable`. 43 | ---@field paragraphs string[] 44 | ---Notifier which is called when a paragraph got added or removed. 45 | ---@field paragraphs_observable renoise.Document.DocumentList 46 | ---Notifier which is called when existing paragraph content changed. 47 | ---@field paragraphs_assignment_observable renoise.Document.Observable 48 | --- 49 | ---**READ-ONLY** When not empty, the script failed to compile. 50 | ---This error text is also visible to the user in the script preview. 51 | ---@field compile_error string 52 | ---@field compile_error_observable renoise.Document.Observable 53 | ---**READ-ONLY** When not empty, script compiled successfully, but caused an 54 | ---error while running. This error text is also visible to the user in the 55 | ---script editor. 56 | ---@field runtime_error string 57 | ---@field runtime_error_observable renoise.Document.Observable 58 | --- 59 | ---**READ-ONLY** Number of changes since the last commit() or auto-commit call, 60 | ---that have been applied to the parapgraphs. 61 | ---Note: `auto-commit` only is applied for scripts which are currently edited. 62 | ---@field pending_changes integer 63 | ---@field pending_changes_observable renoise.Document.Observable 64 | --- 65 | ---Fired when script paragraph changes got committed: Either by an explicit 66 | ---`commit` call or via `auto-commit` in the editor when the script currently is 67 | ---edited. Script compile errors will be set or cleared *after* the observable 68 | ---fires as the commit & compilation happens asynchroniously in the player engine. 69 | ---@field committed_observable renoise.Document.Observable 70 | 71 | ---### functions 72 | 73 | ---Access to a single input parameter by index. Use properties 'parameters' 74 | ---to iterate over all parameters and to query the parameter count. 75 | ---@param index integer 76 | ---@return renoise.DeviceParameter 77 | function renoise.InstrumentPhraseScript:parameter(index) end 78 | 79 | ---Commit paragraph changes for playback. 80 | function renoise.InstrumentPhraseScript:commit() end 81 | 82 | ---@alias RenderingDoneCallback fun(error: string?, rendered_events: integer, skipped_events: integer) 83 | 84 | ---Render script content with the given options to the phrase pattern. 85 | ---Only committed content will be rendered, so make sure to commit changes first. 86 | ---Parameter `rendering_done_callback` is called with the results: 87 | --- * `error`: nil when the rendering succeeded, otherwise a string describing the error 88 | --- * `rendered_events`: number of successfully rendered raw events (not pattern lines) or 0 89 | --- * `skipped_events`: number of skipped raw events, in case the pattern couldn't fit all events, or 0 90 | ---@param options RenderScriptOptions 91 | ---@param rendering_done_callback RenderingDoneCallback 92 | ---@overload fun(self, rendering_done_callback: RenderingDoneCallback): boolean, string? 93 | function renoise.InstrumentPhraseScript:render_to_pattern(options, rendering_done_callback) end 94 | 95 | ---Same as `render_to_pattern`, but rendering into a temporary phrase object in the clipboard, 96 | ---which can then be pasted by the user somewhere. 97 | ---@param options RenderScriptOptions 98 | ---@param rendering_done_callback RenderingDoneCallback 99 | ---@overload fun(self, rendering_done_callback: RenderingDoneCallback): boolean, string? 100 | function renoise.InstrumentPhraseScript:render_to_clipboard(options, rendering_done_callback) end 101 | -------------------------------------------------------------------------------- /library/renoise/song/device.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.AudioDevice 11 | 12 | ---Audio DSP device in tracks or sample device chains. 13 | ---@class renoise.AudioDevice 14 | renoise.AudioDevice = {} 15 | 16 | ---### properties 17 | 18 | ---@class renoise.AudioDevice 19 | --- 20 | ---Fixed name of the device. 21 | ---@field name string **READ-ONLY** 22 | ---@field short_name string **READ-ONLY** 23 | --- 24 | ---Configurable device display name. When empty `name` is displayed. 25 | ---@field display_name string 26 | ---@field display_name_observable renoise.Document.Observable 27 | --- 28 | ---Enable/bypass the device. 29 | ---@field is_active boolean !active = bypassed 30 | ---@field is_active_observable renoise.Document.Observable 31 | --- 32 | ---Maximize state in DSP chain. 33 | ---@field is_maximized boolean 34 | ---@field is_maximized_observable renoise.Document.Observable 35 | --- 36 | ---Preset handling. 37 | ---@field active_preset integer 0 when none is active or available 38 | ---@field active_preset_observable renoise.Document.Observable 39 | ---@field active_preset_data string raw serialized data in XML format of the active preset 40 | ---@field presets string[] **READ-ONLY** preset names 41 | --- 42 | ---Parameters. 43 | ---@field is_active_parameter renoise.DeviceParameter **READ-ONLY** 44 | ---@field parameters renoise.DeviceParameter[] **READ-ONLY** 45 | --- 46 | ---**READ-ONLY** Returns whether or not the device provides its own custom GUI 47 | ---(only available for some plugin devices) 48 | ---@field external_editor_available boolean 49 | --- 50 | ---When the device has no custom GUI an error will be fired (see 51 | ---external_editor_available), otherwise the external editor is opened/closed. 52 | ---@field external_editor_visible boolean true to show the editor, false to close it 53 | --- 54 | ---**READ-ONLY** Returns a string that uniquely identifies the device, from 55 | ---`available_devices`. The string can be passed into: 56 | ---`renoise.song().tracks[]:insert_device_at()` 57 | ---@field device_path string 58 | 59 | ---### functions 60 | 61 | ---Access to a single preset name by index. Use properties 'presets' to iterate 62 | ---over all presets and to query the presets count. 63 | ---comment 64 | ---@param index integer 65 | ---@return string preset_name 66 | function renoise.AudioDevice:preset(index) end 67 | 68 | ---Access to a single parameter by index. Use properties 'parameters' to iterate 69 | ---over all parameters and to query the parameter count. 70 | ---@param index integer 71 | ---@return renoise.DeviceParameter 72 | function renoise.AudioDevice:parameter(index) end 73 | 74 | -------------------------------------------------------------------------------- 75 | ---## renoise.DeviceParameter 76 | 77 | ---A single parameter within an audio DSP effect (renoise.AudioDevice) 78 | ---@class renoise.DeviceParameter 79 | renoise.DeviceParameter = {} 80 | 81 | ---### constants 82 | 83 | ---@enum renoise.DeviceParameter.Polarity 84 | ---@diagnostic disable-next-line: missing-fields 85 | renoise.DeviceParameter = { 86 | POLARITY_UNIPOLAR = 1, 87 | POLARITY_BIPOLAR = 2 88 | } 89 | 90 | ---### properties 91 | 92 | ---@class renoise.DeviceParameter 93 | --- 94 | ---Device parameters. 95 | ---@field name string **READ-ONLY** 96 | ---@field name_observable renoise.Document.ObservableString 97 | -- 98 | ---@field polarity renoise.DeviceParameter.Polarity **READ-ONLY** 99 | --- 100 | ---@field value_min number **READ-ONLY** 101 | ---@field value_max number **READ-ONLY** 102 | ---@field value_quantum number **READ-ONLY** 103 | ---@field value_default number **READ-ONLY** 104 | --- 105 | ---The minimum interval in pattern lines (as a number) at which a parameter can 106 | ---have automation points. It is 1/256 for most parameters, but 1 for e.g. song 107 | ---tempo, LPB and TPL which can only be automated once per pattern line. 108 | ---@field time_quantum number **READ-ONLY** 109 | --- 110 | ---Not valid for parameters of instrument devices. Returns true if creating 111 | ---envelope automation is possible for the parameter (see also 112 | ---renoise.song().patterns[].tracks[]:create_automation) 113 | ---@field is_automatable boolean **READ-ONLY** 114 | --- 115 | ---**READ-ONLY** Is automated. Not valid for parameters of instrument devices. 116 | ---@field is_automated boolean 117 | ---@field is_automated_observable renoise.Document.Observable 118 | --- 119 | ---**READ-ONLY** Parameter has a custom MIDI mapping in the current song. 120 | ---@field is_midi_mapped boolean 121 | ---@field is_midi_mapped_observable renoise.Document.Observable 122 | --- 123 | ---Show in mixer. Not valid for parameters of instrument devices. 124 | ---@field show_in_mixer boolean 125 | ---@field show_in_mixer_observable renoise.Document.Observable 126 | --- 127 | ---Values. 128 | ---@field value number value in Range: (value_min - value_max) 129 | ---@field value_observable renoise.Document.Observable 130 | --- 131 | ---@field value_string string 132 | ---@field value_string_observable renoise.Document.Observable 133 | 134 | ---### functions 135 | 136 | ---Set a new value and write automation when the MIDI mapping 137 | ---"record to automation" option is set. Only works for parameters 138 | ---of track devices, not for instrument devices. 139 | ---@param value number 140 | function renoise.DeviceParameter:record_value(value) end 141 | -------------------------------------------------------------------------------- /library/renoise/application/theme.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---A table of 3 bytes (ranging from 0 to 255) 12 | ---representing the red, green and blue channels of a color. 13 | ---{0xFF, 0xFF, 0xFF} is white 14 | ---{165, 73, 35} is the red from the Renoise logo 15 | ---@alias RGBColor {[1] : integer, [2] : integer, [3] : integer} 16 | 17 | ---A table of 4 bytes (ranging from 0 to 255) 18 | ---representing the red, green, blue, alpha channels of a color. 19 | ---{0xFF, 0xFF, 0xFF, 0xFF} is white 20 | ---{165, 73, 35, 0x80} is the red from the Renoise logo, half opaque. 21 | ---@alias RGBAColor {[1] : integer, [2] : integer, [3] : integer, [4]: integer} 22 | 23 | -------------------------------------------------------------------------------- 24 | --- ## renoise.ApplicationTheme 25 | 26 | ---Application's theme colors and other general color theme properties. 27 | --- 28 | ---Note: All properties and functions of the app theme are **read-only**, so the 29 | ---theme can't be modified here. Use the app's `renoise.Application:load_theme` 30 | ---function to load and apply new themes instead. 31 | --- 32 | ---Accessing colors and theme properties can be useful in custom viewbuilder 33 | ---widgets. 34 | ---@class renoise.ApplicationTheme 35 | renoise.ApplicationTheme = {} 36 | 37 | ---The application theme's colors 38 | ---@alias ThemeColor 39 | ---|"main_back" 40 | ---|"main_font" 41 | ---|"alternate_main_back" 42 | ---|"alternate_main_font" 43 | ---|"body_back" 44 | ---|"body_font" 45 | ---|"strong_body_font" 46 | ---|"button_back" 47 | ---|"button_font" 48 | ---|"button_highlight_font" 49 | ---|"selected_button_back" 50 | ---|"selected_button_font" 51 | ---|"selection_back" 52 | ---|"selection_font" 53 | ---|"standby_selection_back" 54 | ---|"standby_selection_font" 55 | ---|"midi_mapping_back" 56 | ---|"midi_mapping_font" 57 | ---|"tooltip_back" 58 | ---|"tooltip_font" 59 | ---|"valuebox_back" 60 | ---|"valuebox_font" 61 | ---|"valuebox_font_icons" 62 | ---|"scrollbar" 63 | ---|"slider" 64 | ---|"folder" 65 | ---|"pattern_default_back" 66 | ---|"pattern_default_font" 67 | ---|"pattern_default_font_volume" 68 | ---|"pattern_default_font_panning" 69 | ---|"pattern_default_font_pitch" 70 | ---|"pattern_default_font_delay" 71 | ---|"pattern_default_font_global" 72 | ---|"pattern_default_font_other" 73 | ---|"pattern_default_font_dspfx" 74 | ---|"pattern_default_font_unused" 75 | ---|"pattern_highlighted_back" 76 | ---|"pattern_highlighted_font" 77 | ---|"pattern_highlighted_font_volume" 78 | ---|"pattern_highlighted_font_panning" 79 | ---|"pattern_highlighted_font_pitch" 80 | ---|"pattern_highlighted_font_delay" 81 | ---|"pattern_highlighted_font_global" 82 | ---|"pattern_highlighted_font_other" 83 | ---|"pattern_highlighted_font_dspfx" 84 | ---|"pattern_highlighted_font_unused" 85 | ---|"pattern_playposition_back" 86 | ---|"pattern_playposition_font" 87 | ---|"pattern_centerbar_back" 88 | ---|"pattern_centerbar_font" 89 | ---|"pattern_centerbar_back_standby" 90 | ---|"pattern_centerbar_font_standby" 91 | ---|"pattern_selection" 92 | ---|"pattern_standby_selection" 93 | ---|"pattern_mute_state" 94 | ---|"automation_grid" 95 | ---|"automation_line_edge" 96 | ---|"automation_line_fill" 97 | ---|"automation_point" 98 | ---|"automation_marker_play" 99 | ---|"automation_marker_single" 100 | ---|"automation_marker_pair" 101 | ---|"automation_marker_diamond" 102 | ---|"vumeter_meter" 103 | ---|"vumeter_meter_low" 104 | ---|"vumeter_meter_middle" 105 | ---|"vumeter_meter_high" 106 | ---|"vumeter_peak" 107 | ---|"vumeter_back_normal" 108 | ---|"vumeter_back_clipped" 109 | ---|"default_color_01" 110 | ---|"default_color_02" 111 | ---|"default_color_03" 112 | ---|"default_color_04" 113 | ---|"default_color_05" 114 | ---|"default_color_06" 115 | ---|"default_color_07" 116 | ---|"default_color_08" 117 | ---|"default_color_09" 118 | ---|"default_color_10" 119 | ---|"default_color_11" 120 | ---|"default_color_12" 121 | ---|"default_color_13" 122 | ---|"default_color_14" 123 | ---|"default_color_15" 124 | ---|"default_color_16" 125 | 126 | ---### properties 127 | 128 | ---@class renoise.ApplicationTheme 129 | --- 130 | ---**READ-ONLY** Get all theme colors in a flat list of RGBColors. 131 | ---Color table keys are string identifiers as used in the theme XML file, 132 | ---but in lower case. 133 | --- 134 | ---Note that if you only need to access a single color from the theme, 135 | ---use `renoise.app().theme.color(color_name)` instead. 136 | --- 137 | ---To get notified of color changes, use `renoise.app().theme_observable` 138 | ---@field colors { [ThemeColor]: RGBColor } 139 | --- 140 | ---**READ-ONLY** Get theme's knob shade setting. Range: (1 - 2) 141 | ---@field knob_shade number 142 | ---@field knob_shade_observable renoise.Document.Observable 143 | --- 144 | ---**READ-ONLY** Get theme's body shade setting. Range: (1 - 2) 145 | ---@field body_shade number 146 | ---@field body_shade_observable renoise.Document.Observable 147 | --- 148 | ---**READ-ONLY** Get theme's contrast setting. Range: (-0.5 - 0.5) 149 | ---@field contrast number 150 | ---@field contrast_observable renoise.Document.Observable 151 | --- 152 | ---**READ-ONLY** Get theme's texture set name 153 | ---@field texture_set string 154 | ---@field texture_set_observable renoise.Document.Observable 155 | --- 156 | ---### functions 157 | 158 | ---Get a single color from the theme using a color identifier as used 159 | ---in the theme XML file - but in lower case. 160 | --- 161 | ---e.g. to access the button background color from the theme, use 162 | ---`renoise.app().theme.color("button_back")` 163 | --- 164 | ---To get notified of color changes, use `renoise.app().theme_observable` 165 | ---@param color_name ThemeColor 166 | ---@return RGBColor 167 | function renoise.ApplicationTheme:color(color_name) end 168 | -------------------------------------------------------------------------------- /library/renoise/song/pattern_iterator.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.PatternIterator 11 | 12 | ---Lua pairs/ipairs alike iterator functions to walk through all lines or columns 13 | ---in the entire song, track or a single pattern. 14 | --- 15 | ---General remarks: Iterators can only be use in "for" loops like you would use 16 | ---"pairs" in Lua. 17 | --- 18 | ---### examples: 19 | ---```lua 20 | ---for pos,line in renoise.song().pattern_iterator:lines_in_song() do [...] end 21 | ---``` 22 | ---The returned `pos` is a table with "pattern", "track", "line" fields, and an 23 | ---additional "column" field for the note/effect columns. 24 | --- 25 | ---The `visible_only` flag controls if all content should be traversed, or only 26 | ---the currently used patterns, columns, and so on. Patterns are traversed in the 27 | ---order they are referenced in the pattern sequence, but each pattern is accessed 28 | ---only once. 29 | --- 30 | ---@class renoise.PatternIterator 31 | renoise.PatternIterator = {} 32 | 33 | ---Line iterator position. 34 | ---@class PatternLinePosition 35 | ---@field pattern integer 36 | ---@field track integer 37 | ---@field line integer 38 | 39 | ---Note/Effect column iterator position. 40 | ---@class PatternColumnPosition : PatternLinePosition 41 | ---@field column integer 42 | 43 | ---### song 44 | 45 | -- Iterate over all pattern lines in the song. 46 | ---@param visible_only boolean? Default: true 47 | ---@return fun(context: unknown):PatternLinePosition, renoise.PatternLine 48 | ---@return renoise.PatternLine line 49 | ---@return PatternLinePosition pos 50 | function renoise.PatternIterator:lines_in_song(visible_only) end 51 | 52 | -- Iterate over all note columns in the song. 53 | ---@param visible_only boolean? Default: true 54 | ---@return fun(context: unknown):PatternColumnPosition, renoise.NoteColumn 55 | ---@return renoise.NoteColumn column 56 | ---@return PatternColumnPosition pos 57 | function renoise.PatternIterator:note_columns_in_song(visible_only) end 58 | 59 | -- Iterate over all effect columns in the song. 60 | ---@param visible_only boolean? Default: true 61 | ---@return fun(context: unknown):PatternColumnPosition, renoise.EffectColumn 62 | ---@return renoise.EffectColumn column 63 | ---@return PatternColumnPosition pos 64 | function renoise.PatternIterator:effect_columns_in_song(visible_only) end 65 | 66 | ---### pattern 67 | 68 | -- Iterate over all lines in the given pattern only. 69 | ---@param pattern_index integer 70 | ---@return fun(context: unknown):PatternLinePosition, renoise.PatternLine 71 | ---@return renoise.PatternLine line 72 | ---@return PatternLinePosition pos 73 | function renoise.PatternIterator:lines_in_pattern(pattern_index) end 74 | 75 | -- Iterate over all note columns in the specified pattern. 76 | ---@param pattern_index integer 77 | ---@param visible_only boolean? Default: true 78 | ---@return fun(context: unknown):PatternColumnPosition, renoise.NoteColumn 79 | ---@return renoise.NoteColumn column 80 | ---@return PatternColumnPosition pos 81 | function renoise.PatternIterator:note_columns_in_pattern(pattern_index, visible_only) end 82 | 83 | -- Iterate over all note columns in the specified pattern. 84 | ---@param pattern_index integer 85 | ---@param visible_only boolean? Default: true 86 | ---@return fun(context: unknown):PatternColumnPosition, renoise.EffectColumn 87 | ---@return renoise.EffectColumn column 88 | ---@return PatternColumnPosition pos 89 | function renoise.PatternIterator:effect_columns_in_pattern(pattern_index, visible_only) end 90 | 91 | ---### track 92 | 93 | -- Iterate over all lines in the given track only. 94 | ---@param track_index integer 95 | ---@param visible_only boolean? Default: true 96 | ---@return fun(context: unknown):PatternLinePosition, renoise.PatternLine 97 | ---@return renoise.PatternLine line 98 | ---@return PatternLinePosition pos 99 | function renoise.PatternIterator:lines_in_track(track_index, visible_only) end 100 | 101 | -- Iterate over all note/effect columns in the specified track. 102 | ---@param track_index integer 103 | ---@param visible_only boolean? Default: true 104 | ---@return fun(context: unknown):PatternColumnPosition, renoise.NoteColumn 105 | ---@return renoise.NoteColumn column 106 | ---@return PatternColumnPosition pos 107 | function renoise.PatternIterator:note_columns_in_track(track_index, visible_only) end 108 | 109 | ---@param track_index integer 110 | ---@param visible_only boolean? Default: true 111 | ---@return fun(context: unknown):PatternColumnPosition, renoise.EffectColumn 112 | ---@return renoise.EffectColumn column 113 | ---@return PatternColumnPosition pos 114 | function renoise.PatternIterator:effect_columns_in_track(track_index, visible_only) end 115 | 116 | ------- Track in Pattern 117 | 118 | -- Iterate over all lines in the given pattern, track only. 119 | ---@param pattern_index integer 120 | ---@param track_index integer 121 | ---@return fun(context: unknown):PatternLinePosition, renoise.PatternLine 122 | ---@return renoise.PatternLine line 123 | ---@return PatternLinePosition pos 124 | function renoise.PatternIterator:lines_in_pattern_track(pattern_index, track_index) end 125 | 126 | -- Iterate over all note/effect columns in the specified pattern track. 127 | ---@param pattern_index integer 128 | ---@param track_index integer 129 | ---@param visible_only boolean? Default: true 130 | ---@return fun(context: unknown):PatternColumnPosition, renoise.NoteColumn 131 | ---@return renoise.NoteColumn column 132 | ---@return PatternColumnPosition pos 133 | function renoise.PatternIterator:note_columns_in_pattern_track(pattern_index, track_index, visible_only) end 134 | 135 | ---@param pattern_index integer 136 | ---@param track_index integer 137 | ---@param visible_only boolean? Default: true 138 | ---@return fun(context: unknown):PatternColumnPosition, renoise.EffectColumn 139 | ---@return renoise.EffectColumn column 140 | ---@return PatternColumnPosition pos 141 | function renoise.PatternIterator:effect_columns_in_pattern_track(pattern_index, track_index, visible_only) end 142 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/plugin.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## PluginInfo 11 | 12 | ---@class PluginInfo 13 | ---@field path string The plugin's path used by load_plugin() 14 | ---@field name string The plugin's name 15 | ---@field short_name string The plugin's name as displayed in shortened lists 16 | ---@field favorite_name string The plugin's name as displayed in favorites 17 | ---@field is_favorite string true if the plugin is a favorite 18 | ---@field is_bridged string true if the plugin is a bridged plugin 19 | 20 | -------------------------------------------------------------------------------- 21 | ---## renoise.InstrumentPluginProperties 22 | 23 | ---@class renoise.InstrumentPluginProperties 24 | renoise.InstrumentPluginProperties = {} 25 | 26 | ---### properties 27 | 28 | ---@class renoise.InstrumentPluginProperties 29 | --- 30 | ---**READ-ONLY** List of all currently available plugins. This is a list of 31 | ---unique plugin names which also contains the plugin's type (VST/AU/DSSI/...), 32 | ---not including the vendor names as visible in Renoise's GUI. So its an 33 | ---identifier, and not the name as visible in the GUI. When no plugin is loaded, 34 | ---the identifier is an empty string. 35 | ---@field available_plugins string[] 36 | --- 37 | ---**READ-ONLY** Returns a list of tables containing more information about the plugins. 38 | ---@field available_plugin_infos PluginInfo[] 39 | --- 40 | ---**READ-ONLY** Returns true when a plugin is present; loaded successfully. 41 | ---@see renoise.PluginProperties.plugin_device_observable for related notifications. 42 | ---@field plugin_loaded boolean 43 | --- 44 | ---Valid object for successfully loaded plugins, otherwise nil. Alias plugin 45 | ---instruments of FX will return the resolved device, will link to the device 46 | ---the alias points to. 47 | ---The observable is fired when the device changes: when a plugin gets loaded or 48 | ---unloaded or a plugin alias is assigned or unassigned. 49 | ---@field plugin_device (renoise.InstrumentPluginDevice|renoise.AudioDevice)? 50 | ---@field plugin_device_observable renoise.Document.Observable 51 | --- 52 | ---**READ-ONLY** Valid for loaded and unloaded plugins. 53 | ---@field alias_instrument_index integer 0 when no alias instrument is set 54 | ---@field alias_instrument_index_observable renoise.Document.Observable 55 | ---**READ-ONLY** 0 when no alias FX is set 56 | ---@field alias_fx_track_index integer 57 | ---@field alias_fx_track_index_observable renoise.Document.Observable 58 | ---**READ-ONLY** 0 when no alias FX is set 59 | ---@field alias_fx_device_index integer 60 | ---@field alias_fx_device_index_observable renoise.Document.Observable 61 | --- 62 | ---**READ-ONLY** Valid for loaded and unloaded plugins. 63 | ---target instrument index of the plugin's MIDI output (when present) 64 | ---@field midi_output_routing_index integer 0 when no routing is set 65 | ---@field midi_output_routing_index_observable renoise.Document.Observable 66 | --- 67 | ---Valid for loaded and unloaded plugins. 68 | ---@field channel integer Range: (1 - 16) 69 | ---@field channel_observable renoise.Document.Observable 70 | ---@field transpose integer Range: (-120 - 120) 71 | ---@field transpose_observable renoise.Document.Observable 72 | --- 73 | ---Valid for loaded and unloaded plugins. 74 | ---@field volume number Range: (0.0 - 4.0) linear gain 75 | ---@field volume_observable renoise.Document.Observable 76 | --- 77 | ---Valid for loaded and unloaded plugins. 78 | ---@field auto_suspend boolean 79 | ---@field auto_suspend_observable renoise.Document.Observable 80 | 81 | ---### functions 82 | 83 | ---Load an existing, new, non aliased plugin. Pass an empty string to unload 84 | ---an already assigned plugin. plugin_path must be one of the available plugins 85 | ---@see renoise.InstrumentPluginProperties.available_plugins 86 | ---@param plugin_path string 87 | ---@return boolean success 88 | function renoise.InstrumentPluginProperties:load_plugin(plugin_path) end 89 | 90 | -------------------------------------------------------------------------------- 91 | ---## renoise.InstrumentPluginDevice 92 | 93 | ---@class renoise.InstrumentPluginDevice 94 | renoise.InstrumentPluginDevice = {} 95 | 96 | ---### properties 97 | 98 | ---@class renoise.InstrumentPluginDevice 99 | --- 100 | ---**READ-ONLY** Device name. 101 | ---@field name string 102 | ---**READ-ONLY** 103 | ---@field short_name string 104 | --- 105 | ---**READ-ONLY** 106 | ---@field presets string[] 107 | ---Preset handling. 0 when when none is active (or available) 108 | ---@field active_preset integer 109 | ---@field active_preset_observable renoise.Document.Observable 110 | ---raw XML data of the active preset 111 | ---@field active_preset_data string 112 | --- 113 | ---**READ-ONLY** 114 | ---@field parameters renoise.DeviceParameter[] 115 | --- 116 | ---**READ-ONLY** Returns whether or not the plugin provides its own custom GUI. 117 | --- 118 | ---@field external_editor_available boolean 119 | --- 120 | ---When the plugin has no custom GUI, Renoise will create a dummy editor for it which 121 | ---lists the plugin parameters. 122 | ---set to true to show the editor, false to close it 123 | ---@field external_editor_visible boolean 124 | --- 125 | ---**READ-ONLY** Returns a string that uniquely identifies the plugin 126 | ---@see renoise.InstrumentPluginProperties.available_plugins for the list of valid paths 127 | ---The string can be passed into: renoise.InstrumentPluginProperties:load_plugin() 128 | ---@field device_path string 129 | 130 | ---### functions 131 | 132 | ---Access to a single preset name by index. Use properties 'presets' to iterate 133 | ---over all presets and to query the presets count. 134 | ---@param index integer 135 | ---@return string 136 | function renoise.InstrumentPluginDevice:preset(index) end 137 | 138 | ---Access to a single parameter by index. Use properties 'parameters' to iterate 139 | ---over all parameters and to query the parameter count. 140 | ---@param index integer 141 | ---@return renoise.DeviceParameter 142 | function renoise.InstrumentPluginDevice:parameter(index) end 143 | 144 | -------------------------------------------------------------------------------- 145 | ---## renoise.InstrumentDevice 146 | 147 | ---**Deprecated.** Use `renoise.InstrumentPluginDevice` instead. 148 | ---@deprecated 149 | ---@class renoise.InstrumentDevice : renoise.InstrumentPluginDevice 150 | renoise.InstrumentDevice = {} 151 | -------------------------------------------------------------------------------- /library/renoise/midi.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | ---For some simple examples on how to use MIDI IO in Renoise, have a look at the 9 | ---"Snippets/Midi.lua" file in the Renoise script Documentation folder. 10 | --- 11 | 12 | -------------------------------------------------------------------------------- 13 | ---## renoise.Midi 14 | 15 | ---Raw MIDI IO support for scripts in Renoise; the ability to send and receive 16 | ---MIDI data. 17 | ---@class renoise.Midi 18 | renoise.Midi = {} 19 | 20 | ---### error handling 21 | 22 | ---When accessing a new device, not used by Renoise nor by your or other scripts, 23 | ---Renoise will try to open that device's driver. If something goes wrong an error 24 | ---will be shown to the user. Something like ("MIDI Device Foo failed to open 25 | ---(error)"). In contrast, none of the MIDI API functions will fail. In other 26 | ---words, if a "real" device fails to open this is not your problem, but the user's 27 | ---problem. This is also the reason why none of the MIDI API functions return error 28 | ---codes. 29 | --- 30 | ---All other types of logic errors, such as sending MIDI to a manually closed 31 | ---device, sending bogus messages and so on, will be fired as typical Lua runtime 32 | ---errors. 33 | 34 | ---### enumeration 35 | 36 | ---Return a list of strings with currently available MIDI input devices. 37 | ---This list can change when devices are hot-plugged. 38 | ---See `renoise.Midi.devices_changed_observable` 39 | ---@return string[] 40 | function renoise.Midi.available_input_devices() end 41 | 42 | ---Return a list of strings with currently available MIDI output devices. 43 | ---This list can change when devices are hot-plugged. 44 | ---See `renoise.Midi.devices_changed_observable` 45 | ---@return string[] 46 | function renoise.Midi.available_output_devices() end 47 | 48 | ---Fire notifications as soon as new devices become active or a previously 49 | ---added device gets removed/unplugged. 50 | ---This will only happen on Linux and OSX with real devices. On Windows this 51 | ---may happen when using ReWire slaves. ReWire adds virtual MIDI devices to 52 | ---Renoise. 53 | ---Already opened references to devices which are no longer available will 54 | ---do nothing: you can use them as before and they will not fire any errors. 55 | ---The messages will simply go into the void... 56 | ---@return renoise.Document.Observable 57 | function renoise.Midi.devices_changed_observable() end 58 | 59 | ---### creation 60 | 61 | ---@alias MidiMessage integer[] 62 | ---@alias MidiMessageFunction fun(message: MidiMessage) 63 | ---@alias MidiMessageMemberContext table|userdata 64 | ---@alias MidiMessageMemberFunction fun(self: MidiMessageMemberContext, message: MidiMessage) 65 | ---@alias MidiMessageMethod1 {[1]:MidiMessageMemberContext, [2]:MidiMessageMemberFunction} 66 | ---@alias MidiMessageMethod2 {[1]:MidiMessageMemberFunction, [2]:MidiMessageMemberContext} 67 | 68 | ---Listen to incoming MIDI data: opens access to a MIDI input device by 69 | ---specifying a device name. 70 | ---Name must be one of `renoise.Midi.available_input_devices()`. 71 | --- 72 | ---One or both callbacks should be valid, and should either point to a function 73 | ---with one parameter `function (message: number[]) end`, or a table with an object 74 | ---and class `{context, function(context, message: number[]) end}` -> a method. 75 | --- 76 | ---All MIDI messages except active sensing will be forwarded to the callbacks. 77 | ---When Renoise is already listening to this device, your callback *and* Renoise 78 | ---(or even other scripts) will handle the message. 79 | --- 80 | ---Messages are received until the device reference is manually closed (see 81 | ---renoise.Midi.MidiDevice:close()) or until the MidiInputDevice object gets garbage 82 | ---collected. 83 | ---@param device_name string 84 | ---@param callback (MidiMessageFunction|MidiMessageMethod1|MidiMessageMethod2)? 85 | ---@param sysex_callback (MidiMessageFunction|MidiMessageMethod1|MidiMessageMethod2)? 86 | ---@return renoise.Midi.MidiInputDevice 87 | function renoise.Midi.create_input_device(device_name, callback, sysex_callback) end 88 | 89 | ---Open access to a MIDI device by specifying the device name. 90 | ---Name must be one of `renoise.Midi.available_input_devices()`. 91 | ---All other device names will fire an error. 92 | --- 93 | ---The real device driver gets automatically closed when the MidiOutputDevice 94 | ---object gets garbage collected or when the device is explicitly closed 95 | ---via midi_device:close() and nothing else references it. 96 | ---@param device_name string 97 | ---@return renoise.Midi.MidiOutputDevice 98 | function renoise.Midi.create_output_device(device_name) end 99 | 100 | -------------------------------------------------------------------------------- 101 | 102 | ---Baseclass of renoise.Midi.MidiIn/OutDevice with common properties for MIDI 103 | ---input and output devices. 104 | ---@class renoise.Midi.MidiDevice 105 | --- 106 | ---Returns true while the device is open (ready to send or receive messages). 107 | ---Your device refs will never be auto-closed, "is_open" will only be false if 108 | ---you explicitly call "midi_device:close()" to release a device. 109 | ---@field is_open boolean 110 | --- 111 | ---The name of a device. This is the name you create a device with via 112 | ---`renoise.Midi.create_input_device` or `renoise.Midi.create_output_device`. 113 | ---@field name string 114 | renoise.Midi.MidiDevice = {} 115 | 116 | ---### functions 117 | 118 | ---Close a running MIDI device. When no other client is using a device, Renoise 119 | ---will also shut off the device driver so that, for example, Windows OS other 120 | ---applications can use the device again. This is automatically done when 121 | ---scripts are closed or your device objects are garbage collected. 122 | function renoise.Midi.MidiDevice:close() end 123 | 124 | -------------------------------------------------------------------------------- 125 | 126 | ---Midi device interface for receiving MIDI messages. 127 | ---Instances are created via `renoise.Midi.create_input_device` 128 | ---@class renoise.Midi.MidiInputDevice : renoise.Midi.MidiDevice 129 | renoise.Midi.MidiInputDevice = {} 130 | 131 | -------------------------------------------------------------------------------- 132 | 133 | ---Midi device interface for sending MIDI messages. 134 | ---Instances are created via `renoise.Midi.create_output_device` 135 | ---@class renoise.Midi.MidiOutputDevice : renoise.Midi.MidiDevice 136 | renoise.Midi.MidiOutputDevice = {} 137 | 138 | ---### functions 139 | 140 | ---Send raw 1-3 byte MIDI messages or sysex messages. Message is expected 141 | ---to be an array of numbers. It must not be empty and can only contain 142 | ---numbers >= 0 and <= 0xFF (bytes). Sysex messages must be sent in one block, 143 | ---and must start with 0xF0, and end with 0xF7. 144 | ---@param message integer[] 145 | function renoise.Midi.MidiOutputDevice:send(message) end 146 | -------------------------------------------------------------------------------- /library/renoise/song/sequencer.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.PatternSequencer 11 | 12 | ---Pattern sequencer component of the Renoise song. 13 | ---@class renoise.PatternSequencer 14 | renoise.PatternSequencer = {} 15 | 16 | ---### properties 17 | 18 | ---@class renoise.PatternSequencer 19 | --- 20 | ---When true, the sequence will be auto sorted. 21 | ---@field keep_sequence_sorted boolean 22 | ---@field keep_sequence_sorted_observable renoise.Document.Observable 23 | --- 24 | ---Access to the selected slots in the sequencer. When no selection is present 25 | ---`{0, 0}` is returned, else Range: (1 - #sequencer.pattern_sequence) 26 | ---@field selection_range integer[] 27 | ---@field selection_range_observable renoise.Document.Observable 28 | --- 29 | ---Pattern order list: Notifiers will only be fired when sequence positions are 30 | ---added, removed or their order changed. To get notified of pattern assignment 31 | ---changes use the property `pattern_assignments_observable`. 32 | ---Use `set_pattern` to change a single pattern in the sequence. 33 | ---@field pattern_sequence integer[] 34 | ---@field pattern_sequence_observable renoise.Document.ObservableList 35 | ---Attach notifiers that will be called as soon as any pattern assignment 36 | ---at any sequence position changes. 37 | ---@field pattern_assignments_observable renoise.Document.Observable 38 | --- 39 | ---Attach notifiers that will be fired as soon as any slot muting property 40 | ---in any track/sequence slot changes. 41 | ---@field pattern_slot_mutes_observable renoise.Document.Observable 42 | 43 | ---### functions 44 | 45 | ---Insert the specified pattern at the given position in the sequence. 46 | ---@param sequence_index integer 47 | ---@param pattern_index integer 48 | function renoise.PatternSequencer:insert_sequence_at(sequence_index, pattern_index) end 49 | 50 | ---Insert an empty, unreferenced pattern at the given position. 51 | ---@param sequence_index integer 52 | ---@return integer new_pattern_index 53 | function renoise.PatternSequencer:insert_new_pattern_at(sequence_index) end 54 | 55 | ---Delete an existing position in the sequence. Renoise needs at least one 56 | ---sequence in the song for playback. Completely removing all sequence positions 57 | ---is not allowed. 58 | function renoise.PatternSequencer:delete_sequence_at(sequence_index) end 59 | 60 | ---Access to a single sequence by index (the pattern number). Use property 61 | ---`pattern_sequence` to iterate over the whole sequence and to query the 62 | ---sequence count. 63 | ---@param sequence_index integer 64 | ---@return integer pattern_index 65 | function renoise.PatternSequencer:pattern(sequence_index) end 66 | 67 | ---Change a single assigned pattern for the given sequence index. Use `pattern_sequence` 68 | ---to iterate or change the whole sequence and to query the sequence count. 69 | ---@param sequence_index integer 70 | ---@param pattern_index integer 71 | function renoise.PatternSequencer:set_pattern(sequence_index, pattern_index) end 72 | 73 | ---Clone a sequence range, appending it right after to_sequence_index. 74 | ---Slot muting is copied as well. 75 | ---@param from_sequence_index integer 76 | ---@param to_sequence_index integer 77 | function renoise.PatternSequencer:clone_range(from_sequence_index, to_sequence_index) end 78 | 79 | ---Make patterns in the given sequence pos range unique, if needed. 80 | ---@param from_sequence_index integer 81 | ---@param to_sequence_index integer 82 | function renoise.PatternSequencer:make_range_unique(from_sequence_index, to_sequence_index) end 83 | 84 | ---Sort patterns in the sequence in ascending order, keeping the old pattern 85 | ---data in place. This will only change the visual order of patterns, but 86 | ---not change the song's structure. 87 | function renoise.PatternSequencer:sort() end 88 | 89 | ---Access to pattern sequence sections. When the `is_start_of_section flag` is 90 | ---set for a sequence pos, a section ranges from this pos to the next pos 91 | ---which starts a section, or till the end of the song when there are no others. 92 | ---@return boolean 93 | ---@param sequence_index integer 94 | ---@return boolean 95 | function renoise.PatternSequencer:sequence_is_start_of_section(sequence_index) end 96 | 97 | ---@param sequence_index integer 98 | ---@param is_section boolean 99 | function renoise.PatternSequencer:set_sequence_is_start_of_section(sequence_index, is_section) end 100 | 101 | ---@param sequence_index integer 102 | ---@return renoise.Document.Observable 103 | function renoise.PatternSequencer:sequence_is_start_of_section_observable(sequence_index) end 104 | 105 | ---Access to a pattern sequence section's name. Section names are only visible 106 | ---for a sequence pos which starts the section (see `sequence_is_start_of_section`). 107 | ---@param sequence_index integer 108 | ---@return string 109 | function renoise.PatternSequencer:sequence_section_name(sequence_index) end 110 | 111 | ---@param sequence_index integer 112 | ---@param name string 113 | function renoise.PatternSequencer:set_sequence_section_name(sequence_index, name) end 114 | 115 | ---@param sequence_index integer 116 | ---@return renoise.Document.Observable 117 | function renoise.PatternSequencer:sequence_section_name_observable(sequence_index) end 118 | 119 | ---Returns true if the given sequence pos is part of a section, else false. 120 | ---@param sequence_index integer 121 | ---@return boolean 122 | function renoise.PatternSequencer:sequence_is_part_of_section(sequence_index) end 123 | 124 | ---Returns true if the given sequence pos is the end of a section, else false 125 | ---@param sequence_index integer 126 | ---@return boolean 127 | function renoise.PatternSequencer:sequence_is_end_of_section(sequence_index) end 128 | 129 | ---Observable, which is fired, whenever the section layout in the sequence 130 | ---changed in any way, i.e. new sections got added, existing ones got deleted 131 | ---@return renoise.Document.Observable 132 | function renoise.PatternSequencer:sequence_sections_changed_observable() end 133 | 134 | ---Access to sequencer slot mute states. Mute slots are memorized in the 135 | ---sequencer and not in the patterns. 136 | ---@param track_index integer 137 | ---@param sequence_index integer 138 | ---@return boolean 139 | function renoise.PatternSequencer:track_sequence_slot_is_muted(track_index, sequence_index) end 140 | 141 | ---@param track_index integer 142 | ---@param sequence_index integer 143 | function renoise.PatternSequencer:set_track_sequence_slot_is_muted(track_index, sequence_index, muted) end 144 | 145 | ---Access to sequencer slot selection states. 146 | ---@param track_index integer 147 | ---@param sequence_index integer 148 | ---@return boolean 149 | function renoise.PatternSequencer:track_sequence_slot_is_selected(track_index, sequence_index) end 150 | 151 | ---@param track_index integer 152 | ---@param sequence_index integer 153 | function renoise.PatternSequencer:set_track_sequence_slot_is_selected(track_index, sequence_index, selected) end 154 | -------------------------------------------------------------------------------- /library/renoise/song/pattern/line.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.PatternLine 11 | 12 | ---@class renoise.PatternLine 13 | renoise.PatternLine = {} 14 | 15 | ---### constants 16 | 17 | renoise.PatternLine.EMPTY_NOTE = 121 18 | renoise.PatternLine.NOTE_OFF = 120 19 | 20 | renoise.PatternLine.EMPTY_INSTRUMENT = 255 21 | renoise.PatternLine.EMPTY_VOLUME = 255 22 | renoise.PatternLine.EMPTY_PANNING = 255 23 | renoise.PatternLine.EMPTY_DELAY = 0 24 | 25 | renoise.PatternLine.EMPTY_EFFECT_NUMBER = 0 26 | renoise.PatternLine.EMPTY_EFFECT_AMOUNT = 0 27 | 28 | ---### properties 29 | 30 | ---@class renoise.PatternLine 31 | --- 32 | ---Is empty. 33 | ---@field is_empty boolean **READ-ONLY** 34 | --- 35 | ---Columns. 36 | ---@field note_columns renoise.NoteColumn[] **READ-ONLY** 37 | ---@field effect_columns renoise.EffectColumn[] **READ-ONLY** 38 | 39 | ---### functions 40 | 41 | ---Clear all note and effect columns. 42 | function renoise.PatternLine:clear() end 43 | 44 | ---Copy contents from other_line, trashing column content. 45 | ---@param other renoise.PatternLine 46 | function renoise.PatternLine:copy_from(other) end 47 | 48 | ---Access to a single note column by index. Use properties 'note_columns' 49 | ---to iterate over all note columns and to query the note_column count. 50 | ---This is a !lot! more efficient than calling the property: 51 | ---note_columns[index] to randomly access columns. When iterating over all 52 | ---columns, use pairs(note_columns). 53 | ---@param index integer 54 | ---@return renoise.NoteColumn 55 | function renoise.PatternLine:note_column(index) end 56 | 57 | ---Access to a single effect column by index. Use properties 'effect_columns' 58 | ---to iterate over all effect columns and to query the effect_column count. 59 | ---This is a !lot! more efficient than calling the property: 60 | ---effect_columns[index] to randomly access columns. When iterating over all 61 | ---columns, use pairs(effect_columns). 62 | ---@param index integer 63 | ---@return renoise.EffectColumn 64 | function renoise.PatternLine:effect_column(index) end 65 | 66 | ---### operators 67 | 68 | ---Compares all columns. 69 | ---operator==(PatternLine object, PatternLine object): boolean 70 | ---operator~=(PatternLine object, PatternLine object): boolean 71 | 72 | ---Serialize a line. 73 | ---@param pattern_line renoise.PatternLine 74 | ---@return string 75 | function tostring(pattern_line) end 76 | 77 | -------------------------------------------------------------------------------- 78 | ---renoise.NoteColumn 79 | 80 | ---A single note column in a pattern line. 81 | --- 82 | ---General remarks: instrument columns are available for lines in phrases 83 | ---but are ignored. See renoise.InstrumentPhrase for detail. 84 | --- 85 | ---Access note column properties either by values (numbers) or by strings. 86 | ---The string representation uses exactly the same notation as you see 87 | ---them in Renoise's pattern or phrase editor. 88 | ---@class renoise.NoteColumn 89 | renoise.NoteColumn = {} 90 | 91 | ---### properties 92 | 93 | ---@class renoise.NoteColumn 94 | --- 95 | ---**READ-ONLY** True, when all note column properties are empty. 96 | ---@field is_empty boolean 97 | --- 98 | ---**READ-ONLY** True, when this column is selected in the pattern or phrase 99 | ---editors current pattern. 100 | ---@field is_selected boolean 101 | --- 102 | ---@field note_value integer Range: (0-119) or 120=Off or 121=Empty 103 | ---@field note_string string Range: (\'C-0\'-\'G-9\') or \'OFF\' or \'---\' 104 | --- 105 | ---@field instrument_value integer Range: (0-254), 255==Empty 106 | ---@field instrument_string string Range: (\'00\'-\'FE\') or \'..\' 107 | --- 108 | ---Range: (0-127) or 255==Empty when column value is <= 0x80 or is 0xFF, 109 | ---i.e. to specify a volume value. 110 | --- 111 | ---Range: (0-65535) in the form 0x0000xxyy where xx=effect char 1 and yy=effect char 2, 112 | ---when column value is > 0x80, i.e. to specify an effect. 113 | ---@field volume_value integer 114 | ---@field volume_string string Range(\'00\'-\'ZF\') or \'..\' 115 | --- 116 | ---Range: (0-127) or 255==Empty when column value is <= 0x80 or is 0xFF, 117 | ---i.e. to specify a pan value. 118 | --- 119 | ---Range: (0-65535) in the form 0x0000xxyy where xx=effect char 1 and yy=effect char 2, 120 | ---when column value is > 0x80, i.e. to specify an effect. 121 | ---@field panning_value integer 122 | ---@field panning_string string Range: (\'00'-\'ZF\') or \'..\' 123 | --- 124 | ---@field delay_value integer Range: (0-255) 125 | ---@field delay_string string Range: (\'00'-\'FF\') or \'..\' 126 | --- 127 | ---Range: (0-65535) in the form 0x0000xxyy where xx=effect char 1 and yy=effect char 2 128 | ---@field effect_number_value integer 129 | ---@field effect_number_string string Range: (\'00\'-\'ZZ\') 130 | --- 131 | ---@field effect_amount_value integer Range: (0-255) 132 | ---@field effect_amount_string string Range: (\'00\' - \'FF\') 133 | 134 | ---### functions 135 | 136 | ---Clear the note column. 137 | function renoise.NoteColumn:clear() end 138 | 139 | ---Copy the column's content from another column. 140 | ---@param other renoise.NoteColumn 141 | function renoise.NoteColumn:copy_from(other) end 142 | 143 | ---### operators 144 | 145 | ---Compares the whole column. 146 | ---operator==(note_column, note_column): boolean 147 | ---operator~=(note_column, note_column): boolean 148 | 149 | ---Serialize a column. 150 | ---@param note_column renoise.NoteColumn 151 | function tostring(note_column) end 152 | 153 | -------------------------------------------------------------------------------- 154 | ---## renoise.EffectColumn 155 | 156 | ---A single effect column in a pattern line. 157 | --- 158 | ---Access effect column properties either by values (numbers) or by strings. 159 | ---The string representation uses exactly the same notation as you see 160 | ---them in Renoise's pattern or phrase editor. 161 | ---@class renoise.EffectColumn 162 | renoise.EffectColumn = {} 163 | 164 | ---### properties 165 | 166 | ---@class renoise.EffectColumn 167 | --- 168 | ---**READ-ONLY** True, when all effect column properties are empty. 169 | ---@field is_empty boolean 170 | --- 171 | ---**READ-ONLY** True, when this column is selected in the pattern or phrase editor. 172 | ---@field is_selected boolean 173 | --- 174 | ---0-65535 in the form 0x0000xxyy where xx=effect char 1 and yy=effect char 2 175 | ---@field number_value integer 176 | ---@field number_string string Range: ('00' - 'ZZ') 177 | --- 178 | ---@field amount_value integer Range: (0 - 255) 179 | ---@field amount_string string Range: ('00' - 'FF') 180 | 181 | ---### functions 182 | 183 | ---Clear the effect column. 184 | function renoise.EffectColumn:clear() end 185 | 186 | ---Copy the column's content from another column. 187 | ---@param other renoise.EffectColumn 188 | function renoise.EffectColumn:copy_from(other) end 189 | 190 | ---### operators 191 | 192 | ---Compares the whole column. 193 | ---operator==(EffectColumn object, EffectColumn object): boolean 194 | ---operator~=(EffectColumn object, EffectColumn object): boolean 195 | 196 | ---Serialize a column. 197 | ---@param effect_column renoise.EffectColumn 198 | ---@return string 199 | function tostring(effect_column) end 200 | -------------------------------------------------------------------------------- /library/renoise/application/window.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | --- ## renoise.ApplicationWindow 11 | 12 | ---Application window and general UI properties of the Renoise app. 13 | ---@class renoise.ApplicationWindow 14 | renoise.ApplicationWindow = {} 15 | 16 | ---## constants 17 | 18 | ---@enum renoise.ApplicationWindow.UpperFrame 19 | ---@diagnostic disable-next-line: missing-fields 20 | renoise.ApplicationWindow = { 21 | UPPER_FRAME_TRACK_SCOPES = 1, 22 | UPPER_FRAME_MASTER_SPECTRUM = 2 23 | } 24 | 25 | ---@enum renoise.ApplicationWindow.MiddleFrame 26 | ---@diagnostic disable-next-line: missing-fields 27 | renoise.ApplicationWindow = { 28 | MIDDLE_FRAME_PATTERN_EDITOR = 1, 29 | MIDDLE_FRAME_MIXER = 2, 30 | MIDDLE_FRAME_INSTRUMENT_PHRASE_EDITOR = 3, 31 | MIDDLE_FRAME_INSTRUMENT_SAMPLE_KEYZONES = 4, 32 | MIDDLE_FRAME_INSTRUMENT_SAMPLE_EDITOR = 5, 33 | MIDDLE_FRAME_INSTRUMENT_SAMPLE_MODULATION = 6, 34 | MIDDLE_FRAME_INSTRUMENT_SAMPLE_EFFECTS = 7, 35 | MIDDLE_FRAME_INSTRUMENT_PLUGIN_EDITOR = 8, 36 | MIDDLE_FRAME_INSTRUMENT_MIDI_EDITOR = 9, 37 | } 38 | 39 | ---@enum renoise.ApplicationWindow.LowerFrame 40 | ---@diagnostic disable-next-line: missing-fields 41 | renoise.ApplicationWindow = { 42 | LOWER_FRAME_TRACK_DSPS = 1, 43 | LOWER_FRAME_TRACK_AUTOMATION = 2, 44 | } 45 | 46 | ---@enum renoise.ApplicationWindow.DiskBrowserCategory 47 | ---@diagnostic disable-next-line: missing-fields 48 | renoise.ApplicationWindow = { 49 | DISK_BROWSER_CATEGORY_SONGS = 1, 50 | DISK_BROWSER_CATEGORY_INSTRUMENTS = 2, 51 | DISK_BROWSER_CATEGORY_SAMPLES = 3, 52 | DISK_BROWSER_CATEGORY_OTHER = 4 53 | } 54 | 55 | ---@enum renoise.ApplicationWindow.InstrumentBoxSlotSize 56 | ---@diagnostic disable-next-line: missing-fields 57 | renoise.ApplicationWindow = { 58 | INSTRUMENT_BOX_SLOT_SIZE_SMALL = 1, 59 | INSTRUMENT_BOX_SLOT_SIZE_MEDIUM = 2, 60 | INSTRUMENT_BOX_SLOT_SIZE_LARGE = 3, 61 | } 62 | 63 | ---@enum renoise.ApplicationWindow.MixerFader 64 | ---@diagnostic disable-next-line: missing-fields 65 | renoise.ApplicationWindow = { 66 | MIXER_FADER_TYPE_24DB = 1, 67 | MIXER_FADER_TYPE_48DB = 2, 68 | MIXER_FADER_TYPE_96DB = 3, 69 | MIXER_FADER_TYPE_LINEAR = 4, 70 | } 71 | 72 | ---### properties 73 | 74 | ---@class renoise.ApplicationWindow 75 | --- 76 | ---Get/set if the application is running fullscreen. 77 | ---@field fullscreen boolean 78 | --- 79 | ---**READ-ONLY**. Window status flag. 80 | ---@field is_maximized boolean 81 | --- 82 | ---**READ-ONLY**. Window status flag. 83 | ---@field is_minimized boolean 84 | --- 85 | ---When true, the middle frame views (like the pattern editor) will 86 | ---stay focused unless alt or middle mouse is clicked. 87 | ---@field lock_keyboard_focus boolean 88 | --- 89 | ---Dialog for recording new samples, floating above the main window. 90 | ---@field sample_record_dialog_is_visible boolean 91 | --- 92 | ---Diskbrowser Panel. 93 | ---@field disk_browser_is_visible boolean 94 | ---@field disk_browser_is_visible_observable renoise.Document.Observable 95 | --- 96 | ---@field disk_browser_category renoise.ApplicationWindow.DiskBrowserCategory 97 | ---@field disk_browser_category_observable renoise.Document.Observable 98 | --- 99 | ---InstrumentBox 100 | ---@field instrument_box_is_visible boolean 101 | ---@field instrument_box_is_visible_observable renoise.Document.Observable 102 | --- 103 | ---InstrumentBox slot size 104 | ---@field instrument_box_slot_size renoise.ApplicationWindow.InstrumentBoxSlotSize 105 | ---@field instrument_box_slot_size_observable renoise.Document.Observable 106 | --- 107 | ---Instrument Editor detaching. 108 | ---@field instrument_editor_is_detached boolean 109 | ---@field instrument_editor_is_detached_observable renoise.Document.Observable 110 | --- 111 | ---InstrumentProperties (below InstrumentBox) 112 | ---@field instrument_properties_is_visible boolean 113 | ---@field instrument_properties_is_visible_observable renoise.Document.Observable 114 | ---@field instrument_properties_show_volume_transpose boolean 115 | ---@field instrument_properties_show_trigger_options boolean 116 | ---@field instrument_properties_show_scale_options boolean 117 | ---@field instrument_properties_show_plugin boolean 118 | ---@field instrument_properties_show_plugin_program boolean 119 | ---@field instrument_properties_show_midi boolean 120 | ---@field instrument_properties_show_midi_program boolean 121 | ---@field instrument_properties_show_macros boolean 122 | ---@field instrument_properties_show_phrases boolean 123 | --- 124 | ---SampleProperties (below SampleNavigator) 125 | ---@field sample_properties_is_visible boolean 126 | ---@field sample_properties_is_visible_observable renoise.Document.Observable 127 | --- 128 | ---Mixer View detaching. 129 | ---@field mixer_view_is_detached boolean 130 | ---@field mixer_view_is_detached_observable renoise.Document.Observable 131 | --- 132 | ---Frame with the scopes/master spectrum... 133 | ---@field upper_frame_is_visible boolean 134 | ---@field upper_frame_is_visible_observable renoise.Document.Observable 135 | ---@field active_upper_frame renoise.ApplicationWindow.UpperFrame 136 | ---@field active_upper_frame_observable renoise.Document.Observable 137 | --- 138 | --Frame with the pattern editor, mixer... 139 | ---@field active_middle_frame renoise.ApplicationWindow.MiddleFrame 140 | ---@field active_middle_frame_observable renoise.Document.Observable 141 | --- 142 | ---Frame with the DSP chain view, automation, etc. 143 | ---@field lower_frame_is_visible boolean 144 | ---@field lower_frame_is_visible_observable renoise.Document.Observable 145 | ---@field active_lower_frame renoise.ApplicationWindow.LowerFrame 146 | ---@field active_lower_frame_observable renoise.Document.Observable 147 | --- 148 | ---Frame with Disk Browser and Instrument Box. 149 | ---@field right_frame_is_visible boolean 150 | ---@field right_frame_is_visible_observable renoise.Document.Observable 151 | --- 152 | ---Pattern matrix, visible in pattern editor and mixer only... 153 | ---@field pattern_matrix_is_visible boolean 154 | ---@field pattern_matrix_is_visible_observable renoise.Document.Observable 155 | --- 156 | ---Pattern advanced edit, visible in pattern editor only... 157 | ---@field pattern_advanced_edit_is_visible boolean 158 | ---@field pattern_advanced_edit_is_visible_observable renoise.Document.Observable 159 | --- 160 | ---Mixer views Pre/Post volume setting. 161 | ---@field mixer_view_post_fx boolean 162 | ---@field mixer_view_post_fx_observable renoise.Document.Observable 163 | --- 164 | ---Mixer fader type setting. 165 | ---@field mixer_fader_type renoise.ApplicationWindow.MixerFader 166 | ---@field mixer_fader_type_observable renoise.Document.Observable 167 | 168 | ---### functions 169 | 170 | ---Expand the window over the entire screen, without hiding menu bars, 171 | ---docks and so on. 172 | function renoise.ApplicationWindow:maximize() end 173 | 174 | ---Minimize the window to the dock or taskbar, depending on the OS. 175 | function renoise.ApplicationWindow:minimize() end 176 | 177 | ---"un-maximize" or "un-minimize" the window, or just bring it to front. 178 | function renoise.ApplicationWindow:restore() end 179 | 180 | ---Select/activate one of the global view presets, to memorize/restore 181 | ---the user interface layout. 182 | ---@param preset_index integer 183 | function renoise.ApplicationWindow:select_preset(preset_index) end 184 | -------------------------------------------------------------------------------- /library/renoise/song/track.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Track 11 | 12 | ---Track component of a Renoise song. 13 | ---@class renoise.Track 14 | renoise.Track = {} 15 | 16 | ---Audio device info 17 | ---@class AudioDeviceInfo 18 | ---@field path string The device's path used by `renoise.Track:insert_device_at` 19 | ---@field name string The device's name 20 | ---@field short_name string The device's name as displayed in shortened lists 21 | ---@field favorite_name string The device's name as displayed in favorites 22 | ---@field is_favorite boolean true if the device is a favorite 23 | ---@field is_bridged boolean true if the device is a bridged plugin 24 | 25 | ---### constants 26 | 27 | ---@enum renoise.Track.TrackType 28 | ---@diagnostic disable-next-line: missing-fields 29 | renoise.Track = { 30 | TRACK_TYPE_SEQUENCER = 1, 31 | TRACK_TYPE_MASTER = 2, 32 | TRACK_TYPE_SEND = 3, 33 | TRACK_TYPE_GROUP = 4, 34 | } 35 | 36 | ---@enum renoise.Track.MuteState 37 | ---@diagnostic disable-next-line: missing-fields 38 | renoise.Track = { 39 | MUTE_STATE_ACTIVE = 1, 40 | MUTE_STATE_OFF = 2, 41 | MUTE_STATE_MUTED = 3 42 | } 43 | 44 | ---### properties 45 | 46 | ---@class renoise.Track 47 | --- 48 | ---Type, name, color. 49 | ---@field type renoise.Track.TrackType **READ-ONLY** 50 | ---@field name string Name, as visible in track headers 51 | ---@field name_observable renoise.Document.Observable 52 | ---@field color RGBColor 53 | ---@field color_observable renoise.Document.Observable 54 | ---@field color_blend integer Range: (0 - 100) Color blend in percent 55 | ---@field color_blend_observable renoise.Document.Observable 56 | --- 57 | ---Mute and solo states. Not available for the master track. 58 | ---@field mute_state renoise.Track.MuteState 59 | ---@field mute_state_observable renoise.Document.Observable 60 | --- 61 | ---@field solo_state boolean 62 | ---@field solo_state_observable renoise.Document.Observable 63 | --- 64 | ---Volume, panning, width. 65 | ---@field prefx_volume renoise.DeviceParameter **READ-ONLY** 66 | ---@field prefx_panning renoise.DeviceParameter **READ-ONLY** 67 | ---@field prefx_width renoise.DeviceParameter **READ-ONLY** 68 | --- 69 | ---@field postfx_volume renoise.DeviceParameter **READ-ONLY** 70 | ---@field postfx_panning renoise.DeviceParameter **READ-ONLY** 71 | --- 72 | ---Collapsed/expanded visual appearance. 73 | ---@field collapsed boolean 74 | ---@field collapsed_observable renoise.Document.Observable 75 | --- 76 | ---Returns most immediate group parent or nil if not in a group. 77 | ---@field group_parent renoise.GroupTrack? **READ-ONLY** 78 | --- 79 | ---Output routing. 80 | ---@field available_output_routings string[] **READ-ONLY** 81 | ---@field output_routing string One of `available_output_routings` 82 | ---@field output_routing_observable renoise.Document.Observable 83 | --- 84 | ---Delay. 85 | ---@field output_delay number Range: (-100.0-100.0) in ms 86 | ---@field output_delay_observable renoise.Document.Observable 87 | --- 88 | ---Pattern editor columns. 89 | ---@field max_effect_columns integer **READ-ONLY** 8 OR 0 depending on the track type 90 | ---@field min_effect_columns integer **READ-ONLY** 1 OR 0 depending on the track type 91 | --- 92 | ---@field max_note_columns integer **READ-ONLY** 12 OR 0 depending on the track type 93 | ---@field min_note_columns integer **READ-ONLY** 1 OR 0 depending on the track type 94 | --- 95 | ---@field visible_effect_columns integer 1-8 OR 0-8, depending on the track type 96 | ---@field visible_effect_columns_observable renoise.Document.Observable 97 | ---@field visible_note_columns integer 0 OR 1-12, depending on the track type 98 | ---@field visible_note_columns_observable renoise.Document.Observable 99 | --- 100 | ---@field volume_column_visible boolean 101 | ---@field volume_column_visible_observable renoise.Document.Observable 102 | ---@field panning_column_visible boolean 103 | ---@field panning_column_visible_observable renoise.Document.Observable 104 | ---@field delay_column_visible boolean 105 | ---@field delay_column_visible_observable renoise.Document.Observable 106 | ---@field sample_effects_column_visible boolean 107 | ---@field sample_effects_column_visible_observable renoise.Document.Observable 108 | --- 109 | ---Devices. 110 | ---@field available_devices string[] **READ-ONLY** FX devices this track can handle. 111 | ---**READ-ONLY** Array of tables containing information about the devices. 112 | ---@field available_device_infos AudioDeviceInfo[] 113 | --- 114 | ---@field devices renoise.AudioDevice[] **READ-ONLY** List of audio DSP FX. 115 | ---@field devices_observable renoise.Document.ObservableList 116 | 117 | ---### functions 118 | 119 | ---Insert a new device at the given position. `device_path` must be one of 120 | ---`renoise.Track.available_devices`. 121 | ---@param device_path string 122 | ---@param device_index integer 123 | ---@return renoise.AudioDevice 124 | function renoise.Track:insert_device_at(device_path, device_index) end 125 | 126 | ---Delete an existing device in a track. The mixer device at index 1 can not 127 | ---be deleted from any track. 128 | function renoise.Track:delete_device_at(device_index) end 129 | 130 | ---Swap the positions of two devices in the device chain. The mixer device at 131 | ---index 1 can not be swapped or moved. 132 | ---@param device_index1 integer 133 | ---@param device_index2 integer 134 | function renoise.Track:swap_devices_at(device_index1, device_index2) end 135 | 136 | ---Access to a single device by index. Use property `devices` to iterate 137 | ---over all devices and to query the device count. 138 | ---@param device_index integer 139 | ---@return renoise.AudioDevice 140 | function renoise.Track:device(device_index) end 141 | 142 | ---Uses default mute state from the prefs. Not for the master track. 143 | function renoise.Track:mute() end 144 | 145 | function renoise.Track:unmute() end 146 | 147 | function renoise.Track:solo() end 148 | 149 | ---Note column mutes. Only valid within (1-track.max_note_columns) 150 | ---@param column_index integer 151 | ---@return boolean 152 | function renoise.Track:column_is_muted(column_index) end 153 | 154 | ---@param column_index integer 155 | ---@return renoise.Document.Observable 156 | function renoise.Track:column_is_muted_observable(column_index) end 157 | 158 | ---@param column_index integer 159 | ---@param muted boolean 160 | function renoise.Track:set_column_is_muted(column_index, muted) end 161 | 162 | ---Note column names. Only valid within (1-track.max_note_columns) 163 | ---@param column_index integer 164 | ---@return string 165 | function renoise.Track:column_name(column_index) end 166 | 167 | ---@param column_index integer 168 | ---@return renoise.Document.Observable 169 | function renoise.Track:column_name_observable(column_index) end 170 | 171 | ---@param column_index integer 172 | ---@param name string 173 | function renoise.Track:set_column_name(column_index, name) end 174 | 175 | ---Swap the positions of two note or effect columns within a track. 176 | ---@param column_index1 integer 177 | ---@param column_index2 integer 178 | function renoise.Track:swap_note_columns_at(column_index1, column_index2) end 179 | 180 | ---@param column_index1 integer 181 | ---@param column_index2 integer 182 | function renoise.Track:swap_effect_columns_at(column_index1, column_index2) end 183 | 184 | -------------------------------------------------------------------------------- 185 | ---## renoise.GroupTrack 186 | 187 | ---@class renoise.GroupTrack 188 | renoise.GroupTrack = {} 189 | 190 | ---### properties 191 | 192 | ---Group track component of a Renoise song. 193 | ---@class renoise.GroupTrack : renoise.Track 194 | --- 195 | ---**READ-ONLY** All member tracks of this group, including subgroups and 196 | ---their tracks. 197 | ---@field members renoise.Track[] 198 | --- 199 | ---Collapsed/expanded visual appearance of whole group. 200 | ---@field group_collapsed boolean 201 | 202 | 203 | -------------------------------------------------------------------------------- 204 | ---## renoise.TrackDevice 205 | 206 | ---**Deprecated** Use `renoise.AudioDevice` instead. 207 | ---@deprecated 208 | ---@alias renoise.TrackDevice renoise.AudioDevice 209 | -------------------------------------------------------------------------------- /library/renoise/views/view.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | 11 | ---Unique identifier to resolve the view later on in the viewbuilder, 12 | ---e.g. `vb.views.SomeString` or `vb.views["Some String"]` 13 | ---View ids must be unique within a single view builder instance. 14 | ---@alias ViewId string 15 | 16 | ---The dimensions of a view has to be larger than 0. 17 | ---For nested views you can also specify relative size 18 | ---for example `vb:text { width = "80%"}`. The percentage values are 19 | ---relative to the view's parent size and will automatically update on size changes. 20 | ---@alias ViewDimension integer|string 21 | 22 | ---The dimensions of a view has to be larger than 0. 23 | ---For nested views you can also specify relative size, for example 24 | ---`vb:text { size = { width = "80%", height = 20}}`. 25 | ---The percentage values are relative to the view's parent size and will 26 | ---automatically update when the parent view's size changes. 27 | ---@alias ViewSize { width: ViewDimension, height: ViewDimension }|{ [1]:ViewDimension, [2]:ViewDimension } 28 | 29 | ---Horizontal (x) or Vertical (y) position of a view within its parent view. 30 | ---@alias ViewPosition integer 31 | 32 | ---The position of a view within its parent view. 33 | ---Only the `stack` layouts allows to freely position child views. Other 34 | ---layout views will automatically set the origin, but the origin 35 | ---then still can be read in for example mouse handlers. 36 | ---@alias ViewOrigin { x: ViewPosition, y: ViewPosition }|{ [1]:ViewPosition, [2]:ViewPosition } 37 | 38 | ---The cursor cursor for this view which apears on mouse hover. 39 | ---Using a "none" shape will use use underlying view's cursor or the default cursor. 40 | ---@alias ViewCursorShape 41 | ---|"none" 42 | ---|"empty" 43 | ---|"default" 44 | ---|"change_value" 45 | ---|"edit_text" 46 | ---|"pencil" 47 | ---|"marker" 48 | ---|"crosshair" 49 | ---|"move" 50 | ---|"erase" 51 | ---|"play" 52 | ---|"drag" 53 | ---|"drop" 54 | ---|"nodrop" 55 | ---|"busy" 56 | ---|"resize_vertical" 57 | ---|"resize_horizontal" 58 | ---|"resize_edge_vertical" 59 | ---|"resize_edge_horizontal" 60 | ---|"resize_edge_diagonal_left" 61 | ---|"resize_edge_diagonal_right" 62 | ---|"extend_left" 63 | ---|"extend_right" 64 | ---|"extend_top" 65 | ---|"extend_bottom" 66 | ---|"extend_left_alias" 67 | ---|"extend_right_alias" 68 | ---|"extend_top_alias" 69 | ---|"extend_bottom_alias" 70 | ---|"zoom_vertical" 71 | ---|"zoom_horizontal" 72 | ---|"zoom" 73 | 74 | ---A ViewTooltip text that should be shown for this view on mouse hover. 75 | ---* Default: "" (no tip will be shown) 76 | ---@alias ViewTooltip string 77 | 78 | ---Set visible to false to hide a view (make it invisible without removing 79 | ---it). Please note that view.visible will also return false when any of its 80 | ---parents are invisible (when its implicitly invisible). 81 | ---* Default: true 82 | ---@alias ViewVisibility boolean 83 | 84 | ---Setup a background style for the view. 85 | ---@alias ViewBackgroundStyle 86 | ---| "invisible" # no background (Default) 87 | ---| "plain" # undecorated, single coloured background 88 | ---| "border" # same as plain, but with a bold nested border 89 | ---| "body" # main "background" style, as used in dialog backgrounds 90 | ---| "panel" # alternative "background" style, beveled 91 | ---| "group" # background for "nested" groups within body 92 | 93 | -------------------------------------------------------------------------------- 94 | 95 | ---Event type of a `MouseEvent`. 96 | ---@alias MouseEventType 97 | ---|"enter" 98 | ---|"exit" 99 | ---|"move" 100 | ---|"down" 101 | ---|"up" 102 | ---|"double" 103 | ---|"drag" 104 | ---|"wheel" 105 | 106 | ---Mouse button of a `MouseEvent` of type "up"|"down"|"double"|"drag". 107 | ---@alias MouseEventButton 108 | ---|"left" 109 | ---|"right" 110 | ---|"middle" 111 | 112 | ---Mouse wheel direction in a `MouseEvent` of type "wheel". 113 | ---@alias MouseEventWheelDirection 114 | ---|"up" 115 | ---|"down" 116 | ---|"left" 117 | ---|"right" 118 | 119 | ---Mouse event as passed to a layout view's "mouse_handler" function. 120 | ---@class MouseEvent 121 | ---Mouse event type. Only enabled types are passed to the handler. 122 | ---@field type MouseEventType 123 | ---For "up"|"down"|"double"|"drag" events, the mouse button which got pressed, 124 | ---nil for all other events. 125 | ---@field button MouseEventButton? 126 | ---For "wheel" events, the wheel's direction, nil for all other events. 127 | ---@field direction MouseEventWheelDirection? 128 | ---Mouse cursor position in relative coordinates to the layout. 129 | ---@field position { x: number, y: number } 130 | ---Currently pressed (held down) keyboard modifier buttons. 131 | ---@field modifier_flags { shift: boolean, control: boolean, alt: boolean, meta: boolean } 132 | ---Currently pressed (held down) mouse buttons. 133 | ---@field button_flags { left: boolean, right: boolean, middle: boolean } 134 | ---List of sub views and possible layout subview's subviews, that are located below 135 | ---the mouse cursor. In other words: all views that are located below the mouse cursor. 136 | ---The list is orderd by containing the top-most visible view first, so you usually will 137 | ---need to check the first table entry only. 138 | --- 139 | ---NB: Only views that got created with the same view builder instance as the layout, 140 | ---and only subviews with valid viewbuilder "id"s will show up here! 141 | ---@field hover_views { id: string, view: renoise.Views.View }[] 142 | 143 | ---@alias MouseHandlerNotifierFunction fun(event: MouseEvent): MouseEvent? 144 | ---@alias MouseHandlerNotifierMemberFunction fun(self: NotifierMemberContext, event: MouseEvent): MouseEvent? 145 | ---@alias MouseHandlerNotifierMethod1 {[1]:NotifierMemberContext, [2]:MouseHandlerNotifierMemberFunction} 146 | ---@alias MouseHandlerNotifierMethod2 {[1]:MouseHandlerNotifierMemberFunction, [2]:NotifierMemberContext} 147 | ---Optional mouse event handler for a view. return nil when the event got handled 148 | ---to stop propagating the event. return the event instance, as passed, to pass it 149 | ---to the next view in the view hirarchy. 150 | ---@alias MouseHandler MouseHandlerNotifierFunction|MouseHandlerNotifierMethod1|MouseHandlerNotifierMethod2 151 | 152 | ---The mouse event types that should be passed to your `mouse_handler` function. 153 | ---By default: `{ "down", "up", "double" }` 154 | ---Avoid adding event types that you don't use, especially "move" events as they do 155 | ---create quite some overhead. Also note that when enabling "drag", sub view controls 156 | ---can no longer handle drag events, even when you pass back the event in the handler, 157 | ---so only enable it when you want to completely override mouse drag behavior of 158 | ---*all* your content views. 159 | ---@alias MouseEventTypes (MouseEventType[]) 160 | 161 | -------------------------------------------------------------------------------- 162 | 163 | ---TODO 164 | ---inheriting from 'table' is workaround here to allow up casting views to 165 | ---other views via e.g. @type or @cast 166 | 167 | ---View is the base class for all child views. All View properties can be 168 | ---applied to any of the following specialized views. 169 | ---@class renoise.Views.View : table 170 | ---@field visible ViewVisibility 171 | ---@field origin ViewOrigin 172 | ---**Deprecated.** Use property `size` instead. 173 | ---@field width ViewDimension 174 | ---**Deprecated.** Use property `size` instead. 175 | ---@field height ViewDimension 176 | ---@field size ViewSize 177 | ---@field tooltip ViewTooltip 178 | ---@field cursor ViewCursorShape 179 | ---**READ-ONLY** Empty for all controls, for layout views this contains the 180 | ---layout child views in the order they got added 181 | ---@field views renoise.Views.View[] 182 | local View = {} 183 | 184 | ---### functions 185 | 186 | ---Add a new child view to this view. 187 | ---@param child renoise.Views.View 188 | function View:add_view(child) end 189 | 190 | ---Remove a child view from this view. 191 | ---@param child renoise.Views.View 192 | function View:remove_view(child) end 193 | 194 | ---Swap position of two child views in this view. With a series of swaps views 195 | ---can be moved to any position in the parent. 196 | ---@param child1 renoise.Views.View 197 | ---@param child2 renoise.Views.View 198 | function View:swap_views(child1, child2) end 199 | 200 | ---**Deprecated.** Use `add_view` instead 201 | ---@deprecated 202 | ---@param child renoise.Views.View 203 | function View:add_child(child) end 204 | 205 | ---**Deprecated.** Use `remove_view` instead 206 | ---@deprecated 207 | ---@param child renoise.Views.View 208 | function View:remove_child(child) end 209 | 210 | ---**Deprecated.** Use `swap_views` instead 211 | ---@deprecated 212 | ---@param child1 renoise.Views.View 213 | ---@param child2 renoise.Views.View 214 | function View:swap_childs(child1, child2) end 215 | 216 | -------------------------------------------------------------------------------- 217 | 218 | --- Base for all View constructor tables in the viewbuilder. 219 | ---@class ViewProperties 220 | ---@field id ViewId? 221 | ---@field visible ViewVisibility? 222 | ---@field origin ViewOrigin? 223 | ---**Deprecated.** Use property `size` instead. 224 | ---@field width ViewDimension? 225 | ---**Deprecated.** Use property `size` instead. 226 | ---@field height ViewDimension? 227 | ---@field size ViewSize? 228 | ---@field tooltip ViewTooltip? 229 | ---@field cursor ViewCursorShape? 230 | -------------------------------------------------------------------------------- /library/renoise/viewbuilder.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | ---For a small tutorial and more details about how to create and use views, 9 | ---have a look at the "com.renoise.ExampleToolGUI.xrnx" tool. 10 | ---This tool is included in the scripting dev started pack at 11 | ---https://github.com/renoise/xrnx/ 12 | --- 13 | 14 | -------------------------------------------------------------------------------- 15 | ---## renoise.ViewBuilder 16 | 17 | ---@class renoise.ViewBuilder 18 | renoise.ViewBuilder = {} 19 | 20 | ---### constants 21 | 22 | ---Default sizes for views and view layouts. Should be used instead of magic 23 | ---numbers, also useful to inherit global changes from the main app. 24 | 25 | ---The default margin for all control views 26 | renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN = 4 27 | ---The default spacing for all control views 28 | renoise.ViewBuilder.DEFAULT_CONTROL_SPACING = 2 29 | ---The default height for control views 30 | renoise.ViewBuilder.DEFAULT_CONTROL_HEIGHT = 18 31 | ---The default height for mini-sliders 32 | renoise.ViewBuilder.DEFAULT_MINI_CONTROL_HEIGHT = 14 33 | ---The default margin for dialogs 34 | renoise.ViewBuilder.DEFAULT_DIALOG_MARGIN = 8 35 | ---The default spacing for dialogs 36 | renoise.ViewBuilder.DEFAULT_DIALOG_SPACING = 8 37 | ---The default height for buttons 38 | renoise.ViewBuilder.DEFAULT_DIALOG_BUTTON_HEIGHT = 22 39 | 40 | -------------------------------------------------------------------------------- 41 | 42 | ---Class which is used to construct new views. All view properties can optionally 43 | ---be in-lined in a passed construction table: 44 | ---```lua 45 | ---local vb = renoise.ViewBuilder() -- create a new ViewBuilder 46 | ---vb:button { text = "ButtonText" } -- is the same as 47 | ---my_button = vb:button(); my_button.text = "ButtonText" 48 | ---``` 49 | ---Besides the listed class properties, you can also specify the following 50 | ---"extra" properties in the passed table: 51 | --- 52 | ---* id = "SomeString": Can be use to resolve the view later on, e.g. 53 | --- `vb.views.SomeString` or `vb.views["SomeString"]` 54 | --- 55 | ---* Nested child views: Add child views to the currently specified view. 56 | --- 57 | ---### examples: 58 | ---```lua 59 | ----- creates a column view with `margin = 1` and adds two text views to the column. 60 | ---vb:column { 61 | --- margin = 1, 62 | --- views = { 63 | --- vb:text { 64 | --- text = "Text1" 65 | --- }, 66 | --- vb:text { 67 | --- text = "Text1" 68 | --- } 69 | --- } 70 | ---} 71 | ---``` 72 | ---@class renoise.ViewBuilder 73 | --- 74 | ---Table of views, which got registered via the "id" property 75 | ---View id is the table key, the table's value is the view's object. 76 | --- 77 | ---### examples: 78 | ---```lua 79 | ---vb:text { id="my_view", text="some_text"} 80 | ---vb.views.my_view.visible = false 81 | -----or 82 | ---vb.views["my_view"].visible = false 83 | ---``` 84 | ---@field views table 85 | renoise.ViewBuilder = {} 86 | 87 | ---Construct a new viewbuilder instance you can use to create views. 88 | ---@return renoise.ViewBuilder 89 | function renoise.ViewBuilder() end 90 | 91 | -------------------------------------------------------------------------------- 92 | 93 | ---You can add nested child views when constructing a column or row 94 | ---by including them in the constructor table in the views property. 95 | --- 96 | ---### examples: 97 | ---```lua 98 | ---vb:column { 99 | --- margin = 1, 100 | --- views = { 101 | --- vb:text { 102 | --- text = "Text1" 103 | --- }, 104 | --- vb:text { 105 | --- text = "Text2" 106 | --- } 107 | --- } 108 | ---} 109 | ---``` 110 | ---@see renoise.Views.Rack 111 | ---@alias RackConstructor fun(self : renoise.ViewBuilder, properties : RackViewProperties?) : renoise.Views.Rack 112 | 113 | ---@type RackConstructor 114 | function renoise.ViewBuilder:column(properties) end 115 | 116 | ---@type RackConstructor 117 | function renoise.ViewBuilder:row(properties) end 118 | 119 | ---You can add nested child views when constructing aligners by including them 120 | ---in the constructor table. 121 | --- 122 | ---### examples: 123 | ---```lua 124 | ---vb:horizontal_aligner { 125 | --- mode = "center", 126 | --- views = { 127 | --- vb:text { 128 | --- text = "Text1" 129 | --- }, 130 | --- vb:text { 131 | --- text = "Text2" 132 | --- } 133 | --- } 134 | ---} 135 | ---``` 136 | ---@see renoise.Views.Aligner 137 | ---@alias AlignerConstructor fun(self : renoise.ViewBuilder, properties : AlignerViewProperties?) : renoise.Views.Aligner 138 | 139 | ---@type AlignerConstructor 140 | function renoise.ViewBuilder:horizontal_aligner(properties) end 141 | 142 | ---@type AlignerConstructor 143 | function renoise.ViewBuilder:vertical_aligner(properties) end 144 | 145 | ---You can add nested child views when constructing stacks by including them 146 | ---in the constructor table. Use the view property `origin` to position them 147 | ---in the stack. 148 | --- 149 | ---```lua 150 | -----Stack multiple views 151 | ---vb:stack { 152 | --- views = { 153 | --- vb:text { 154 | --- origin = { 10, 10 }, 155 | --- text = "Text1" 156 | --- }, 157 | --- vb:text { 158 | --- origin = { 100, 20 }, 159 | --- text = "Text 2" 160 | --- } 161 | --- } 162 | ---} 163 | ---``` 164 | ---@see renoise.Views.Stack 165 | ---@param properties StackViewProperties? 166 | ---@return renoise.Views.Stack 167 | function renoise.ViewBuilder:stack(properties) end 168 | 169 | ---You can create an empty space in layouts with a space. 170 | --- 171 | ---### examples: 172 | ---```lua 173 | -----Empty space in layouts 174 | ---vb:row { 175 | --- views = { 176 | --- vb:button { 177 | --- text = "Some Button" 178 | --- }, 179 | --- vb:space { -- extra spacing between buttons 180 | --- width = 8 181 | --- }, 182 | --- vb:button { 183 | --- text = "Another Button" 184 | --- }, 185 | --- } 186 | ---} 187 | ---``` 188 | ---@see renoise.Views.View 189 | ---@alias SpaceConstructor fun(self : renoise.ViewBuilder, properties : ViewProperties?) : renoise.Views.View 190 | 191 | ---@type SpaceConstructor 192 | function renoise.ViewBuilder:space(properties) end 193 | 194 | ---@see renoise.Views.Canvas 195 | ---@param properties CanvasViewProperties? 196 | ---@return renoise.Views.Canvas 197 | function renoise.ViewBuilder:canvas(properties) end 198 | 199 | ---@see renoise.Views.Text 200 | ---@param properties TextViewProperties? 201 | ---@return renoise.Views.Text 202 | function renoise.ViewBuilder:text(properties) end 203 | 204 | ---@see renoise.Views.MultiLineText 205 | ---@param properties MultilineTextViewProperties? 206 | ---@return renoise.Views.MultiLineText 207 | function renoise.ViewBuilder:multiline_text(properties) end 208 | 209 | ---@see renoise.Views.TextField 210 | ---@param properties TextFieldProperties? 211 | ---@return renoise.Views.TextField 212 | function renoise.ViewBuilder:textfield(properties) end 213 | 214 | ---@see renoise.Views.MultiLineTextField 215 | ---@param properties MultilineTextFieldProperties? 216 | ---@return renoise.Views.MultiLineTextField 217 | function renoise.ViewBuilder:multiline_textfield(properties) end 218 | 219 | ---@see renoise.Views.TextLink 220 | ---@param properties TextLinkViewProperties? 221 | ---@return renoise.Views.TextLink 222 | function renoise.ViewBuilder:link(properties) end 223 | 224 | ---@see renoise.Views.Bitmap 225 | ---@param properties BitmapViewProperties? 226 | ---@return renoise.Views.Bitmap 227 | function renoise.ViewBuilder:bitmap(properties) end 228 | 229 | ---@see renoise.Views.Button 230 | ---@param properties ButtonProperties? 231 | ---@return renoise.Views.Button 232 | function renoise.ViewBuilder:button(properties) end 233 | 234 | ---@see renoise.Views.CheckBox 235 | ---@param properties CheckBoxProperties? 236 | ---@return renoise.Views.CheckBox 237 | function renoise.ViewBuilder:checkbox(properties) end 238 | 239 | ---@see renoise.Views.Switch 240 | ---@param properties ButtonSwitchProperties? 241 | ---@return renoise.Views.Switch 242 | function renoise.ViewBuilder:switch(properties) end 243 | 244 | ---@see renoise.Views.Popup 245 | ---@param properties PopUpMenuProperties? 246 | ---@return renoise.Views.Popup 247 | function renoise.ViewBuilder:popup(properties) end 248 | 249 | ---@see renoise.Views.Chooser 250 | ---@param properties ChooserProperties? 251 | ---@return renoise.Views.Chooser 252 | function renoise.ViewBuilder:chooser(properties) end 253 | 254 | ---@see renoise.Views.ValueBox 255 | ---@param properties ValueBoxProperties? 256 | ---@return renoise.Views.ValueBox 257 | function renoise.ViewBuilder:valuebox(properties) end 258 | 259 | ---@see renoise.Views.Value 260 | ---@param properties ValueViewProperties? 261 | ---@return renoise.Views.Value 262 | function renoise.ViewBuilder:value(properties) end 263 | 264 | ---@see renoise.Views.ValueField 265 | ---@param properties ValueFieldProperties? 266 | ---@return renoise.Views.ValueField 267 | function renoise.ViewBuilder:valuefield(properties) end 268 | 269 | ---@see renoise.Views.ScrollBar 270 | ---@param properties ScrollBarProperties? 271 | ---@return renoise.Views.ScrollBar 272 | function renoise.ViewBuilder:scrollbar(properties) end 273 | 274 | ---@see renoise.Views.Slider 275 | ---@param properties SliderProperties? 276 | ---@return renoise.Views.Slider 277 | function renoise.ViewBuilder:slider(properties) end 278 | 279 | ---@see renoise.Views.MiniSlider 280 | ---@param properties MiniSliderProperties? 281 | ---@return renoise.Views.MiniSlider 282 | function renoise.ViewBuilder:minislider(properties) end 283 | 284 | ---@see renoise.Views.RotaryEncoder 285 | ---@param properties RotaryEncoderProperties? 286 | ---@return renoise.Views.RotaryEncoder 287 | function renoise.ViewBuilder:rotary(properties) end 288 | 289 | ---@see renoise.Views.XYPad 290 | ---@param properties XYPadProperties? 291 | ---@return renoise.Views.XYPad 292 | function renoise.ViewBuilder:xypad(properties) end 293 | -------------------------------------------------------------------------------- /library/renoise/song/transport.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.Transport 11 | 12 | ---Transport component of the Renoise song. 13 | ---@class renoise.Transport 14 | renoise.Transport = {} 15 | 16 | ---### constants 17 | 18 | ---@enum renoise.Transport.PlayMode 19 | ---@diagnostic disable-next-line: missing-fields 20 | renoise.Transport = { 21 | PLAYMODE_RESTART_PATTERN = 1, 22 | PLAYMODE_CONTINUE_PATTERN = 2 23 | } 24 | 25 | ---@enum renoise.Transport.RecordParameterMode 26 | ---@diagnostic disable-next-line: missing-fields 27 | renoise.Transport = { 28 | RECORD_PARAMETER_MODE_PATTERN = 1, 29 | RECORD_PARAMETER_MODE_AUTOMATION = 2, 30 | } 31 | 32 | ---@enum renoise.Transport.TimingModel 33 | ---@diagnostic disable-next-line: missing-fields 34 | renoise.Transport = { 35 | TIMING_MODEL_SPEED = 1, 36 | TIMING_MODEL_LPB = 2 37 | } 38 | 39 | ---@enum renoise.Transport.SyncMode 40 | ---@diagnostic disable-next-line: missing-fields 41 | renoise.Transport = { 42 | SYNC_MODE_INTERNAL = 1, 43 | SYNC_MODE_MIDI_CLOCK = 2, 44 | SYNC_MODE_ABLETON_LINK = 3, 45 | SYNC_MODE_JACK = 4 46 | } 47 | 48 | ---### properties 49 | 50 | ---@class renoise.Transport 51 | --- 52 | ---Playing 53 | ---@field playing boolean 54 | ---@field playing_observable renoise.Document.Observable 55 | --- 56 | ---Transport sync mode. 57 | ---Note: `SYNC_MODE_JACK` only is available on Linux. Trying to enable it on 58 | ---other platforms will fire an error. 59 | ---@field sync_mode renoise.Transport.SyncMode 60 | ---@field sync_mode_observable renoise.Document.Observable 61 | --- 62 | ---*READ-ONLY* Old school speed or new LPB timing used? 63 | ---With `TIMING_MODEL_SPEED`, tpl is used as speed factor. The lpb property 64 | ---is unused then. With `TIMING_MODEL_LPB`, tpl is used as event rate for effects 65 | ---only and lpb defines relationship between pattern lines and beats. 66 | ---@field timing_model renoise.Transport.TimingModel 67 | --- 68 | ---BPM, LPB, and TPL 69 | ---@field bpm number Range: (32 - 999) Beats per Minute 70 | ---@field bpm_observable renoise.Document.Observable 71 | ---@field lpb integer Range: (1 - 256) Lines per Beat 72 | ---@field lpb_observable renoise.Document.Observable 73 | ---@field tpl integer Range: (1 - 16) Ticks per Line 74 | ---@field tpl_observable renoise.Document.Observable 75 | --- 76 | ---Playback position 77 | ---@field playback_pos renoise.SongPos 78 | ---@field playback_pos_beats number Range: (0 - song_end_beats) Song position in beats 79 | --- 80 | ---Edit position 81 | ---@field edit_pos renoise.SongPos 82 | ---@field edit_pos_beats number Range: (0 - song_end_beats) Song position in beats 83 | --- 84 | ---Song length 85 | ---@field song_length renoise.SongPos **READ-ONLY** 86 | ---@field song_length_beats number **READ-ONLY** 87 | --- 88 | ---Loop 89 | ---@field loop_start renoise.SongPos **READ-ONLY** 90 | ---@field loop_end renoise.SongPos **READ-ONLY** 91 | ---@field loop_range renoise.SongPos[] {loop start, loop end} 92 | ---@field loop_start_beats number **READ-ONLY** Range: (0 - song_end_beats) 93 | ---@field loop_end_beats number **READ-ONLY** Range: (0 - song_end_beats) 94 | ---@field loop_range_beats number[] {loop start beats, loop end beats} 95 | --- 96 | ---@field loop_sequence_start integer **READ-ONLY** 0 or Range: (1 - sequence length) 97 | ---@field loop_sequence_end integer **READ-ONLY** 0 or Range: (1 - sequence length) 98 | ---@field loop_sequence_range integer[] {} or Range(sequence start, sequence end) 99 | --- 100 | ---@field loop_pattern boolean Pattern Loop On/Off 101 | ---@field loop_pattern_observable renoise.Document.Observable 102 | --- 103 | ---@field loop_block_enabled boolean Block Loop On/Off 104 | ---@field loop_block_enabled_observable renoise.Document.Observable 105 | ---@field loop_block_range_coeff integer Range: (2 - 16) 106 | ---@field loop_block_range_coeff_observable renoise.Document.Observable 107 | --- 108 | ---@field loop_block_start_pos renoise.SongPos Start of block loop 109 | --- 110 | ---Edit modes 111 | ---@field edit_mode boolean Pattern edit/record mode On/Off 112 | ---@field edit_mode_observable renoise.Document.Observable 113 | ---@field edit_step integer Range: (0 - 64) 114 | ---@field edit_step_observable renoise.Document.Observable 115 | --- 116 | ---@field octave integer Range: (0 - 8) 117 | ---@field octave_observable renoise.Document.Observable 118 | ---@field octave_enabled boolean Enabled for MIDI keyboards 119 | ---@field octave_enabled_observable renoise.Document.Observable 120 | --- 121 | ---Metronome 122 | ---@field metronome_enabled boolean Metronome playback On/Off 123 | ---@field metronome_enabled_observable renoise.Document.Observable 124 | ---@field metronome_beats_per_bar integer Range: (1 - 16) or 0 = guess from pattern length 125 | ---@field metronome_beats_per_bar_observable renoise.Document.Observable 126 | ---@field metronome_lines_per_beat integer Range: (1 - 256) or 0 = songs current LPB 127 | ---@field metronome_lines_per_beat_observable renoise.Document.Observable 128 | --- 129 | ---Metronome precount 130 | ---@field metronome_precount_enabled boolean Metronome precount playback On/Off 131 | ---@field metronome_precount_enabled_observable renoise.Document.Observable 132 | ---@field metronome_precount_bars integer Range: (1 - 4) 133 | ---@field metronome_precount_bars_observable renoise.Document.Observable 134 | ---@field metronome_volume number Range: (0 - math.db2lin(6)) 135 | ---@field metronome_volume_observable renoise.Document.Observable 136 | --- 137 | ---Quantize 138 | ---@field record_quantize_enabled boolean Record note quantization On/Off 139 | ---@field record_quantize_enabled_observable renoise.Document.Observable 140 | ---@field record_quantize_lines integer Range: (1 - 32) 141 | ---@field record_quantize_lines_observable renoise.Document.Observable 142 | --- 143 | ---Record parameter 144 | ---@field record_parameter_mode renoise.Transport.RecordParameterMode 145 | ---@field record_parameter_mode_observable renoise.Document.Observable 146 | --- 147 | ---Follow, wrapped pattern, single track modes 148 | ---@field follow_player boolean 149 | ---@field follow_player_observable renoise.Document.Observable 150 | ---@field wrapped_pattern_edit boolean 151 | ---@field wrapped_pattern_edit_observable renoise.Document.Observable 152 | ---@field single_track_edit_mode boolean 153 | ---@field single_track_edit_mode_observable renoise.Document.Observable 154 | --- 155 | ---Groove (aka Shuffle) 156 | ---@field groove_enabled boolean 157 | ---@field groove_enabled_observable renoise.Document.Observable 158 | ---@field groove_amounts number[] table with 4 numbers in Range: (0 - 1) 159 | ---Will be called as soon as any groove value changed. 160 | ---@field groove_assignment_observable renoise.Document.Observable 161 | --- 162 | ---Global Track Headroom 163 | ---To convert to dB: `dB = math.lin2db(renoise.Transport.track_headroom)` 164 | ---To convert from dB: `renoise.Transport.track_headroom = math.db2lin(dB)` 165 | ---Range: (math.db2lin(-12) - math.db2lin(0)) 166 | ---@field track_headroom number 167 | ---@field track_headroom_observable renoise.Document.Observable 168 | --- 169 | ---Computer Keyboard Velocity. 170 | ---@field keyboard_velocity_enabled boolean 171 | ---@field keyboard_velocity_enabled_observable renoise.Document.Observable 172 | ---Will return the default value of 127 when keyboard_velocity_enabled == false. 173 | ---Range: (0 - 127) 174 | ---@field keyboard_velocity integer 175 | ---@field keyboard_velocity_observable renoise.Document.Observable 176 | --- 177 | ---*READ-ONLY* true when sample sample dialog is visible and recording started. 178 | ---@field sample_recording boolean 179 | ---Sample recording pattern quantization On/Off. 180 | ---@field sample_recording_sync_enabled boolean 181 | ---@field sample_recording_sync_enabled_observable renoise.Document.Observable 182 | 183 | ---### functions 184 | 185 | ---Panic. 186 | function renoise.Transport:panic() end 187 | 188 | ---Start playing in song or pattern mode. 189 | ---@param mode renoise.Transport.PlayMode 190 | function renoise.Transport:start(mode) end 191 | 192 | ---Start playing the currently edited pattern at the given line offset 193 | ---@param line integer 194 | function renoise.Transport:start_at(line) end 195 | 196 | ---Start playing a the given renoise.SongPos (sequence pos and line) 197 | ---@param song_pos renoise.SongPos 198 | function renoise.Transport:start_at(song_pos) end 199 | 200 | ---Stop playing. When already stopped this just stops all playing notes. 201 | function renoise.Transport:stop() end 202 | 203 | ---Immediately start playing at the given sequence position. 204 | ---@param sequence_pos integer 205 | function renoise.Transport:trigger_sequence(sequence_pos) end 206 | 207 | ---Append the sequence to the scheduled sequence list. Scheduled playback 208 | ---positions will apply as soon as the currently playing pattern play to end. 209 | ---@param sequence_pos integer 210 | function renoise.Transport:add_scheduled_sequence(sequence_pos) end 211 | 212 | ---Replace the scheduled sequence list with the given sequence. 213 | ---@param sequence_pos integer 214 | function renoise.Transport:set_scheduled_sequence(sequence_pos) end 215 | 216 | ---Move the block loop one segment forwards, when possible. 217 | function renoise.Transport:loop_block_move_forwards() end 218 | 219 | ---Move the block loop one segment backwards, when possible. 220 | function renoise.Transport:loop_block_move_backwards() end 221 | 222 | ---Start a new sample recording when the sample dialog is visible. 223 | function renoise.Transport:start_sample_recording() end 224 | 225 | ---Stop sample recording when the sample dialog is visible and running 226 | function renoise.Transport:stop_sample_recording() end 227 | 228 | ---**Deprecated.** Use `start_sample_recording` or `stop_sample_recording` instead. 229 | ---@deprecated 230 | function renoise.Transport:start_stop_sample_recording() end 231 | 232 | ---Cancel a currently running sample recording when the sample dialog 233 | ---is visible, otherwise do nothing. 234 | function renoise.Transport:cancel_sample_recording() end 235 | -------------------------------------------------------------------------------- /library/renoise/song/instrument/phrase.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | 9 | -------------------------------------------------------------------------------- 10 | ---## renoise.InstrumentPhrase 11 | 12 | ---@class renoise.InstrumentPhrase 13 | renoise.InstrumentPhrase = {} 14 | 15 | ---### constants 16 | 17 | ---Maximum number of lines that can be present in a phrase. 18 | renoise.InstrumentPhrase.MAX_NUMBER_OF_LINES = 512 19 | 20 | ---Min/Maximum number of note columns that can be present in a phrase. 21 | renoise.InstrumentPhrase.MIN_NUMBER_OF_NOTE_COLUMNS = 1 22 | renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS = 12 23 | 24 | ---Min/Maximum number of effect columns that can be present in a phrase. 25 | renoise.InstrumentPhrase.MIN_NUMBER_OF_EFFECT_COLUMNS = 0 26 | renoise.InstrumentPhrase.MAX_NUMBER_OF_EFFECT_COLUMNS = 8 27 | 28 | ---@enum renoise.InstrumentPhrase.KeyTrackingMode 29 | ---@diagnostic disable-next-line: missing-fields 30 | renoise.InstrumentPhrase = { 31 | ---Every note plays back the phrase unpitched from line 1. 32 | KEY_TRACKING_NONE = 1, 33 | ---Play the phrase transposed relative to the phrase's base_note. 34 | KEY_TRACKING_TRANSPOSE = 2, 35 | ---Trigger phrase from the beginning (note_range start) up to the end (note_range end). 36 | KEY_TRACKING_OFFSET = 3, 37 | } 38 | 39 | ---@enum renoise.InstrumentPhrase.PlaybackMode 40 | ---@diagnostic disable-next-line: missing-fields 41 | renoise.InstrumentPhrase = { 42 | ---Play/edit phrase pattern 43 | PLAY_PATTERN = 1, 44 | ---Play/edit phrase script 45 | PLAY_SCRIPT = 2, 46 | } 47 | 48 | ---### properties 49 | 50 | ---General remarks: Phrases do use renoise.PatternLine objects just like the 51 | ---pattern tracks do. When the instrument column is enabled and used, 52 | ---not instruments, but samples are addressed/triggered in phrases. 53 | ---@class renoise.InstrumentPhrase 54 | --- 55 | ---Name of the phrase as visible in the phrase editor and piano mappings. 56 | ---@field name string 57 | ---@field name_observable renoise.Document.Observable 58 | --- 59 | ---(Key)Mapping properties of the phrase or nil when no mapping is present. 60 | ---@field mapping renoise.InstrumentPhraseMapping? 61 | --- 62 | ---playback mode 63 | ---@field playback_mode renoise.InstrumentPhrase.PlaybackMode 64 | ---@field playback_mode_observable renoise.Document.Observable 65 | --- 66 | ---**READ-ONLY** Phrase script properties. Only used when `playback_mode` is 67 | ---set to `renoise.InstrumentPhrase.PLAY_SCRIPT` 68 | ---@field script renoise.InstrumentPhraseScript 69 | --- 70 | ---**READ-ONLY** 71 | ---Quickly check if a phrase has some non empty pattern lines. 72 | ---@field is_empty boolean 73 | ---@field is_empty_observable renoise.Document.Observable 74 | --- 75 | ---Default: 16, Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_LINES) 76 | ---Number of lines the phrase currently has. 77 | ---@field number_of_lines integer 78 | ---@field number_of_lines_observable renoise.Document.Observable 79 | --- 80 | ---**READ-ONLY** Get all lines in a range [1, number_of_lines_in_pattern] 81 | ---@field lines renoise.PatternLine[] 82 | --- 83 | ---Range: (MIN_NUMBER_OF_NOTE_COLUMNS - MAX_NUMBER_OF_NOTE_COLUMNS) 84 | ---How many note columns are visible in the phrase. 85 | ---@field visible_note_columns integer 86 | ---@field visible_note_columns_observable renoise.Document.Observable 87 | --- 88 | ---Range: (MIN_NUMBER_OF_EFFECT_COLUMNS - MAX_NUMBER_OF_EFFECT_COLUMNS) 89 | ---How many effect columns are visible in the phrase. 90 | ---@field visible_effect_columns integer 91 | ---@field visible_effect_columns_observable renoise.Document.Observable 92 | --- 93 | ---Phrase's key-tracking mode. 94 | ---@field key_tracking renoise.InstrumentPhrase.KeyTrackingMode 95 | ---@field key_tracking_observable renoise.Document.Observable 96 | --- 97 | ---Range: (0 - 119) where C-4 is 48 98 | ---Phrase's base-note. Only relevant when key_tracking is set to transpose. 99 | ---@field base_note integer 100 | ---@field base_note_observable renoise.Document.Observable 101 | --- 102 | ---Loop mode. The phrase plays as one-shot when disabled. 103 | ---@field looping boolean 104 | ---@field looping_observable renoise.Document.Observable 105 | --- 106 | ---Range: (1 - number_of_lines) 107 | ---Loop start. Playback will start from the beginning before entering loop 108 | ---@field loop_start integer 109 | ---@field loop_start_observable renoise.Document.Observable 110 | --- 111 | ---Range: (loop_start - number_of_lines) 112 | ---Loop end. Needs to be > loop_start and <= number_of_lines 113 | ---@field loop_end integer 114 | ---@field loop_end_observable renoise.Document.Observable 115 | --- 116 | ---Phrase autoseek settings 117 | ---@field autoseek boolean 118 | ---@field autoseek_observable renoise.Document.Observable 119 | --- 120 | ---Range: (1 - 256) 121 | ---Phrase local lines per beat setting. New phrases get initialized with 122 | ---the song's current LPB setting. TPL can not be configured in phrases. 123 | ---@field lpb integer 124 | ---@field lpb_observable renoise.Document.Observable 125 | --- 126 | ---Range: (0 - 1) 127 | ---Shuffle groove amount for a phrase. 128 | ---0.0 = no shuffle (off), 1.0 = full shuffle 129 | ---@field shuffle number 130 | ---@field shuffle_observable renoise.Document.Observable 131 | --- 132 | ---Column visibility. 133 | ---@field instrument_column_visible boolean 134 | ---@field instrument_column_visible_observable renoise.Document.Observable 135 | --- 136 | ---@field volume_column_visible boolean 137 | ---@field volume_column_visible_observable renoise.Document.Observable 138 | --- 139 | ---@field panning_column_visible boolean 140 | ---@field panning_column_visible_observable renoise.Document.Observable 141 | --- 142 | ---@field delay_column_visible boolean 143 | ---@field delay_column_visible_observable renoise.Document.Observable 144 | --- 145 | ---@field sample_effects_column_visible boolean 146 | ---@field sample_effects_column_visible_observable renoise.Document.Observable 147 | 148 | 149 | ---### functions 150 | 151 | ---Deletes all lines. 152 | function renoise.InstrumentPhrase:clear() end 153 | 154 | ---Copy contents from another phrase. 155 | ---@param phrase renoise.InstrumentPhrase 156 | function renoise.InstrumentPhrase:copy_from(phrase) end 157 | 158 | ---Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_LINES) 159 | ---Access to a single line by index. Line must be in Range: (1 - MAX_NUMBER_OF_LINES). 160 | ---This is a !lot! more efficient than calling the property: lines[index] to 161 | ---randomly access lines. 162 | ---@param index integer 163 | ---@return renoise.PatternLine 164 | function renoise.InstrumentPhrase:line(index) end 165 | 166 | ---Get a specific line range 167 | ---@param index_from integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_LINES) 168 | ---@param index_to integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_LINES) 169 | ---@return renoise.PatternLine[] 170 | function renoise.InstrumentPhrase:lines_in_range(index_from, index_to) end 171 | 172 | ---Line iterator position. 173 | ---@class PhraseLinePosition 174 | ---@field line integer 175 | 176 | ---@alias PhraseLineChangeCallback fun(pos: PhraseLinePosition) 177 | ---@alias PhraseLineChangeCallbackWithContext fun(obj: table|userdata, pos: PhraseLinePosition) 178 | 179 | ---Check/add/remove notifier functions or methods, which are called by 180 | ---Renoise as soon as any of the phrases's lines have changed. 181 | ---@see renoise.Pattern.has_line_notifier for more details. 182 | ---@param func PhraseLineChangeCallbackWithContext 183 | ---@param obj table|userdata 184 | ---@return boolean 185 | ---@overload fun(self, func: PhraseLineChangeCallback): boolean 186 | function renoise.InstrumentPhrase:has_line_notifier(func, obj) end 187 | 188 | ---@param func PhraseLineChangeCallbackWithContext 189 | ---@param obj table|userdata 190 | ---@overload fun(self, func: PhraseLineChangeCallback) 191 | function renoise.InstrumentPhrase:add_line_notifier(func, obj) end 192 | 193 | ---@param func PhraseLineChangeCallbackWithContext 194 | ---@param obj table|userdata 195 | ---@overload fun(self, func: PhraseLineChangeCallback) 196 | function renoise.InstrumentPhrase:remove_line_notifier(func, obj) end 197 | 198 | ---Same as line_notifier above, but the notifier only fires when the user 199 | ---added, changed or deleted a line with the computer keyboard. 200 | ---@see renoise.Pattern.has_line_editoed_notifier for more details. 201 | ---@param func PhraseLineChangeCallbackWithContext 202 | ---@param obj table|userdata 203 | ---@return boolean 204 | ---@overload fun(self, func: PhraseLineChangeCallback): boolean 205 | function renoise.InstrumentPhrase:has_line_edited_notifier(func, obj) end 206 | 207 | ---@param func PhraseLineChangeCallbackWithContext 208 | ---@param obj table|userdata 209 | ---@overload fun(self, func: PhraseLineChangeCallback) 210 | function renoise.InstrumentPhrase:add_line_edited_notifier(func, obj) end 211 | 212 | ---@param func PhraseLineChangeCallbackWithContext 213 | ---@param obj table|userdata 214 | ---@overload fun(self, func: PhraseLineChangeCallback) 215 | function renoise.InstrumentPhrase:remove_line_edited_notifier(func, obj) end 216 | 217 | ---Note column mute states. 218 | ---@param column integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 219 | ---@return boolean 220 | function renoise.InstrumentPhrase:column_is_muted(column) end 221 | 222 | ---@param column integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 223 | ---@return renoise.Document.Observable 224 | function renoise.InstrumentPhrase:column_is_muted_observable(column) end 225 | 226 | ---@param column integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 227 | ---@param muted boolean 228 | function renoise.InstrumentPhrase:set_column_is_muted(column, muted) end 229 | 230 | ---Note column names. 231 | ---@param column integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 232 | ---@return string 233 | function renoise.InstrumentPhrase:column_name(column) end 234 | 235 | ---@param column integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 236 | ---@return renoise.Document.Observable 237 | function renoise.InstrumentPhrase:column_name_observable(column) end 238 | 239 | ---@param column integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 240 | ---@param name string 241 | function renoise.InstrumentPhrase:set_column_name(column, name) end 242 | 243 | ---Swap the positions of two note columns within a phrase. 244 | ---@param index1 integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 245 | ---@param index2 integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 246 | function renoise.InstrumentPhrase:swap_note_columns_at(index1, index2) end 247 | 248 | ---Swap the positions of two effect columns within a phrase. 249 | ---@param index1 integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 250 | ---@param index2 integer Range: (1 - renoise.InstrumentPhrase.MAX_NUMBER_OF_NOTE_COLUMNS) 251 | function renoise.InstrumentPhrase:swap_effect_columns_at(index1, index2) end 252 | 253 | --### operators 254 | 255 | ---Compares line content. All other properties are ignored. 256 | ---operator==(phrase, phrase): boolean 257 | ---operator~=(phrase, phrase): boolean 258 | 259 | -------------------------------------------------------------------------------- 260 | ---## renoise.InstrumentPhraseMapping 261 | 262 | ---@class renoise.InstrumentPhraseMapping 263 | renoise.InstrumentPhraseMapping = {} 264 | 265 | ---### constants 266 | 267 | ---@enum renoise.InstrumentPhraseMapping.KeyTrackingMode 268 | ---@diagnostic disable-next-line: missing-fields 269 | renoise.InstrumentPhraseMapping = { 270 | ---Every note plays back the phrase unpitched from line 1. 271 | KEY_TRACKING_NONE = 1, 272 | ---Play the phrase transposed relative to the phrase's base_note. 273 | KEY_TRACKING_TRANSPOSE = 2, 274 | ---Trigger phrase from the beginning (note_range start) up to the end (note_range end). 275 | KEY_TRACKING_OFFSET = 3, 276 | } 277 | 278 | ---### properties 279 | 280 | ---@class renoise.InstrumentPhraseMapping 281 | --- 282 | ---Linked phrase. 283 | ---@field phrase renoise.InstrumentPhrase 284 | --- 285 | ---Phrase's key-tracking mode. 286 | ---@field key_tracking renoise.InstrumentPhraseMapping.KeyTrackingMode 287 | ---@field key_tracking_observable renoise.Document.Observable 288 | --- 289 | ---Phrase's base-note. Only relevant when key_tracking is set to transpose. 290 | ---@field base_note integer Range: (0 - 119) where C-4 is 48 291 | ---@field base_note_observable renoise.Document.Observable 292 | --- 293 | ---Note range the mapping is triggered at. Phrases may not overlap, so 294 | ---note_range start can only be set behind previous's (if any) end and 295 | ---note_range end can only be set before next mapping's (if any) start. 296 | ---@field note_range integer[] Range: (0 - 119) where C-4 is 48 297 | ---@field note_range_observable renoise.Document.Observable 298 | --- 299 | ---Loop mode. The phrase plays as one-shot when disabled. 300 | ---@field looping boolean 301 | ---@field looping_observable renoise.Document.Observable 302 | --- 303 | ---@field loop_start integer 304 | ---@field loop_start_observable renoise.Document.Observable 305 | --- 306 | ---@field loop_end integer 307 | ---@field loop_end_observable renoise.Document.Observable 308 | -------------------------------------------------------------------------------- /library/renoise/socket.lua: -------------------------------------------------------------------------------- 1 | ---@meta 2 | error("Do not try to execute this file. It's just a type definition file.") 3 | --- 4 | ---Please read the introduction at https://github.com/renoise/xrnx/ 5 | ---to get an overview about the complete API, and scripting for 6 | ---Renoise in general... 7 | --- 8 | ---For examples on how to use sockets, have across look at the code snippets in 9 | ---the Renoise Documentation "Snippets/Socket.lua" 10 | --- 11 | 12 | -------------------------------------------------------------------------------- 13 | ---## renoise.Socket 14 | 15 | ---Interfaces for built-in socket support for Lua scripts in Renoise. 16 | --- 17 | ---Right now UDP and TCP protocols are supported. The class interfaces for UDP 18 | ---and TCP sockets behave exactly the same. That is, they don't depend on the 19 | ---protocol, so both are easily interchangeable when needed. 20 | ---@class renoise.Socket 21 | renoise.Socket = {} 22 | 23 | ---### error handling 24 | 25 | ---All socket functions which can fail, will return an error string as an optional 26 | ---second return value. They do not call Lua's error() handler, so you can decide 27 | ---yourself how to deal with expected errors like connection timeouts, 28 | ---connection failures, and so on. This also means you don't have to "pcall" 29 | ---socket functions to handle such "expected" errors. 30 | --- 31 | ---Logic errors (setting invalid addresses, using disconnected sockets, passing 32 | ---invalid timeouts, and so on) will fire Lua's runtime error (abort your scripts 33 | ---and spit out an error). If you get such an error, then this usually means you 34 | ---did something wrong: fed or used the sockets in a way that does not make sense. 35 | ---Never "pcall" such errors, fix the problem instead. 36 | 37 | ---### constants 38 | 39 | ---@enum renoise.Socket.Protocol 40 | ---@diagnostic disable-next-line: missing-fields 41 | renoise.Socket = { 42 | PROTOCOL_TCP = 1, 43 | PROTOCOL_UDP = 2 44 | } 45 | 46 | ------ Creating Socket Servers 47 | 48 | ---Creates a connected UPD or TCP server object. Use "localhost" to use your 49 | ---system's default network address. Protocol can be `renoise.Socket.PROTOCOL_TCP` 50 | ---or `renoise.Socket.PROTOCOL_UDP` (by default TCP). 51 | ---When instantiation and connection succeed, a valid server object is 52 | ---returned, otherwise "error" is set and the server object is nil. 53 | ---Using the create function with no server_address allows you to create a 54 | ---server which allows connections to any address (for example localhost 55 | ---and some IP) 56 | ---@param server_address string 57 | ---@param server_port integer 58 | ---@param protocol renoise.Socket.Protocol? Default: renoise.Socket.PROTOCOL_TCP 59 | ---@overload fun(server_port: integer, protocol: renoise.Socket.Protocol?):renoise.Socket.SocketServer?, string? 60 | ---@return renoise.Socket.SocketServer?, string? 61 | function renoise.Socket.create_server(server_address, server_port, protocol) end 62 | 63 | ---Create a connected UPD or TCP client. 64 | ---`protocol` can be `renoise.Socket.PROTOCOL_TCP` or 65 | ---`renoise.Socket.PROTOCOL_UDP` (by default TCP). 66 | ---`timeout` is the time in ms to wait until the connection is established 67 | ---(1000 ms by default). When instantiation and connection succeed, a valid client 68 | ---object is returned, otherwise "error" is set and the client object is nil 69 | ---@param server_address string 70 | ---@param server_port integer 71 | ---@param protocol renoise.Socket.Protocol? Default: renoise.Socket.PROTOCOL_TCP 72 | ---@param timeout integer? Default: 1000 73 | ---@return renoise.Socket.SocketClient? client, string? error 74 | function renoise.Socket.create_client(server_address, server_port, protocol, timeout) end 75 | 76 | -------------------------------------------------------------------------------- 77 | ---## renoise.Socket.SocketBase 78 | 79 | ---SocketBase is the base class for socket clients and servers. All 80 | ---SocketBase properties and functions are available for servers and clients. 81 | ---@class renoise.Socket.SocketBase 82 | --- 83 | ---**READ-ONLY** Returns true when the socket object is valid and connected. 84 | ---Sockets can manually be closed (see socket:close()). Client sockets can also 85 | ---actively be closed/refused by the server. In this case the client:receive() 86 | ---calls will fail and return an error. 87 | ---@field is_open boolean 88 | --- 89 | ---**READ-ONLY** The socket's resolved local address (for example "127.0.0.1" 90 | ---when a socket is bound to "localhost") 91 | ---@field local_address string 92 | --- 93 | ---**READ-ONLY** The socket's local port number, as specified when instantiated. 94 | ---@field local_port integer 95 | renoise.Socket.SocketBase = {} 96 | 97 | ---### functions 98 | 99 | ---Closes the socket connection and releases all resources. This will make 100 | ---the socket useless, so any properties, calls to the socket will result in 101 | ---errors. Can be useful to explicitly release a connection without waiting for 102 | ---the dead object to be garbage collected, or if you want to actively refuse a 103 | ---connection. 104 | function renoise.Socket.SocketBase:close() end 105 | 106 | -------------------------------------------------------------------------------- 107 | ---## renoise.Socket.SocketClient 108 | 109 | ---A SocketClient can connect to other socket servers and send and receive data 110 | ---from them on request. Connections to a server can not change, they are 111 | ---specified when constructing a client. You can not reconnect a client; create 112 | ---a new client instance instead. 113 | --- 114 | ---Socket clients in Renoise do block with timeouts to receive messages, and 115 | ---assume that you only expect a response from a server after having sent 116 | ---something to it (i.e.: GET HTTP). 117 | ---To constantly poll a connection to a server, for example in idle timers, 118 | ---specify a timeout of 0 in "receive(message, 0)". This will only check if there 119 | ---are any pending messages from the server and read them. If there are no pending 120 | ---messages it will not block or timeout. 121 | ---@class renoise.Socket.SocketClient : renoise.Socket.SocketBase 122 | --- 123 | ---**READ-ONLY** Address of the socket's peer, the socket address this client 124 | ---is connected to. 125 | ---@field peer_address string 126 | --- 127 | ---**READ-ONLY** Port of the socket's peer, the socket this client is 128 | ---connected to. 129 | ---@field peer_port integer 130 | renoise.Socket.SocketClient = {} 131 | 132 | ---### functions 133 | 134 | ---Send a message string (or OSC messages or bundles) to the connected server. 135 | ---When sending fails, "success" return value will be false and "error_message" 136 | ---is set, describing the error in a human readable format. 137 | ---NB: when using TCP instead of UDP as protocol for OSC messages, !no! SLIP 138 | ---encoding and no size prefixing of the passed OSC data will be done here. 139 | ---So, when necessary, do this manually by your own please. 140 | ---@param message string 141 | ---@return boolean success, string? error 142 | function renoise.Socket.SocketClient:send(message) end 143 | 144 | ---@alias SocketReceiveMode "*line"|"*all"|integer 145 | ---Receive a message string from the the connected server with the given 146 | ---timeout in milliseconds. Mode can be one of "*line", "*all" or a number > 0, 147 | ---like Lua's io.read. \param timeout can be 0, which is useful for 148 | ---receive("*all"). This will only check and read pending data from the 149 | ---sockets queue. 150 | --- 151 | ---+ mode "*line": Will receive new data from the server or flush pending data 152 | --- that makes up a "line": a string that ends with a newline. remaining data 153 | --- is kept buffered for upcoming receive calls and any kind of newlines 154 | --- are supported. The returned line will not contain the newline characters. 155 | --- 156 | ---+ mode "*all": Reads all pending data from the peer socket and also flushes 157 | --- internal buffers from previous receive line/byte calls (when present). 158 | --- This will NOT read the entire requested content, but only the current 159 | --- buffer that is queued for the local socket from the peer. To read an 160 | --- entire HTTP page or file you may have to call receive("*all") multiple 161 | --- times until you got all you expect to get. 162 | --- 163 | ---+ mode "number > 0": Tries reading \param NumberOfBytes of data from the 164 | --- peer. Note that the timeout may be applied more than once, if more than 165 | --- one socket read is needed to receive the requested block. 166 | --- 167 | ---When receiving fails or times-out, the returned message will be nil and 168 | ---error_message is set. The error message is "timeout" on timeouts, 169 | ---"disconnected" when the server actively refused/disconnected your client. 170 | ---Any other errors are system dependent, and should only be used for display 171 | ---purposes. 172 | --- 173 | ---Once you get an error from receive, and this error is not a "timeout", the 174 | ---socket will already be closed and thus must be recreated in order to retry 175 | ---communication with the server. Any attempt to use a closed socket will 176 | ---fire a runtime error. 177 | ---@param mode SocketReceiveMode 178 | ---@param timeout_ms number 179 | ---@return boolean? success, string? error 180 | function renoise.Socket.SocketClient:receive(mode, timeout_ms) end 181 | 182 | -------------------------------------------------------------------------------- 183 | ---## renoise.Socket.SocketServer 184 | 185 | ---A SocketServer handles one or more clients in the background, interacts 186 | ---only with callbacks from connected clients. This background polling can be 187 | ---start and stop on request. 188 | --- 189 | ---The socket server interface in Renoise is asynchronous (callback based), which 190 | ---means server calls never block or wait, but are served in the background. 191 | ---As soon a connection is established or messages arrive, a set of specified 192 | ---callbacks are invoked to respond to messages. 193 | ---@class renoise.Socket.SocketServer : renoise.Socket.SocketBase 194 | --- 195 | ---**READ-ONLY** true while the server is running, else false. 196 | ---@field is_running boolean 197 | renoise.Socket.SocketServer = {} 198 | 199 | 200 | ---Notifier table for `renoise.Socket.SocketServer:run`. 201 | --- 202 | ---All callback properties are optional. So you can, for example, skip specifying 203 | ---"socket_accepted" if you have no use for this. 204 | --- 205 | ---### examples: 206 | ---```lua 207 | ---{ 208 | --- socket_error = function(error_message) 209 | --- -- do something with the error message 210 | --- end, 211 | --- socket_accepted = function(client) 212 | --- -- FOR TCP CONNECTIONS ONLY: do something with client 213 | --- end, 214 | --- socket_message = function(client, message) 215 | --- -- do something with client and message 216 | --- end 217 | ---} 218 | ---``` 219 | ---@class SocketNotifierTable 220 | --- 221 | ---An error happened in the servers background thread. 222 | ---@field socket_error fun(error_message: string)? 223 | --- 224 | ---FOR TCP CONNECTIONS ONLY: called as soon as a new client 225 | ---connected to your server. The passed socket is a ready to use socket 226 | ---object, representing a connection to the new socket. 227 | ---@field socket_accepted fun(client: renoise.Socket.SocketClient)? 228 | --- 229 | ---A message was received from a client: The passed socket is a ready 230 | ---to use connection for TCP connections. For UDP, a "dummy" socket is 231 | ---passed, which can only be used to query the peer address and port 232 | ----> socket.port and socket.address 233 | ---@field socket_message fun(client: renoise.Socket.SocketClient, message: string)? 234 | 235 | 236 | ---Custom notifier class for `renoise.Socket.SocketServer:run`. 237 | ---Note: You must pass an instance of a class, like server_socket:run(MyNotifier()) 238 | --- 239 | ---All callback properties are optional. So you can, for example, skip specifying 240 | ---"socket_accepted" if you have no use for this. 241 | --- 242 | ---### examples: 243 | ---```lua 244 | ---class "MyNotifier" 245 | ---function MyNotifier:__init() 246 | --- -- could pass a server ref or something else here, or simply do nothing 247 | ---end 248 | ---function MyNotifier:socket_error(error_message) 249 | --- -- do something with the error message 250 | ---end 251 | ---function MyNotifier:socket_accepted(socket) 252 | --- -- FOR TCP CONNECTIONS ONLY: do something with socket 253 | ---end 254 | ---function MyNotifier:socket_message(socket, message) 255 | --- -- do something with socket and message 256 | ---end 257 | ---``` 258 | ---@class SocketNotifierClass 259 | ---@field socket_error fun(self: SocketNotifierClass, error_message: string)? 260 | ---@field socket_accepted fun(self: SocketNotifierClass, socket: renoise.Socket.SocketClient)? 261 | ---@field socket_message fun(self: SocketNotifierClass, socket: renoise.Socket.SocketClient, message: string)? 262 | 263 | 264 | ---## functions 265 | 266 | ---Start running the server by specifying a class or table which defines the 267 | ---callback functions for the server. 268 | ---@param notifier_table SocketNotifierTable|SocketNotifierClass 269 | function renoise.Socket.SocketServer:run(notifier_table) end 270 | 271 | ---Stop a running server. 272 | function renoise.Socket.SocketServer:stop() end 273 | 274 | ---Suspends the calling thread by the given timeout, and calls the server's 275 | ---callback methods as soon as something has happened in the server while 276 | ---waiting. Should be avoided whenever possible. 277 | ---@param timeout number Timeout in ms 278 | function renoise.Socket.SocketServer:wait(timeout) end 279 | --------------------------------------------------------------------------------