MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kriya::TapSetBuilder Class Reference

Describes a tap set one tap at a time, then starts it. More...

#include <TapSet.hpp>

+ Collaboration diagram for MayaFlux::Kriya::TapSetBuilder:

Classes

struct  Spec
 

Public Member Functions

TapSetBuilder & backward (bool enable=true)
 Read the current tap backwards from the end of the region.
 
TapSetBuilder & enters_after (double seconds)
 Seconds after start() before the current tap enters.
 
TapSetBuilder & from_channel (uint32_t channel)
 Source channel the current tap plays on every output.
 
TapSetBuilder & lag (double seconds)
 Make the current tap trail the write head of a live ring by seconds.
 
TapSetBuilder & lag (Kinesis::TimeMap seconds)
 Make the current tap trail a live ring by a lag that follows a time map.
 
TapSetBuilder & level (double gain)
 Linear gain of the current tap on each of its outputs.
 
TapSetBuilder & loop (bool enable=true)
 Whether taps loop the region (default) or play it once.
 
TapSetBuilder & on_channel (uint32_t channel)
 Output channel of the current tap.
 
TapSetBuilder & on_channels (const std::vector< uint32_t > &channels)
 Several output channels for the current tap, which stay in step.
 
TapSetBuilder & region (uint64_t start_frame, uint64_t end_frame=0)
 Restrict every tap to a region of the stream.
 
TapSetBuilder & repeat_every (double seconds)
 Restart the current tap every seconds.
 
TapSetBuilder & repeat_every (Kinesis::TimeMap seconds)
 Restart the current tap with a repeat length that follows a time map.
 
TapSetBuilder & speed (double ratio)
 Speed of the current tap relative to the source.
 
TapSet start ()
 Build the taps and start them.
 
TapSetBuilder & tap ()
 Begin a new tap.
 
 TapSetBuilder (std::shared_ptr< Kakshya::DynamicSoundStream > stream, Buffers::BufferManager &mgr, Vruta::TaskScheduler &scheduler, uint32_t buf_size)
 

Private Member Functions

Spec & current ()
 

Private Attributes

uint32_t m_buf_size
 
uint64_t m_end_frame {}
 
bool m_looping { true }
 
Buffers::BufferManager & m_mgr
 
Vruta::TaskScheduler & m_scheduler
 
std::vector< Spec > m_specs
 
uint64_t m_start_frame {}
 
std::shared_ptr< Kakshya::DynamicSoundStream > m_stream
 

Detailed Description

Describes a tap set one tap at a time, then starts it.

Each tap() begins a tap with defaults: enters at once, normal speed, forward, full level, output channel 0. The calls that follow describe that tap until the next tap(). Calling one before any tap() starts the first. loop() and region() apply to every tap.

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).on_channels({ 0, 1 })
.start();
taps.speed(0, 0.5);
taps.stop();
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 & on_channels(const std::vector< uint32_t > &channels)
Several output channels for the current tap, which stay in step.
Definition TapSet.cpp:107
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
void speed(size_t tap, double ratio)
Change the speed of a tap while it plays.
Definition TapSet.cpp:18
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

Two taps at speeds 1.0 and 1.001 drift slowly out of phase. Speeds change pitch, since taps read with interpolation.

A tap plays the source channel with the same number as each output channel, wrapping when the source has fewer, so a mono source sounds on every output and a stereo one keeps left and right. from_channel() picks one source channel for all of a tap's outputs.

Definition at line 119 of file TapSet.hpp.


The documentation for this class was generated from the following files: