struct
SunVox::Module
- SunVox::Module
- Struct
- Value
- Object
Overview
High-level wrapper around a synth, effect, or misc module inside a SunVox::Slot.
Defined in:
module.crConstructors
Instance Method Summary
-
#>>(destination : Module | Int32) : Module
Chainable connection operator:
gen >> filter >> reverb >> slot.output. -
#[](index_or_name : Int32 | String, scaled : CtlScale = CtlScale::Real) : Int32
Reads a controller value by 0-based index or name.
-
#[]=(index_or_name : Int32 | String, val : Int32) : Int32
Sets a controller value by 0-based index or name.
-
#bypass? : Bool
Returns true if this module is bypassed.
-
#clean!(track : Int32 = 0) : self
Stops this module and clears its internal buffers (
NOTECMD_CLEAN_MODULE). -
#color : Int32
Gets the module's color in
0xBBGGRRformat. -
#color=(new_color : Int32) : Int32
Sets the module's color in
0xBBGGRRformat. -
#connect(destination : Module) : Module
Connects this module (source) to
destinationand returnsdestinationfor chaining. -
#connect(destination_id : Int32) : Module
Connects this module (source) to
destination_idand returns the destinationModule. -
#connect_to_output : Module
Connects this module directly to the slot's master Output module (module 0).
-
#controllers : Array(Controller)
Returns all controllers on this module.
-
#ctl(index : Int32) : Controller
Returns the
Controlleratindex(0-based). -
#ctl(name : String) : Controller
Finds a
Controllerby name (case-insensitive), raising if not found. -
#ctl?(index : Int32) : Controller | Nil
Returns the
Controlleratindexif in range, ornil. -
#ctl?(name : String) : Controller | Nil
Finds a
Controllerby name (case-insensitive), ornilif not found. -
#ctl_count : Int32
Number of controllers on this module.
-
#curve(curve_num : Int32 = 0, length : Int32 = 257) : Slice(Float32)
Reads curve values (
Float32) from this module. -
#disconnect(destination : Module | Int32) : self
Disconnects this module from
destination. -
#effect? : Bool
Returns true if this module is an effect (Sound input + Sound output).
-
#exists? : Bool
Returns true if this module exists in the slot.
-
#finetune : Int32
Gets the module's finetune (
-256..256). -
#finetune=(val : Int32) : Int32
Sets the module's finetune (
-256..256) immediately. -
#finetune_info : NamedTuple(finetune: Int32, relative_note: Int32)
Gets both
{finetune, relative_note}for this module. -
#flags : UInt32
Raw bitflags for this module (
LibSunVox::MODULE_FLAG_*). -
#generator? : Bool
Returns true if this module is a generator (Note input + Sound output).
- #id : Int32
-
#input_ids : Array(Int32)
Active input module IDs connected to this module.
-
#inputs : Array(Module)
Active input modules connected to this module.
-
#metamodule_load(filename : String | Path) : self
Loads a file (
sunvox,mod,xm,midi) into this MetaModule. -
#metamodule_load(data : Bytes) : self
Loads a project from memory (
Bytes) into this MetaModule. -
#muted? : Bool
Returns true if this module is muted.
-
#name : String
Gets the module's name.
-
#name=(new_name : String) : String
Sets the module's name.
-
#note_off(track : Int32 = 0) : self
Sends a Note Off command on
trackfor this module. -
#output_ids : Array(Int32)
Active output module IDs connected from this module.
-
#output_module? : Bool
Returns true if this is the master Output module (ID 0).
-
#outputs : Array(Module)
Active output modules connected from this module.
-
#play_frequency(freq_hz : Number, track : Int32 = 0, velocity : Int32 = 129) : self
Triggers a specific frequency (in Hz) on this module using
NOTECMD_SET_PITCH. -
#play_note(note : Note | Int32, track : Int32 = 0, velocity : Int32 = 129, ctl : Int32 = 0, effect : Int32 = 0, ctl_value : Int32 = 0) : self
Triggers a note on this module.
-
#raw_inputs : Slice(Int32)
Raw input link slot array (may contain
-1for empty link slots). -
#raw_outputs : Slice(Int32)
Raw output link slot array (may contain
-1for empty link slots). -
#relative_note : Int32
Gets the module's relative note (transposition).
-
#relative_note=(val : Int32) : Int32
Sets the module's relative note (transposition) immediately.
-
#relnote : Int32
Alias for
#relative_note. -
#relnote=(val : Int32) : Int32
Alias for
#relative_note=. -
#remove! : Nil
Removes this module from its slot.
-
#rgb : NamedTuple(r: UInt8, g: UInt8, b: UInt8)
Gets the module's color unpacked into
{r, g, b}bytes (0..255). -
#sampler_load(filename : String | Path, sample_slot : Int32 = -1) : self
Loads a sample file into this Sampler module (
sample_slot = -1replaces the whole sampler). -
#sampler_load(data : Bytes, sample_slot : Int32 = -1) : self
Loads a sample from memory (
Bytes) into this Sampler module. -
#sampler_par(par : SamplerParam | Int32, sample_slot : Int32 = 0) : Int32
Gets a sample parameter from this Sampler module (
sv_sampler_par). -
#scope(channel : Int32 = 0, samples_to_read : Int32 = 1024) : Slice(Int16)
Reads oscilloscope samples (
Int16) from this module's output. -
#send_event(track : Int32 = 0, note : Note | Int32 = Note::None, velocity : Int32 = 0, ctl : Int32 = 0, effect : Int32 = 0, ctl_value : Int32 = 0) : self
Sends an event targeting this module.
-
#set_curve(curve_num : Int32, data : Slice(Float32)) : Int32
Writes curve values (
Slice(Float32)) to this module. -
#set_curve(curve_num : Int32, data : Array(Float32)) : Int32
Writes curve values (
Array(Float32)) to this module. -
#set_rgb(r : Int, g : Int, b : Int) : self
Sets the module's color from RGB components (
0..255). -
#set_sampler_par(par : SamplerParam | Int32, val : Int32, sample_slot : Int32 = 0) : Int32
Sets a sample parameter on this Sampler module (
sv_sampler_par) and returns the previous value. -
#set_xy(x : Int32, y : Int32) : self
Sets the module's
(x, y)coordinates. - #slot : Slot
-
#solo? : Bool
Returns true if this module is soloed.
-
#to_i : Int32
Returns the integer module ID.
-
#type : String
Gets the module's type string (e.g.,
"Generator","Filter Pro","Output"). -
#vplayer_load(filename : String | Path) : self
Loads an OGG Vorbis file into this Vorbis Player module.
-
#vplayer_load(data : Bytes) : self
Loads an OGG Vorbis stream from memory (
Bytes) into this Vorbis Player module. -
#x : Int32
Gets the module's X coordinate.
-
#x=(new_x : Int32) : Int32
Sets the module's X coordinate.
-
#xy : NamedTuple(x: Int32, y: Int32)
Gets the module's
{x, y}coordinates. -
#y : Int32
Gets the module's Y coordinate.
-
#y=(new_y : Int32) : Int32
Sets the module's Y coordinate.
Constructor Detail
Instance Method Detail
Chainable connection operator: gen >> filter >> reverb >> slot.output.
Reads a controller value by 0-based index or name.
Sets a controller value by 0-based index or name.
Stops this module and clears its internal buffers (NOTECMD_CLEAN_MODULE).
Connects this module (source) to destination and returns destination for chaining.
Connects this module (source) to destination_id and returns the destination Module.
Connects this module directly to the slot's master Output module (module 0).
Finds a Controller by name (case-insensitive), raising if not found.
Finds a Controller by name (case-insensitive), or nil if not found.
Reads curve values (Float32) from this module.
Disconnects this module from destination.
Gets both {finetune, relative_note} for this module.
Loads a file (sunvox, mod, xm, midi) into this MetaModule.
Loads a project from memory (Bytes) into this MetaModule.
Sends a Note Off command on track for this module.
Triggers a specific frequency (in Hz) on this module using NOTECMD_SET_PITCH.
Triggers a note on this module.
Sets the module's relative note (transposition) immediately.
Gets the module's color unpacked into {r, g, b} bytes (0..255).
Loads a sample file into this Sampler module (sample_slot = -1 replaces the whole sampler).
Loads a sample from memory (Bytes) into this Sampler module.
Gets a sample parameter from this Sampler module (sv_sampler_par).
Reads oscilloscope samples (Int16) from this module's output.
Sends an event targeting this module.
Writes curve values (Slice(Float32)) to this module.
Writes curve values (Array(Float32)) to this module.
Sets the module's color from RGB components (0..255).
Sets a sample parameter on this Sampler module (sv_sampler_par) and returns the previous value.
Loads an OGG Vorbis file into this Vorbis Player module.
Loads an OGG Vorbis stream from memory (Bytes) into this Vorbis Player module.