/tg/ Station 13 - Modules - TypesVar Details - Proc Details

looping_sound

A datum for sounds that need to loop, with a high amount of configurability.

Vars

audio_indexThe index of the current song we're playing in the mid_sounds list, only used if in_order is used This is immediately set to 1, so we start the index at 0
chanceChance per loop to play a mid_sound.
cut_listIf we're using cut_mid, this is the list we cut from
directIf true, plays directly to provided atoms instead of from them.
each_onceIf we should always play each sound once per loop of all sounds. Weights here only really effect order, and could be disgarded
end_sound(soundfile) The sound played after the main loop has concluded.
end_volumeOverride for volume of end sound.
extra_rangeThe extra range of the sound in tiles, defaults to 0.
falloff_distanceThe falloff distance of the sound,
falloff_exponentHow much the sound will be affected by falloff per tile.
ignore_wallsAre we ignoring walls? Defaults to TRUE.
in_orderWhether if the sounds should be played in order or not. Defaults to FALSE.
loop_startedHas the looping started yet?
max_loopsThe max amount of loops to run for.
mid_lengthThe length of time to wait between playing mid_sounds.
mid_length_varyAmount of time to add/take away from the mid length, randomly
mid_sounds(list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.
parentThe source of the sound, or the recipient of the sound.
pressure_affectedAre the sounds affected by pressure? Defaults to TRUE.
skip_starting_soundsDo we skip the starting sounds?
sound_channelSound channel to play on, random if not provided
start_lengthHow long to wait before starting the main loop after playing start_sound.
start_sound(soundfile) Played before starting the mid_sounds loop.
start_volumeOverride for volume of start sound.
timer_idThe ID of the timer that's used to loop the sounds.
use_reverbAre the sounds subject to reverb? Defaults to TRUE.
varyWhether or not the sounds will vary in pitch when played.
volumeSound output volume.

Procs

get_soundReturns the sound we should now be playing.
handle_parent_delA simple proc to handle the deletion of the parent, so that it does not force it to hard-delete.
is_activeA simple proc that lets us know whether the sounds are currently active or not.
on_startA proc that's there to handle delaying the main sounds if there's a start_sound, and simply starting the sound loop in general.
on_stopSimple proc that's executed when the looping sound is stopped, so that the end_sound can be played, if there's one.
playThe proc that handles actually playing the sound.
set_mid_lengthApplies a new mid length to the sound
set_parentA simple proc to change who our parent is set to, also handling registering and unregistering the QDELETING signals on the parent.
sound_loopA simple proc handling the looping of the sound itself.
startThe proc to actually kickstart the whole sound sequence. This is what you should call to start the looping_sound.
start_sound_loopThe proc that handles starting the actual core sound loop.
stopThe proc to call to stop the sound loop.
stop_currentStops sound playing on current channel, if specified

Var Details

audio_index

The index of the current song we're playing in the mid_sounds list, only used if in_order is used This is immediately set to 1, so we start the index at 0

chance

Chance per loop to play a mid_sound.

cut_list

If we're using cut_mid, this is the list we cut from

direct

If true, plays directly to provided atoms instead of from them.

each_once

If we should always play each sound once per loop of all sounds. Weights here only really effect order, and could be disgarded

end_sound

(soundfile) The sound played after the main loop has concluded.

end_volume

Override for volume of end sound.

extra_range

The extra range of the sound in tiles, defaults to 0.

falloff_distance

The falloff distance of the sound,

falloff_exponent

How much the sound will be affected by falloff per tile.

ignore_walls

Are we ignoring walls? Defaults to TRUE.

in_order

Whether if the sounds should be played in order or not. Defaults to FALSE.

loop_started

Has the looping started yet?

max_loops

The max amount of loops to run for.

mid_length

The length of time to wait between playing mid_sounds.

mid_length_vary

Amount of time to add/take away from the mid length, randomly

mid_sounds

(list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.

parent

The source of the sound, or the recipient of the sound.

pressure_affected

Are the sounds affected by pressure? Defaults to TRUE.

skip_starting_sounds

Do we skip the starting sounds?

sound_channel

Sound channel to play on, random if not provided

start_length

How long to wait before starting the main loop after playing start_sound.

start_sound

(soundfile) Played before starting the mid_sounds loop.

start_volume

Override for volume of start sound.

timer_id

The ID of the timer that's used to loop the sounds.

use_reverb

Are the sounds subject to reverb? Defaults to TRUE.

vary

Whether or not the sounds will vary in pitch when played.

volume

Sound output volume.

Proc Details

get_sound

Returns the sound we should now be playing.

handle_parent_del

A simple proc to handle the deletion of the parent, so that it does not force it to hard-delete.

is_active

A simple proc that lets us know whether the sounds are currently active or not.

on_start

A proc that's there to handle delaying the main sounds if there's a start_sound, and simply starting the sound loop in general.

on_stop

Simple proc that's executed when the looping sound is stopped, so that the end_sound can be played, if there's one.

play

The proc that handles actually playing the sound.

Arguments:

set_mid_length

Applies a new mid length to the sound

set_parent

A simple proc to change who our parent is set to, also handling registering and unregistering the QDELETING signals on the parent.

sound_loop

A simple proc handling the looping of the sound itself.

Arguments:

start

The proc to actually kickstart the whole sound sequence. This is what you should call to start the looping_sound.

Arguments:

start_sound_loop

The proc that handles starting the actual core sound loop.

stop

The proc to call to stop the sound loop.

Arguments:

stop_current

Stops sound playing on current channel, if specified