MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ create_tap_set() [1/2]

MAYAFLUX_API Kriya::TapSetBuilder MayaFlux::create_tap_set ( const std::string &  filepath,
uint32_t  num_samples = 48000 *5,
bool  truncate = true 
)

Begin describing several taps that read one audio file.

Loads the file like create_sampler and returns a builder. Each tap() adds a tap with its own entry time, speed, direction, level and channel, and start() plays them. Keep the resulting TapSet alive for as long as it should sound.

auto taps = MayaFlux::create_tap_set("res/h.wav")
.tap().speed(1.0)
.tap().enters_after(2.0).speed(3.0 / 2.0).level(0.8)
.tap().enters_after(4.0).speed(2.0).backward().level(0.6)
.start();
TapSet start()
Build the taps and start them.
Definition TapSet.cpp:156
TapSetBuilder & backward(bool enable=true)
Read the current tap backwards from the end of the region.
Definition TapSet.cpp:89
TapSetBuilder & enters_after(double seconds)
Seconds after start() before the current tap enters.
Definition TapSet.cpp:75
TapSetBuilder & speed(double ratio)
Speed of the current tap relative to the source.
Definition TapSet.cpp:81
TapSetBuilder & tap()
Begin a new tap.
Definition TapSet.cpp:69
TapSetBuilder & level(double gain)
Linear gain of the current tap on each of its outputs.
Definition TapSet.cpp:95
Kriya::TapSetBuilder create_tap_set(const std::string &filepath, uint32_t num_samples, bool truncate)
Begin describing several taps that read one audio file.
Definition Rigs.cpp:135
Parameters
filepathPath to the audio file (any FFmpeg-supported format).
num_samplesNumber of samples to load from the file (default: 48000 * 5).
truncateTruncate stream to num_samples if true (default: true).
Returns
Builder. If the file cannot be loaded, start() returns an empty TapSet.

Definition at line 135 of file Rigs.cpp.

137{
138 auto stream = get_io_manager()->load_audio_bounded(filepath, num_samples, truncate);
139
140 if (!stream) {
141 MF_ERROR(Journal::Component::API, Journal::Context::FileIO,
142 "create_tap_set: failed to load '{}'", filepath);
143 }
144
145 return create_tap_set_from_stream(std::move(stream));
146}
#define MF_ERROR(comp, ctx,...)
Core::GlobalStreamInfo stream
Definition Config.cpp:40
std::shared_ptr< IO::IOManager > get_io_manager()
Retrieves the global IOManager instance for file loading and buffer management.
Definition Depot.cpp:575

References MayaFlux::Journal::API, create_tap_set_from_stream(), MayaFlux::Journal::FileIO, get_io_manager(), MF_ERROR, and stream.

+ Here is the call graph for this function: