MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux Namespace Reference

Main namespace for the Maya Flux audio engine. More...

Namespaces

namespace  Buffers
 
namespace  Config
 Globlal configuration for MayaFlux.
 
namespace  Core
 
namespace  Host
 
namespace  internal
 
namespace  IO
 
namespace  Journal
 
namespace  Kakshya
 
namespace  Kinesis
 
namespace  Kriya
 
namespace  Memory
 
namespace  Nexus
 
namespace  Nodes
 Contains the node-based computational processing system components.
 
namespace  Parallel
 
namespace  Platform
 
namespace  Portal
 
namespace  Reflect
 
namespace  Registry
 
namespace  Transitive
 
namespace  Vruta
 
namespace  Yantra
 

Classes

struct  CreationContext
 
class  Creator
 
struct  DomainSpec
 Thin domain wrapper that adds subscript channel-binding syntax. More...
 
class  MeshGroupHandle
 
struct  MultiChannelFeatures
 Multi-channel feature analysis result. More...
 
class  TemporalWrapper
 Wraps an entity with a TimeSpec for temporal activation. More...
 
class  TimeSpec
 Represents a timed activation operation for processing nodes, buffers, or networks. More...
 

Typedefs

using ViewportPresetConfig = Kinesis::NavigationConfig
 Alias for backwards compatibility; prefer Kinesis::NavigationConfig in new code.
 

Enumerations

enum  Domain : uint64_t {
  AUDIO = (static_cast<uint64_t>(Nodes::ProcessingToken::AUDIO_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::AUDIO_BACKEND) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::SAMPLE_ACCURATE)) , AUDIO_PARALLEL = (static_cast<uint64_t>(Nodes::ProcessingToken::AUDIO_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::AUDIO_PARALLEL) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::SAMPLE_ACCURATE)) , GRAPHICS = (static_cast<uint64_t>(Nodes::ProcessingToken::VISUAL_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::GRAPHICS_BACKEND) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::FRAME_ACCURATE)) , GRAPHICS_ADAPTIVE = (static_cast<uint64_t>(Nodes::ProcessingToken::VISUAL_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::GRAPHICS_BACKEND) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::MULTI_RATE)) ,
  CUSTOM_ON_DEMAND = (static_cast<uint64_t>(Nodes::ProcessingToken::CUSTOM_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::SAMPLE_RATE | Buffers::ProcessingToken::CPU_PROCESS | Buffers::ProcessingToken::SEQUENTIAL) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::ON_DEMAND)) , CUSTOM_FLEXIBLE = (static_cast<uint64_t>(Nodes::ProcessingToken::CUSTOM_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::FRAME_RATE | Buffers::ProcessingToken::GPU_PROCESS | Buffers::ProcessingToken::PARALLEL) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::CUSTOM)) , AUDIO_VISUAL_SYNC = (static_cast<uint64_t>(Nodes::ProcessingToken::AUDIO_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::SAMPLE_RATE | Buffers::ProcessingToken::CPU_PROCESS | Buffers::ProcessingToken::SEQUENTIAL) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::FRAME_ACCURATE)) , AUDIO_GPU = (static_cast<uint64_t>(Nodes::ProcessingToken::AUDIO_RATE) << 32) | (static_cast<uint64_t>(Buffers::ProcessingToken::SAMPLE_RATE | Buffers::ProcessingToken::GPU_PROCESS | Buffers::ProcessingToken::PARALLEL) << 16) | (static_cast<uint64_t>(Vruta::ProcessingToken::MULTI_RATE)) ,
  WINDOWING , INPUT_EVENTS
}
 Unified domain enum combining all three ProcessingToken subsystems. More...
 
enum class  ViewportPresetMode : uint8_t { Fly }
 Selects which navigation controller bind_viewport_preset installs. More...
 

Functions

void add_processor (const std::shared_ptr< Buffers::BufferProcessor > &processor, Buffers::ProcessingToken token, uint32_t channel)
 Adds a processor to all buffers in a specific channel.
 
void add_processor (const std::shared_ptr< Buffers::BufferProcessor > &processor, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
 Adds a processor to all buffers in a processing domain.
 
void add_processor (const std::shared_ptr< Buffers::BufferProcessor > &processor, const std::shared_ptr< Buffers::Buffer > &buffer, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
 Adds a processor to a specific buffer.
 
MAYAFLUX_API MultiChannelFeatures analyze_channels (const std::vector< Kakshya::DataVariant > &channels)
 Comprehensive multi-channel analysis in single operation.
 
void apply_gain (Kakshya::DataVariant &data, double gain_factor)
 
void apply_gain (std::vector< double > &data, double gain_factor)
 Apply gain to single-channel data (in-place)
 
void apply_gain_channels (std::vector< Kakshya::DataVariant > &channels, double gain_factor)
 Apply gain to multi-channel data (in-place)
 
void apply_gain_per_channel (std::vector< Kakshya::DataVariant > &channels, const std::vector< double > &gain_factors)
 Apply different gain to each channel (in-place)
 
void apply_window (Kakshya::DataVariant &data, const std::string &window_type)
 
void apply_window (std::vector< double > &data, const std::string &window_type="hann")
 Apply window function to single-channel data (in-place)
 
void apply_window_channels (std::vector< Kakshya::DataVariant > &channels, const std::string &window_type="hann")
 Apply window function to multi-channel data (in-place)
 
float aspect_ratio (const std::shared_ptr< Core::Window > &window)
 Get window aspect ratio from window state.
 
float aspect_ratio (uint32_t window_width, uint32_t window_height)
 Get window aspect ratio (width/height)
 
std::shared_ptr< Buffers::BufferProcessorattach_quick_process (Buffers::AudioProcessingFunction processor, unsigned int channel_id=0)
 Attaches a processing function to a specific channel.
 
template<typename F >
std::shared_ptr< Buffers::BufferProcessorattach_quick_process (F &&processor, const std::shared_ptr< Buffers::AudioBuffer > &buffer)
 
template<typename F >
std::shared_ptr< Buffers::BufferProcessorattach_quick_process (F &&processor, const std::shared_ptr< Buffers::VKBuffer > &buffer)
 
void Await ()
 Blocks launcher until user input (optional convenience function)
 
Core::InputBinding bind_hid (uint16_t vid, uint16_t pid)
 Create binding for HID device by vendor/product ID.
 
Core::InputBinding bind_hid (uint32_t device_id=0)
 Create binding for HID device.
 
Core::InputBinding bind_midi (uint32_t device_id=0, std::optional< uint8_t > channel={})
 Create binding for MIDI device.
 
Core::InputBinding bind_midi_cc (std::optional< uint8_t > cc_number={}, std::optional< uint8_t > channel={}, uint32_t device_id=0)
 Create binding for MIDI Control Change messages.
 
Core::InputBinding bind_midi_note_off (std::optional< uint8_t > channel={}, uint32_t device_id=0)
 Create binding for MIDI Note Off messages.
 
Core::InputBinding bind_midi_note_on (std::optional< uint8_t > channel={}, uint32_t device_id=0)
 Create binding for MIDI Note On messages.
 
Core::InputBinding bind_midi_pitch_bend (std::optional< uint8_t > channel={}, uint32_t device_id=0)
 Create binding for MIDI Pitch Bend messages.
 
Core::InputBinding bind_osc (const std::string &pattern="")
 Create binding for OSC messages.
 
Core::InputBinding bind_serial (uint32_t device_id=0)
 Create binding for Serial device.
 
void bind_viewport_preset (const std::shared_ptr< Core::Window > &window, const std::shared_ptr< Buffers::RenderProcessor > &processor, ViewportPresetMode mode=ViewportPresetMode::Fly, const ViewportPresetConfig &config={}, const std::string &name="default")
 Bind a navigation preset to a window and render processor.
 
void bind_viewport_preset (const std::shared_ptr< Core::Window > &window, ViewportPresetMode mode=ViewportPresetMode::Fly, const ViewportPresetConfig &config={}, const std::string &name="default")
 Bind a navigation preset to all RenderProcessors currently registered against a window.
 
bool cancel_event_handler (const std::string &name)
 Cancel an event handler by name.
 
bool cancel_task (const std::string &name)
 Cancels a scheduled task.
 
MAYAFLUX_API std::vector< double > channel_correlation_matrix (const std::vector< Kakshya::DataVariant > &channels)
 Calculate correlation matrix between all channel pairs.
 
std::vector< std::shared_ptr< Buffers::AudioBuffer > > clone_buffer_to_channels (const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels)
 Clones a buffer to multiple channels.
 
std::vector< std::shared_ptr< Buffers::AudioBuffer > > clone_buffer_to_channels (const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels, const Buffers::ProcessingToken &token)
 
Domain compose_domain (Nodes::ProcessingToken node_token, Buffers::ProcessingToken buffer_token, Vruta::ProcessingToken task_token)
 Composes individual ProcessingTokens into a unified Domain.
 
void connect_node_to_buffer (const std::shared_ptr< Nodes::Node > &node, const std::shared_ptr< Buffers::AudioBuffer > &buffer, float mix=0.5F, bool clear_before=true)
 Connects a node to a specific buffer.
 
void connect_node_to_channel (const std::shared_ptr< Nodes::Node > &node, uint32_t channel_index=0, float mix=0.5F, bool clear_before=false)
 Connects a node to a specific output channel.
 
template<typename BufferType , typename... Args>
requires std::derived_from<BufferType, Buffers::VKBuffer>
auto create_buffer (Args &&... args) -> std::shared_ptr< BufferType >
 creates a new graphics buffer of the specified type and registers it
 
template<typename BufferType , typename... Args>
requires std::derived_from<BufferType, Buffers::AudioBuffer>
auto create_buffer (uint32_t channel, uint32_t buffer_size, Args &&... args) -> std::shared_ptr< BufferType >
 creates a new buffer of the specified type and registers it
 
std::shared_ptr< Kriya::BufferPipelinecreate_buffer_pipeline ()
 Creates a new buffer pipeline instance.
 
template<typename ContainerType , typename... Args>
requires std::derived_from<ContainerType, Kakshya::SignalSourceContainer>
auto create_container (Args &&... args) -> std::shared_ptr< ContainerType >
 creates a new container of the specified type
 
Domain create_custom_domain (Nodes::ProcessingToken node_token, Buffers::ProcessingToken buffer_token, Vruta::ProcessingToken task_token)
 Creates a custom domain from individual tokens with validation.
 
std::shared_ptr< Buffers::AudioBuffercreate_input_listener_buffer (uint32_t channel=0, bool add_to_output=false)
 Creates a new AudioBuffer for input listening.
 
Vruta::SoundRoutine create_line (float start_value, float end_value, float duration_seconds, uint32_t step_duration=5, bool retain=true)
 Creates a line generator that interpolates between values over time.
 
Vruta::SoundRoutine create_metro (double interval_seconds, std::function< void()> callback)
 Creates a simple task that calls a function at a specified interval.
 
template<typename NodeType , typename... Args>
requires std::derived_from<NodeType, Nodes::Node>
auto create_node (Args &&... args) -> std::shared_ptr< NodeType >
 
template<typename NodeNetworkType , typename... Args>
requires std::derived_from<NodeNetworkType, Nodes::Network::NodeNetwork>
auto create_node_network (Args &&... args) -> std::shared_ptr< NodeNetworkType >
 Creates a new node network.
 
Vruta::SoundRoutine create_pattern (std::function< std::any(uint64_t)> pattern_func, std::function< void(std::any)> callback, double interval_seconds)
 Schedules a pattern generator that produces values based on a pattern function.
 
std::shared_ptr< Buffers::BufferProcessingChaincreate_processing_chain ()
 Creates a new processing chain for the default engine.
 
template<typename ProcessorType , typename... Args>
requires std::derived_from<ProcessorType, Buffers::BufferProcessor>
auto create_processor (const std::shared_ptr< Buffers::AudioBuffer > buffer, Args &&... args) -> std::shared_ptr< ProcessorType >
 Creates a new processor and adds it to a buffer.
 
template<typename ProcessorType , typename... Args>
requires std::derived_from<ProcessorType, Buffers::BufferProcessor>
auto create_processor (const std::shared_ptr< Buffers::VKBuffer > buffer, Args &&... args) -> std::shared_ptr< ProcessorType >
 
std::shared_ptr< Kriya::SamplingPipelinecreate_sampler (const std::string &filepath, uint32_t num_samples=48000 *5, bool truncate=true, uint32_t channel=0, uint64_t max_dur_ms=0)
 Construct a built SamplingPipeline from an audio file.
 
std::shared_ptr< Kriya::SamplingPipelinecreate_sampler_from_stream (std::shared_ptr< Kakshya::DynamicSoundStream > stream, uint32_t channel=0, uint64_t max_dur_ms=0)
 Construct a built SamplingPipeline from an existing DynamicSoundStream.
 
std::vector< std::shared_ptr< Kriya::SamplingPipeline > > create_samplers (const std::string &filepath, uint32_t num_samples=48000 *5, bool truncate=true, uint64_t max_dur_ms=0, uint32_t max_channels=0)
 Construct one built SamplingPipeline per channel from an audio file.
 
Vruta::SoundRoutine create_sequence (std::vector< std::pair< double, std::function< void()> > > sequence)
 Creates a sequence task that calls functions at specified times.
 
std::shared_ptr< Core::Windowcreate_window (const Core::WindowCreateInfo &create_info)
 Create a new window with specified parameters.
 
Core::SubsystemTokens decompose_domain (Domain domain)
 Decomposes a Domain enum into its constituent ProcessingTokens.
 
void detach_from_audio_input (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel=0)
 Stops reading audio data from the default input source.
 
std::vector< double > detect_onsets (const Kakshya::DataVariant &data, double sample_rate, double threshold)
 
std::vector< double > detect_onsets (const std::vector< double > &data, double sample_rate=48000.0, double threshold=0.1)
 Detect onset times in single-channel signal.
 
std::vector< std::vector< double > > detect_onsets_per_channel (const std::vector< Kakshya::DataVariant > &channels, double sample_rate=48000.0, double threshold=0.1)
 Detect onset times per channel for multi-channel signal.
 
std::vector< std::pair< size_t, size_t > > detect_silence (const Kakshya::DataVariant &data, double threshold, size_t min_silence_duration)
 
std::vector< std::pair< size_t, size_t > > detect_silence (const std::vector< double > &data, double threshold=0.01, size_t min_silence_duration=1024)
 Detect silence regions in single-channel data.
 
std::vector< std::vector< std::pair< size_t, size_t > > > detect_silence_per_channel (const std::vector< Kakshya::DataVariant > &channels, double threshold=0.01, size_t min_silence_duration=1024)
 Detect silence regions per channel for multi-channel data.
 
std::string domain_to_string (Domain domain)
 Gets a human-readable string representation of a domain.
 
double dynamic_range (const Kakshya::DataVariant &data)
 
double dynamic_range (const std::vector< double > &data)
 Calculate dynamic range (max/min ratio in dB) of single-channel data.
 
double dynamic_range_global (const std::vector< Kakshya::DataVariant > &channels)
 Calculate dynamic range across all channels (global min/max)
 
std::vector< double > dynamic_range_per_channel (const std::vector< Kakshya::DataVariant > &channels)
 Calculate dynamic range per channel for multi-channel data.
 
void End ()
 Stops and cleans up the default engine.
 
double estimate_pitch (const Kakshya::DataVariant &data, double sample_rate, double min_freq, double max_freq)
 
double estimate_pitch (const std::vector< double > &data, double sample_rate=48000.0, double min_freq=80.0, double max_freq=2000.0)
 Estimate fundamental frequency using autocorrelation for single-channel data.
 
std::vector< double > estimate_pitch_per_channel (const std::vector< Kakshya::DataVariant > &channels, double sample_rate=48000.0, double min_freq=80.0, double max_freq=2000.0)
 Estimate fundamental frequency per channel for multi-channel data.
 
template<typename T >
bool expose_live (const char *key, const std::shared_ptr< T > &obj) noexcept
 Exposes an existing shared_ptr-managed object to the live arena under key.
 
template<typename T >
bool expose_live (const char *key, T *ptr) noexcept
 Exposes an existing raw pointer to the live arena under key.
 
std::vector< double > extract_silent_data (const Kakshya::DataVariant &data, double threshold, size_t min_silence_duration)
 
std::vector< double > extract_silent_data (const std::vector< double > &data, double threshold, size_t min_silence_duration)
 Extract silent regions from single-channel data.
 
std::vector< double > extract_zero_crossing_regions (const Kakshya::DataVariant &data, double threshold, size_t region_size)
 
std::vector< double > extract_zero_crossing_regions (const std::vector< double > &data, double threshold, size_t region_size)
 Extract zero crossing regions from single-channel data.
 
std::optional< Core::InputDeviceInfofind_hid_device (uint16_t vendor_id, uint16_t product_id)
 Find a HID device by vendor and product ID.
 
std::vector< Core::InputDeviceInfoget_all_input_devices ()
 Get a list of connected MIDI devices.
 
Nodes::RootNodeget_audio_channel_root (uint32_t channel=0)
 Gets the root node for a specific channel.
 
double get_brownian_motion (double start, double end)
 Generates a Brownian motion value.
 
std::shared_ptr< Buffers::BufferManagerget_buffer_manager ()
 Gets the buffer manager from the default engine.
 
MAYAFLUX_API Buffers::ProcessingToken get_buffer_token (Domain domain)
 Extracts buffer processing token from domain.
 
Core::Engineget_context ()
 Gets the default engine instance.
 
std::shared_ptr< Vruta::EventManagerget_event_manager ()
 Gets the event manager from the default engine.
 
double get_exponential_random (double start=0, double end=1)
 Generates an exponential random number.
 
double get_gaussian_random (double start=0, double end=1)
 Generates a gaussian (normal) random number.
 
std::vector< Core::InputDeviceInfoget_hid_devices ()
 Get a list of connected HID devices.
 
Core::InputManagerget_input_manager ()
 Gets a handle to default input manager.
 
const Core::InputSubsystemget_input_subsystem ()
 Gets the input subsystem.
 
std::shared_ptr< IO::IOManagerget_io_manager ()
 Retrieves the global IOManager instance for file loading and buffer management.
 
float * get_line_value (const std::string &name)
 Gets a pointer to a task's current value.
 
std::vector< Core::InputDeviceInfoget_midi_devices ()
 Get a list of connected MIDI devices.
 
std::shared_ptr< Nodes::NodeGraphManagerget_node_graph_manager ()
 Gets the node graph manager from the default engine.
 
MAYAFLUX_API Nodes::ProcessingToken get_node_token (Domain domain)
 Extracts node processing token from domain.
 
double get_poisson_random (double start=0, double end=1)
 Generates a poisson random number.
 
Kinesis::Stochastic::Stochasticget_random_engine ()
 Get reference to the default random engine.
 
Buffers::RootAudioBufferget_root_audio_buffer (uint32_t channel)
 Gets the audio buffer for a specific channel.
 
std::shared_ptr< Vruta::TaskSchedulerget_scheduler ()
 Gets the task scheduler from the default engine.
 
MAYAFLUX_API Vruta::ProcessingToken get_task_token (Domain domain)
 Extracts task processing token from domain.
 
double get_uniform_random (double start=0, double end=1)
 Generates a uniform random number.
 
Core::WindowManagerget_window_manager ()
 Gets a handle to default window manager.
 
void Init ()
 Initializes the default engine with default settings.
 
void Init (Core::GlobalStreamInfo stream_info, Core::GlobalGraphicsConfig graphics_config, Core::GlobalInputConfig input_config, Core::GlobalNetworkConfig network_config)
 Initializes the default engine with specified stream and graphics info.
 
void Init (uint32_t sample_rate, uint32_t buffer_size=512, uint32_t num_out_channels=2, uint32_t num_in_channels=0)
 Initializes the default engine with specified parameters.
 
void initialize_yantra ()
 Initialize Yantra subsystem with default configuration.
 
bool is_audio (const fs::path &filepath)
 
MAYAFLUX_API bool is_audio (const std::filesystem::path &filepath)
 Checks if the given file is an audio file based on its extension.
 
bool is_configured ()
 Checks if the default engine has currently accepted all configurations and initialized all managers.
 
bool is_domain_valid (Domain domain)
 Checks if a domain is valid (all constituent tokens are compatible)
 
bool is_engine_configured ()
 Checks if the default engine has currently accepted all configurations and initialized all managers.
 
bool is_image (const fs::path &filepath)
 
MAYAFLUX_API bool is_image (const std::filesystem::path &filepath)
 Checks if the given file is an image file based on its extension.
 
bool is_in_bounds (double window_x, double window_y, const std::shared_ptr< Core::Window > &window)
 Check if a point in window coordinates is inside the window bounds.
 
bool is_in_bounds (double window_x, double window_y, uint32_t window_width, uint32_t window_height)
 Check if a point in window coordinates is inside the window bounds.
 
bool is_initialized ()
 Checks if the default engine has been initialized.
 
MAYAFLUX_API void live_arena_dump () noexcept
 Dumps all live arena entries to stderr.
 
template<typename T >
std::shared_ptr< T > live_cast (const char *key) noexcept
 Retrieves a live-arena object by key as a shared_ptr<T>.
 
MAYAFLUX_API void * live_cast_impl (const char *key) noexcept
 Internal implementation for live_cast.
 
std::vector< double > magnitude_spectrum (const Kakshya::DataVariant &data, size_t window_size)
 
std::vector< double > magnitude_spectrum (const std::vector< double > &data, size_t window_size=0)
 Compute magnitude spectrum for single-channel data.
 
std::vector< std::vector< double > > magnitude_spectrum_per_channel (const std::vector< Kakshya::DataVariant > &channels, size_t window_size=0)
 Compute magnitude spectrum per channel for multi-channel data.
 
template<typename T , typename... Args>
std::shared_ptr< T > make_live (const char *key, Args &&... args)
 Constructs a T in-place inside the live arena and registers it under key.
 
template<typename T , typename... Args>
T & make_persistent (Args &&... args)
 Construct a T in place, retain it for process lifetime, and return a direct reference.
 
template<typename T >
std::decay_t< T > & make_persistent (T &&val)
 Store a value in the persistent store and return a reference to it.
 
template<typename T , typename... Args>
std::shared_ptr< T > make_persistent_shared (Args &&... args)
 Construct a T in place, retain it for process lifetime, and return a shared handle.
 
double mean (const Kakshya::DataVariant &data)
 
double mean (const std::vector< double > &data)
 Calculate mean of single-channel data.
 
double mean_combined (const std::vector< Kakshya::DataVariant > &channels)
 Calculate mean across all channels (mix then analyze)
 
std::vector< double > mean_per_channel (const std::vector< Kakshya::DataVariant > &channels)
 Calculate mean per channel for multi-channel data.
 
MAYAFLUX_API std::pair< Kakshya::DataVariant, Kakshya::DataVariantmid_side_to_stereo (const std::vector< Kakshya::DataVariant > &ms_channels)
 Convert Mid/Side channels to stereo L/R format.
 
std::vector< double > mix (const std::vector< Kakshya::DataVariant > &streams)
 
std::vector< double > mix (const std::vector< std::vector< double > > &streams)
 Mix multiple data streams with equal weighting.
 
MAYAFLUX_API Kakshya::DataVariant mix_to_mono (const std::vector< Kakshya::DataVariant > &channels)
 Mix multi-channel data to mono using equal weighting.
 
std::vector< double > mix_with_gains (const std::vector< Kakshya::DataVariant > &streams, const std::vector< double > &gains)
 
std::vector< double > mix_with_gains (const std::vector< std::vector< double > > &streams, const std::vector< double > &gains)
 Mix multiple data streams with specified gains.
 
void normalize (Kakshya::DataVariant &data, double target_peak)
 
void normalize (std::vector< double > &data, double target_peak=1.0)
 Normalize single-channel data to specified peak level (in-place)
 
void normalize_channels (std::vector< Kakshya::DataVariant > &channels, double target_peak=1.0)
 Normalize each channel independently to specified peak level (in-place)
 
glm::vec3 normalize_coords (double window_x, double window_y, const std::shared_ptr< Core::Window > &window)
 Convert window pixel coordinates to NDC using window state.
 
glm::vec3 normalize_coords (double window_x, double window_y, uint32_t window_width, uint32_t window_height)
 Convert window pixel coordinates to normalized device coordinates (NDC)
 
glm::vec3 normalize_coords_aspect (double window_x, double window_y, const std::shared_ptr< Core::Window > &window)
 Normalize coordinates preserving aspect ratio using window state.
 
glm::vec3 normalize_coords_aspect (double window_x, double window_y, uint32_t window_width, uint32_t window_height)
 Normalize coordinates preserving aspect ratio (useful for circular/square shapes)
 
void normalize_together (std::vector< Kakshya::DataVariant > &channels, double target_peak=1.0)
 Normalize multi-channel data relative to global peak (in-place)
 
Kakshya::DataVariant normalized (const Kakshya::DataVariant &data, double target_peak)
 
std::vector< double > normalized (const std::vector< double > &data, double target_peak=1.0)
 Normalize single-channel data (non-destructive)
 
std::vector< Kakshya::DataVariantnormalized_channels (const std::vector< Kakshya::DataVariant > &channels, double target_peak=1.0)
 Normalize each channel independently (non-destructive)
 
void on_any_key (const std::shared_ptr< Core::Window > &window, std::function< void(IO::Keys)> callback, std::string name="")
 Schedule a handler for any key press.
 
void on_key_pressed (const std::shared_ptr< Core::Window > &window, IO::Keys key, std::function< void()> callback, std::string name="")
 Schedule a key press handler.
 
void on_key_released (const std::shared_ptr< Core::Window > &window, IO::Keys key, std::function< void()> callback, std::string name="")
 Schedule a key release handler.
 
void on_mouse_move (const std::shared_ptr< Core::Window > &window, std::function< void(double, double)> callback, std::string name="")
 Schedule a mouse movement handler.
 
void on_mouse_pressed (const std::shared_ptr< Core::Window > &window, IO::MouseButtons button, std::function< void(double, double)> callback, std::string name="")
 Schedule a mouse button press handler.
 
void on_mouse_released (const std::shared_ptr< Core::Window > &window, IO::MouseButtons button, std::function< void(double, double)> callback, std::string name="")
 Schedule a mouse button release handler.
 
std::shared_ptr< Vruta::NetworkSourceon_network_message (const Core::EndpointInfo &info, std::function< void(const Core::NetworkMessage &)> callback, std::string name="")
 Schedule an on_message handler, constructing the NetworkSource from config.
 
void on_network_message (std::shared_ptr< Vruta::NetworkSource > source, std::function< void(const Core::NetworkMessage &)> callback, std::string name="")
 Schedule an on_message handler with an existing NetworkSource.
 
std::shared_ptr< Vruta::NetworkSourceon_network_message_from (const Core::EndpointInfo &info, std::string sender_address, std::function< void(const Core::NetworkMessage &)> callback, std::string name="")
 Schedule an on_message_from handler, constructing the NetworkSource from config.
 
void on_network_message_from (std::shared_ptr< Vruta::NetworkSource > source, std::string sender_address, std::function< void(const Core::NetworkMessage &)> callback, std::string name="")
 Schedule an on_message_from handler with an existing NetworkSource.
 
std::shared_ptr< Vruta::NetworkSourceon_network_message_matching (const Core::EndpointInfo &info, std::function< bool(const Core::NetworkMessage &)> predicate, std::function< void(const Core::NetworkMessage &)> callback, std::string name="")
 Schedule an on_message_matching handler, constructing the NetworkSource from config.
 
void on_network_message_matching (std::shared_ptr< Vruta::NetworkSource > source, std::function< bool(const Core::NetworkMessage &)> predicate, std::function< void(const Core::NetworkMessage &)> callback, std::string name="")
 Schedule an on_message_matching handler with an existing NetworkSource.
 
void on_scroll (const std::shared_ptr< Core::Window > &window, std::function< void(double, double)> callback, std::string name="")
 Schedule a mouse scroll handler.
 
std::shared_ptr< Nodes::Nodeoperator* (const std::shared_ptr< Nodes::Node > &lhs, const std::shared_ptr< Nodes::Node > &rhs)
 Combines two nodes in parallel (multiplication)
 
std::shared_ptr< Nodes::Nodeoperator+ (const std::shared_ptr< Nodes::Node > &lhs, const std::shared_ptr< Nodes::Node > &rhs)
 Combines two nodes in parallel (addition)
 
std::shared_ptr< Nodes::Nodeoperator>> (const std::shared_ptr< Nodes::Node > &lhs, const std::shared_ptr< Nodes::Node > &rhs)
 Connects two nodes in series (pipeline operator)
 
template<typename T >
TemporalWrapper< T > operator>> (std::shared_ptr< T > entity, const TimeSpec &spec)
 Creates a TemporalWrapper for an entity and a TimeSpec.
 
std::shared_ptr< Buffers::Bufferoperator| (const TemporalWrapper< Buffers::Buffer > &wrapper, Domain domain)
 Activates a buffer in a specific domain for the duration specified by the TemporalWrapper.
 
std::shared_ptr< Nodes::Network::NodeNetworkoperator| (const TemporalWrapper< Nodes::Network::NodeNetwork > &wrapper, Domain domain)
 Activates a node network in a specific domain for the duration specified by the TemporalWrapper.
 
std::shared_ptr< Nodes::Nodeoperator| (const TemporalWrapper< Nodes::Node > &wrapper, Domain domain)
 Activates a node in a specific domain for the duration specified by the TemporalWrapper.
 
std::shared_ptr< Kakshya::SoundFileContaineroperator| (std::shared_ptr< Kakshya::SoundFileContainer > obj, const CreationContext &ctx)
 
template<typename T >
requires std::is_base_of_v<Nodes::Node, T>
std::shared_ptr< T > operator| (std::shared_ptr< T > obj, const CreationContext &ctx)
 
template<typename T >
requires std::is_base_of_v<Nodes::Network::NodeNetwork, T>
std::shared_ptr< T > operator| (std::shared_ptr< T > obj, const CreationContext &ctx)
 
template<typename T >
requires std::is_base_of_v<Buffers::Buffer, T>
std::shared_ptr< T > operator| (std::shared_ptr< T > obj, const CreationContext &ctx)
 
void Pause ()
 Pauses audio processing on the default engine.
 
double peak (const Kakshya::DataVariant &data)
 
double peak (const std::vector< double > &data)
 Find peak amplitude in single-channel data.
 
double peak (const std::vector< Kakshya::DataVariant > &channels)
 Find peak amplitude across all channels (global peak)
 
double peak_channel (const std::vector< Kakshya::DataVariant > &channels, size_t channel_index)
 Find peak amplitude in specific channel.
 
std::vector< double > peak_per_channel (const std::vector< Kakshya::DataVariant > &channels)
 Find peak amplitude per channel for multi-channel data.
 
MAYAFLUX_API double phase_correlation (const Kakshya::DataVariant &channel1, const Kakshya::DataVariant &channel2)
 Calculate phase correlation between two channels.
 
std::vector< double > power_spectrum (const Kakshya::DataVariant &data, size_t window_size)
 
std::vector< double > power_spectrum (const std::vector< double > &data, size_t window_size=0)
 Compute power spectrum for single-channel data.
 
std::vector< std::vector< double > > power_spectrum_per_channel (const std::vector< Kakshya::DataVariant > &channels, size_t window_size=0)
 Compute power spectrum per channel for multi-channel data.
 
std::vector< std::shared_ptr< Buffers::SoundContainerBuffer > > prepare_audio_buffers (const std::shared_ptr< Kakshya::SoundFileContainer > &container)
 Constructs and initializes per-channel SoundContainerBuffers without registering them.
 
void read_from_audio_input (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel=0)
 Reads audio data from the default input source into a buffer.
 
void register_audio_buffer (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel=0)
 Registers an AudioBuffer with the default engine's buffer manager.
 
void register_audio_node (const std::shared_ptr< Nodes::Node > &node, const std::vector< uint32_t > &channels)
 Adds a node to the root node of specified channels.
 
void register_audio_node (const std::shared_ptr< Nodes::Node > &node, uint32_t channel=0)
 Adds a node to the root node of a specific channel.
 
void register_buffer (const std::shared_ptr< Buffers::Buffer > &buffer, const CreationContext &ctx)
 
void register_container (const std::shared_ptr< Kakshya::SoundFileContainer > &container, const Domain &domain)
 
void register_graphics_buffer (const std::shared_ptr< Buffers::VKBuffer > &buffer, Buffers::ProcessingToken token=Buffers::ProcessingToken::GRAPHICS_BACKEND)
 Registers a VKBuffer with the default engine's buffer manager.
 
void register_input_node (const std::shared_ptr< Nodes::Input::InputNode > &node, const Core::InputBinding &binding)
 Register an input node with specified binding.
 
void register_network (const std::shared_ptr< Nodes::Network::NodeNetwork > &network, const CreationContext &ctx)
 
void register_node (const std::shared_ptr< Nodes::Node > &node, const CreationContext &ctx)
 
void register_node (const std::shared_ptr< Nodes::Node > &node, const Nodes::ProcessingToken &token, uint32_t channel)
 
void register_node_network (const std::shared_ptr< Nodes::Network::NodeNetwork > &network, const Nodes::ProcessingToken &token=Nodes::ProcessingToken::AUDIO_RATE)
 Registers a node network with the default engine's node graph manager.
 
void remove_processor (const std::shared_ptr< Buffers::BufferProcessor > &processor, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
 Removes a processor from all buffers in a processing domain.
 
void remove_processor (const std::shared_ptr< Buffers::BufferProcessor > &processor, const std::shared_ptr< Buffers::Buffer > &buffer)
 Removes a processor from a specific buffer.
 
void remove_processor (const std::shared_ptr< Buffers::BufferProcessor > &processor, uint32_t channel, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
 Removes a processor from all buffers in a specific channel.
 
void remove_supplied_buffer_from_channel (const std::shared_ptr< Buffers::AudioBuffer > &buffer, const uint32_t channel)
 Removes a supplied buffer from multiple channels.
 
void remove_supplied_buffer_from_channels (const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels)
 Removes a supplied buffer from multiple channels.
 
bool restart_task (const std::string &name)
 Restarts a scheduled task.
 
void Resume ()
 Resumes audio processing on the default engine.
 
void reverse (Kakshya::DataVariant &data)
 
void reverse (std::vector< double > &data)
 Reverse time order of single-channel data (in-place)
 
void reverse_channels (std::vector< Kakshya::DataVariant > &channels)
 Reverse time order of multi-channel data (in-place)
 
Kakshya::DataVariant reversed (const Kakshya::DataVariant &data)
 
std::vector< double > reversed (const std::vector< double > &data)
 Reverse time order of single-channel data (non-destructive)
 
std::vector< Kakshya::DataVariantreversed_channels (const std::vector< Kakshya::DataVariant > &channels)
 Reverse time order of multi-channel data (non-destructive)
 
double rms (const Kakshya::DataVariant &data)
 
double rms (const std::vector< double > &data)
 Calculate RMS (Root Mean Square) energy of single-channel data.
 
double rms_combined (const std::vector< Kakshya::DataVariant > &channels)
 Calculate RMS energy across all channels (mix then analyze)
 
std::vector< double > rms_per_channel (const std::vector< Kakshya::DataVariant > &channels)
 Calculate RMS energy per channel for multi-channel data.
 
void route_buffer (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t target_channel, double seconds_to_fade=1.0, const Buffers::ProcessingToken &token=Buffers::ProcessingToken::AUDIO_BACKEND)
 Routes a buffer from its current channel to a target channel with fade.
 
void route_buffer (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t target_channel, uint32_t num_blocks, const Buffers::ProcessingToken &token=Buffers::ProcessingToken::AUDIO_BACKEND)
 Routes a buffer from its current channel to a target channel with fade.
 
void route_network (const std::shared_ptr< Nodes::Network::NodeNetwork > &network, const std::vector< uint32_t > &channels, double seconds_to_fade=1.F, const Nodes::ProcessingToken &token=Nodes::ProcessingToken::AUDIO_RATE)
 @breif Moves the network from its current channel(s) to the specified channel(s) with an optional fade time
 
void route_network (const std::shared_ptr< Nodes::Network::NodeNetwork > &network, const std::vector< uint32_t > &channels, uint32_t num_samples, const Nodes::ProcessingToken &token=Nodes::ProcessingToken::AUDIO_RATE)
 @breif Moves the node from its current channel(s) to the specified channel(s) with an optional fade time
 
void route_node (const std::shared_ptr< Nodes::Node > &node, const std::vector< uint32_t > &channels, double seconds_to_fade=1.F, const Nodes::ProcessingToken &token=Nodes::ProcessingToken::AUDIO_RATE)
 @breif Moves the node from its current channel(s) to the specified channel(s) with an optional fade time
 
void route_node (const std::shared_ptr< Nodes::Node > &node, const std::vector< uint32_t > &channels, uint32_t num_samples, const Nodes::ProcessingToken &token=Nodes::ProcessingToken::AUDIO_RATE)
 @breif Moves the node from its current channel(s) to the specified channel(s) with an optional fade time
 
uint64_t samples_to_blocks (uint64_t samples)
 Converts samples to blocks based on current block size.
 
double samples_to_seconds (uint64_t samples)
 Converts a number of audio samples to the equivalent time duration in seconds.
 
void schedule_metro (double interval_seconds, std::function< void()> callback, std::string name="")
 Creates a metronome task and addes it to the default scheduler list for evaluation.
 
void schedule_pattern (std::function< std::any(uint64_t)> pattern_func, std::function< void(std::any)> callback, double interval_seconds, std::string name="")
 Schedules a pattern generator that produces values based on a pattern function and addes it to the default scheduler list for evaluation.
 
void schedule_sequence (std::vector< std::pair< double, std::function< void()> > > sequence, std::string name="")
 Creates a sequence task that calls functions at specified times and addes it to the default scheduler list for evaluation.
 
void schedule_task (const std::string &name, Vruta::SoundRoutine &&task, bool initialize=false)
 Schedules a new sound routine task.
 
uint64_t seconds_to_blocks (double seconds)
 Converts a time duration in seconds to the equivalent number of processing blocks.
 
uint64_t seconds_to_samples (double seconds)
 Converts a time duration in seconds to the equivalent number of audio samples.
 
void set_and_transfer_context (Core::Engine instance)
 Replaces the default engine with a new instance.
 
double spectral_centroid (const Kakshya::DataVariant &data, double sample_rate)
 
double spectral_centroid (const std::vector< double > &data, double sample_rate=48000.0)
 Find spectral centroid (brightness measure) for single-channel data.
 
std::vector< double > spectral_centroid_per_channel (const std::vector< Kakshya::DataVariant > &channels, double sample_rate=48000.0)
 Find spectral centroid per channel for multi-channel data.
 
void Start ()
 Starts audio processing on the default engine.
 
double std_dev (const Kakshya::DataVariant &data)
 
double std_dev (const std::vector< double > &data)
 Calculate standard deviation of single-channel data.
 
double std_dev_combined (const std::vector< Kakshya::DataVariant > &channels)
 Calculate standard deviation across all channels (mix then analyze)
 
std::vector< double > std_dev_per_channel (const std::vector< Kakshya::DataVariant > &channels)
 Calculate standard deviation per channel for multi-channel data.
 
MAYAFLUX_API std::pair< Kakshya::DataVariant, Kakshya::DataVariantstereo_to_mid_side (const std::vector< Kakshya::DataVariant > &lr_channels)
 Convert stereo L/R channels to Mid/Side format.
 
MAYAFLUX_API double stereo_width (const std::vector< Kakshya::DataVariant > &lr_channels)
 Calculate stereo width measure for L/R channels.
 
template<typename T >
std::shared_ptr< T > store (std::shared_ptr< T > obj)
 Transfer ownership of an existing object to the persistent store for process lifetime.
 
template<typename T >
std::shared_ptr< T > store (std::string_view key, std::shared_ptr< T > obj)
 Transfer ownership of an existing object to the persistent store and expose it to the live arena under key.
 
template<typename T >
void store (T obj)
 Transfer ownership of a value to the persistent store for process lifetime.
 
void supply_buffer_to_channel (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel, double mix=1.0)
 Supplies a buffer to a single channel with mixing.
 
void supply_buffer_to_channels (const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels, double mix=1.0)
 Supplies a buffer to multiple channels with mixing.
 
TimeSpec Time (double seconds, std::vector< uint32_t > channels)
 Creates a TimeSpec with the specified duration and a list of channels.
 
TimeSpec Time (double seconds, uint32_t channel=0)
 Creates a TimeSpec with the specified duration and a single channel.
 
Kakshya::DataVariant to_data_variant (const std::vector< double > &data)
 Convert vector<double> to DataVariant.
 
std::vector< Kakshya::DataVariantto_data_variants (const std::vector< std::vector< double > > &channel_data)
 Convert vector of double vectors to multi-channel DataVariant format.
 
std::vector< double > to_double_vector (const Kakshya::DataVariant &data)
 Convert DataVariant to vector<double> if possible.
 
std::vector< std::vector< double > > to_double_vectors (const std::vector< Kakshya::DataVariant > &channels)
 Convert multi-channel data to vector of double vectors.
 
void unbind_viewport_preset (const std::shared_ptr< Core::Window > &window, const std::string &name="default")
 Cancel all event handlers registered by bind_viewport_preset() and restore the window input config to its state before bind was called.
 
void unregister_audio_buffer (const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel=0)
 Unregisters an AudioBuffer from the default engine's buffer manager.
 
void unregister_audio_node (const std::shared_ptr< Nodes::Node > &node, const std::vector< uint32_t > &channels)
 Removes a node from the root node from list of channels.
 
void unregister_audio_node (const std::shared_ptr< Nodes::Node > &node, uint32_t channel=0)
 Removes a node from the root node of a specific channel.
 
void unregister_graphics_buffer (const std::shared_ptr< Buffers::VKBuffer > &buffer)
 Unregisters a VKBuffer from the default engine's buffer manager.
 
void unregister_input_node (const std::shared_ptr< Nodes::Input::InputNode > &node)
 Unregister an input node.
 
void unregister_node (const std::shared_ptr< Nodes::Node > &node, const Nodes::ProcessingToken &token, uint32_t channel=0)
 Removes a node from the root node of specified channels.
 
void unregister_node_network (const std::shared_ptr< Nodes::Network::NodeNetwork > &network, const Nodes::ProcessingToken &token=Nodes::ProcessingToken::AUDIO_RATE)
 Unregisters a node network from the default engine's node graph manager.
 
template<typename... Args>
bool update_task_params (const std::string &name, Args... args)
 Updates parameters of a scheduled task.
 
template<typename... Args>
MAYAFLUX_API bool update_task_params (const std::string &name, Args... args)
 Updates parameters of a scheduled task.
 
glm::vec2 window_coords (const glm::vec3 &ndc_pos, const std::shared_ptr< Core::Window > &window)
 Convert NDC vec3 position to window pixel coordinates using window state.
 
glm::vec2 window_coords (const glm::vec3 &ndc_pos, uint32_t window_width, uint32_t window_height)
 Convert NDC vec3 position to window pixel coordinates.
 
glm::vec2 window_coords (double ndc_x, double ndc_y, double ndc_z, const std::shared_ptr< Core::Window > &window)
 Convert NDC coordinates to window pixel coordinates using window state.
 
glm::vec2 window_coords (double ndc_x, double ndc_y, double ndc_z, uint32_t window_width, uint32_t window_height)
 Convert NDC coordinates to window pixel coordinates.
 
std::vector< std::vector< double > > windowed_segments (const Kakshya::DataVariant &data, size_t window_size, size_t hop_size)
 
std::vector< std::vector< double > > windowed_segments (const std::vector< double > &data, size_t window_size, size_t hop_size)
 Split single-channel data into overlapping windows.
 
std::vector< std::vector< std::vector< double > > > windowed_segments_per_channel (const std::vector< Kakshya::DataVariant > &channels, size_t window_size, size_t hop_size)
 Split multi-channel data into overlapping windows per channel.
 
Kakshya::DataVariant with_gain (const Kakshya::DataVariant &data, double gain_factor)
 
std::vector< double > with_gain (const std::vector< double > &data, double gain_factor)
 Apply gain to single-channel data (non-destructive)
 
std::vector< Kakshya::DataVariantwith_gain_channels (const std::vector< Kakshya::DataVariant > &channels, double gain_factor)
 Apply gain to multi-channel data (non-destructive)
 
double zero_crossing_rate (const Kakshya::DataVariant &data, size_t window_size)
 
double zero_crossing_rate (const std::vector< double > &data, size_t window_size=0)
 Calculate zero crossing rate for single-channel data.
 
std::vector< double > zero_crossing_rate_per_channel (const std::vector< Kakshya::DataVariant > &channels, size_t window_size=0)
 Calculate zero crossing rate per channel for multi-channel data.
 
std::vector< size_t > zero_crossings (const Kakshya::DataVariant &data, double threshold)
 
std::vector< size_t > zero_crossings (const std::vector< double > &data, double threshold=0.0)
 Detect zero crossings in single-channel signal.
 
std::vector< std::vector< size_t > > zero_crossings_per_channel (const std::vector< Kakshya::DataVariant > &channels, double threshold=0.0)
 Detect zero crossings per channel for multi-channel signal.
 

Variables

static constexpr DomainSpec Audio { .value = Domain::AUDIO }
 Domain constant for Audio domain.
 
static constexpr DomainSpec Graphics { .value = Domain::GRAPHICS }
 Domain constant for Graphics domain.
 
Creator vega {}
 Global Creator instance.
 

Detailed Description

Main namespace for the Maya Flux audio engine.

This namespace provides convenience wrappers around the core functionality of the Maya Flux audio engine. These wrappers simplify access to the centrally managed components and common operations, making it easier to work with the engine without directly managing the Engine instance.

All functions in this namespace operate on the default Engine instance and its managed components. For custom or non-default components, use their specific handles and methods directly rather than these wrappers.