Class Track
- All Implemented Interfaces:
DSPNodeOutputSignal
,Loopable
Track
allows to compose complex compositional and DSP configurations. a Track
may be added to other
Track
s.
Track
must implement the method void output(Signal)
which delivers an audio signal and it
may implement the method void beat(int)
which can be used to receive beat events. a Track
may manage a collection of child Track
s. each child track processes audio signals which are accumulated by
the track. furthermore, Track
calls its child tracks void beat(int)
method.
if a class is derived from Track
and update(int)
is overridden make sure to call
beat(int)
to preserve internal functionality and update for child Track
s.
similarly, make sure to call Signal output_signal_update()
if
Signal output_signal()
is overridden.
Track
may handle other mono or stereo Track
s. if a Track
outputs a mono signal the output is
positioned via panning ( see Track
pan()
). if a Track
outputs a stereo signal the
output ignores panning and just uses the signal unchanged. if a Track
outputs more than channels than a
stereo signal all additional channels are ignored.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
beat
(int beat_absolute, int beat_relative) triggered by update mechanism.int
int
int
get_loop()
int
get_loop_count
(int absolut_position) int
int
get_relative_position
(int absolut_position) float
callback method that accumulates audio signals from child tracks and if applicable maps mono signals into stereo space.pan()
static void
static void
run_test()
void
set_in_out_point
(int in_point, int out_point) void
set_in_point
(int in_point) void
set_length
(int length) set length of a track loop.void
set_loop
(int loop) void
set_out_point
(int out_point) void
set_volume
(float volume) volume of track with 0.0 being no output and 1.0 being 100% of the signal output.track
(int index) tracks()
void
update
(int beat) void
update
(int beat_absolute, int beat_relative) updates everything related to beat functionality including internal mechanisms and child tracks.
-
Field Details
-
VERBOSE
public static boolean VERBOSE -
ID
public final int ID
-
-
Constructor Details
-
Track
public Track() -
Track
public Track(float volume, int in_point, int out_point)
-
-
Method Details
-
println
-
run_test
public static void run_test() -
tracks
-
add_track
-
track
- Parameters:
index
- index of track as stored intrack()
. note that this not to be confused with the final field.ID
inTrack
which refers to a unique ID for each track ever created.- Returns:
- track stored at index
-
beat
public void beat(int beat_absolute, int beat_relative) triggered by update mechanism. this method can be overridden to implement custom behavior.- Parameters:
beat_absolute
- current absolute beat countbeat_relative
- current relative beat count
-
update
public void update(int beat_absolute, int beat_relative) updates everything related to beat functionality including internal mechanisms and child tracks. this method also calls this object's ownbeat(int)
method. the order in which methods are called is as follows:beat(int)
- child
beat(int)
- child
update(int)
- Parameters:
beat_absolute
- current absolute beat count. by default this is the global beat count that is passed to the very firstTrack
in the composition.beat_relative
- current relative beat count
-
update
public void update(int beat) -
output_signal
callback method that accumulates audio signals from child tracks and if applicable maps mono signals into stereo space. this method can be overridden to implement custom behavior, however, if doing so make sure to callSignal output_signal_update()
to collect signals from child tracks.- Specified by:
output_signal
in interfaceDSPNodeOutputSignal
- Returns:
- Signal of this track
-
output_signal_update
-
pan
-
get_volume
public float get_volume()- Returns:
- track volume with 0.0 being no output and 1.0 being 100%
-
set_volume
public void set_volume(float volume) volume of track with 0.0 being no output and 1.0 being 100% of the signal output. note, that this value is interpreted by parentTrack
s.- Parameters:
volume
- track volume with 0.0 being no output and 1.0 being 100%
-
get_in_point
public int get_in_point()- Specified by:
get_in_point
in interfaceLoopable
-
set_in_point
public void set_in_point(int in_point) - Parameters:
in_point
- in point in beats. included in length count i.e an in point of 2 and an out point of 5 will * result in a duration of 4 beats ( 2, 3, 4, 5 ).
-
get_out_point
public int get_out_point()- Specified by:
get_out_point
in interfaceLoopable
-
set_out_point
public void set_out_point(int out_point) - Parameters:
out_point
- out point in beats. included in length count i.e an in point of 2 and an out point of 5 will result in a duration of 4 beats ( 2, 3, 4, 5 ).
-
set_in_out_point
public void set_in_out_point(int in_point, int out_point) -
get_length
public int get_length() -
set_length
public void set_length(int length) set length of a track loop. setting the length affects outpoint. e.g given an inpoint of 3, setting the length to 2 will set output to 4. note that outpoint is inclusive i.e a pattern from in- to outpoint of 3, 4, 5, … is generated.- Parameters:
length
- set length of loop
-
get_loop
public int get_loop() -
set_loop
public void set_loop(int loop) -
get_relative_position
public int get_relative_position(int absolut_position) -
get_loop_count
public int get_loop_count(int absolut_position)
-