Skip to content

Fades

Fades

Import

import "_IVLS/std-library/nodes/voice-mods/fades.ksp"

Node: Stl.Modulation

Uses: Init

Overview

Fades

LIBRARY: Volume fade-in and fade-out voice modulation nodes for the IVLS voice system.

  • Stl.Modulation: base node that drives timed volume ramping via a modulation voice
  • FadeOut: ramps volume from full to silence over a configurable duration and curve
  • FadeIn: ramps volume from silence to full
  • Fades: registers FadeIn/FadeOut flow endpoints and exposes convenience fade functions

API

Nodes

Name Description
node FadeIn Modulation node that ramps the volume of a target voice from silence to full ove...
node FadeOut Modulation node that ramps the volume of a target voice from full to silence ove...
node Fades Registers the FadeIn and FadeOut flow endpoints and exposes convenience function...
node Stl.Modulation Declares the mod_target, mod_time, mod_kill_on_end, and mod_curve voice members ...

Defines

Name Description
define Stl.Fades List of nodes comprising the Fades subsystem, used with ADD_NODES or similar ext...
define Stl.Modulation.MEMBERS List of voice member names contributed by Stl.Modulation to the Voice schema via...
define Voice.ADD_INIT += Stl.Modulation.INIT Extends the Voice initialization array with default values for the modulation me...
define Voice.ADD_MEMBERS += Stl.Modulation.MEMBERS Extends the Voice schema with the modulation member list used by fades and other...
define Voice.validate.mod_curve(#v#) Validates that a mod_curve value is within the allowed range of -100 to 100.
define Voice.validate.mod_kill_on_end(#v#) Validates that a mod_kill_on_end value is either NO or YES.
define Voice.validate.mod_target(#v#) Validates that a mod_target value is a valid voice id or the sentinel value -1 i...
define Voice.validate.mod_time(#v#) Validates that a mod_time value is strictly positive.

Functions

Name Description
fades.curve_in(vo, time_ms, curve) -> mod_vo Starts a curved fade-in on the given voice.
fades.curve_out(vo, time_ms, curve, kill) -> mod_vo Starts a curved fade-out on the given voice, optionally releasing the voice when...
fades.in(vo, time_ms) -> mod_vo Starts a linear fade-in on the given voice over the specified duration.
fades.out(vo, time_ms, kill) -> mod_vo Starts a linear fade-out on the given voice over the specified duration, optiona...
ivls.fire_modulation(vo, time_ms, kill, curve, mod_flow) -> mod_vo Fires a modulation voice that ramps the volume of the target voice over a given ...

Nodes

node FadeIn

Callbacks: NoteOn

Modulation node that ramps the volume of a target voice from silence to full over the duration stored in the modulation voice, using an exponential curve.


node FadeOut

Callbacks: NoteOn

Modulation node that ramps the volume of a target voice from full to silence over the duration stored in the modulation voice, using an exponential curve. Optionally releases the target voice when the ramp completes.


node Fades

Callbacks: Init, Flows

Registers the FadeIn and FadeOut flow endpoints and exposes convenience functions for triggering volume fades on a target voice.

Side effects:

Name Type Purpose
fades.in_flow integer Flow id for the FadeIn modulation node
fades.out_flow integer Flow id for the FadeOut modulation node

node Stl.Modulation

Callbacks: Init

Declares the mod_target, mod_time, mod_kill_on_end, and mod_curve voice members and their default values, plus the validation predicates and the float scratch family variable used during modulation playback.

Side effects: | Name | Type | Purpose | |------|------|---------| | voice_mod.float_calc | real | Scratch real variable shared across modulation nodes |


Defines

define Stl.Fades

List of nodes comprising the Fades subsystem, used with ADD_NODES or similar extension mechanisms to include all fade nodes in a product.


define Stl.Modulation.MEMBERS

List of voice member names contributed by Stl.Modulation to the Voice schema via the ADD_MEMBERS extension point.


define Voice.ADD_INIT += Stl.Modulation.INIT

Extends the Voice initialization array with default values for the modulation members declared in Stl.Modulation.MEMBERS.


define Voice.ADD_MEMBERS += Stl.Modulation.MEMBERS

Extends the Voice schema with the modulation member list used by fades and other modulation nodes.


define Voice.validate.mod_curve(#v#)

Validates that a mod_curve value is within the allowed range of -100 to 100.

Parameter Description
#v# value to test

define Voice.validate.mod_kill_on_end(#v#)

Validates that a mod_kill_on_end value is either NO or YES.

Parameter Description
#v# value to test

define Voice.validate.mod_target(#v#)

Validates that a mod_target value is a valid voice id or the sentinel value -1 indicating no target.

Parameter Description
#v# value to test

define Voice.validate.mod_time(#v#)

Validates that a mod_time value is strictly positive.

Parameter Description
#v# value to test

Functions

fades.curve_in(vo, time_ms, curve) -> mod_vo

Starts a curved fade-in on the given voice.

Parameter Type Description
vo integer voice id of the voice to fade in
time_ms integer fade duration in milliseconds
curve integer exponential curve shape in the range -100 to 100; 0 is linear

Returns: mod_vo — voice id of the modulation voice driving the fade


fades.curve_out(vo, time_ms, curve, kill) -> mod_vo

Starts a curved fade-out on the given voice, optionally releasing the voice when the fade completes.

Parameter Type Description
vo integer voice id of the voice to fade out
time_ms integer fade duration in milliseconds
curve integer exponential curve shape in the range -100 to 100; 0 is linear
kill integer whether to release the voice after the fade (YES/NO)

Returns: mod_vo — voice id of the modulation voice driving the fade


fades.in(vo, time_ms) -> mod_vo

Starts a linear fade-in on the given voice over the specified duration.

Parameter Type Description
vo integer voice id of the voice to fade in
time_ms integer fade duration in milliseconds

Returns: mod_vo — voice id of the modulation voice driving the fade


fades.out(vo, time_ms, kill) -> mod_vo

Starts a linear fade-out on the given voice over the specified duration, optionally releasing the voice when the fade completes.

Parameter Type Description
vo integer voice id of the voice to fade out
time_ms integer fade duration in milliseconds
kill integer whether to release the voice after the fade (YES/NO)

Returns: mod_vo — voice id of the modulation voice driving the fade


ivls.fire_modulation(vo, time_ms, kill, curve, mod_flow) -> mod_vo

Fires a modulation voice that ramps the volume of the target voice over a given duration using an exponential curve, then optionally kills the target when the ramp completes.

Parameter Type Description
vo integer voice id of the source voice to copy for the modulation voice
time_ms integer duration of the modulation ramp in milliseconds
kill integer whether to release the target voice after the ramp (YES/NO)
curve integer exponential curve shape in the range -100 to 100; 0 is linear
mod_flow integer flow id that determines which modulation node processes this voice

Returns: mod_vo — voice id of the newly created modulation voice


Example

// TODO: Add usage example

See Also