Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
sound_observation.h
Go to the documentation of this file.
1
5#ifndef OAKFIELD_SOUND_OBSERVATION_H
6#define OAKFIELD_SOUND_OBSERVATION_H
7
9
10#include <stdbool.h>
11#include <stddef.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17struct SimContext;
18
29
38
51
59
70
78
87
95
105
114
123
172
185
199 const SimSoundObservationConfig *config,
200 size_t *out_index);
201
212SimResult sim_sound_observation_config(struct SimContext *context, size_t operator_index,
213 SimSoundObservationConfig *out_config);
214
228SimResult sim_sound_observation_update(struct SimContext *context, size_t operator_index,
229 const SimSoundObservationConfig *config);
230
241SimResult sim_sound_observation_tap(struct SimContext *context, size_t operator_index,
242 SimSoundObservationTap *out_tap);
243
244#ifdef __cplusplus
245}
246#endif
247
248#endif /* OAKFIELD_SOUND_OBSERVATION_H */
SimResult
Return codes shared by libsimcore modules.
Definition field.h:29
Declarative complex-first operator splitting (substep expansion at plan time).
SimResult sim_sound_observation_tap(struct SimContext *context, size_t operator_index, SimSoundObservationTap *out_tap)
Copy the latest sound-control tap from a registered observer.
SimSoundRawSampleSource
Component sampled when emitting raw audio samples.
Definition sound_observation.h:99
@ SIM_SOUND_RAW_SOURCE_IMAG
Definition sound_observation.h:101
@ SIM_SOUND_RAW_SOURCE_REAL
Definition sound_observation.h:100
@ SIM_SOUND_RAW_SOURCE_PHASE
Definition sound_observation.h:103
@ SIM_SOUND_RAW_SOURCE_MAGNITUDE
Definition sound_observation.h:102
SimSoundRawChannelMode
Channel layout used for raw audio sample output.
Definition sound_observation.h:109
@ SIM_SOUND_RAW_CHANNEL_STEREO_DUPLICATE
Definition sound_observation.h:111
@ SIM_SOUND_RAW_CHANNEL_STEREO_REAL_IMAG
Definition sound_observation.h:112
@ SIM_SOUND_RAW_CHANNEL_MONO
Definition sound_observation.h:110
SimSoundSamplingDomain
Domain sampled by the observer.
Definition sound_observation.h:55
@ SIM_SOUND_SAMPLING_DOMAIN_SPECTRAL
Definition sound_observation.h:57
@ SIM_SOUND_SAMPLING_DOMAIN_PHYSICAL
Definition sound_observation.h:56
SimSoundWindowType
Window function applied to multi-sample reductions.
Definition sound_observation.h:63
@ SIM_SOUND_WINDOW_BLACKMAN
Definition sound_observation.h:67
@ SIM_SOUND_WINDOW_KAISER
Definition sound_observation.h:68
@ SIM_SOUND_WINDOW_HANN
Definition sound_observation.h:65
@ SIM_SOUND_WINDOW_HAMMING
Definition sound_observation.h:66
@ SIM_SOUND_WINDOW_RECT
Definition sound_observation.h:64
SimSoundModulatorSource
Optional modulation source for a translated control.
Definition sound_observation.h:33
@ SIM_SOUND_MODULATOR_SELF_FIELD
Definition sound_observation.h:35
@ SIM_SOUND_MODULATOR_NONE
Definition sound_observation.h:34
@ SIM_SOUND_MODULATOR_EXTERNAL_FIELD
Definition sound_observation.h:36
SimSoundPanLaw
Mapping from pan control value to channel gains.
Definition sound_observation.h:74
@ SIM_SOUND_PAN_LAW_EQUAL_POWER
Definition sound_observation.h:76
@ SIM_SOUND_PAN_LAW_LINEAR
Definition sound_observation.h:75
SimResult sim_sound_observation_update(struct SimContext *context, size_t operator_index, const SimSoundObservationConfig *config)
Replace or renormalize a registered sound observation configuration.
SimSoundOutputMode
Output representation produced by the observation operator.
Definition sound_observation.h:91
@ SIM_SOUND_OUTPUT_CONTROLS
Definition sound_observation.h:92
@ SIM_SOUND_OUTPUT_RAW_SAMPLES
Definition sound_observation.h:93
SimResult sim_sound_observation_config(struct SimContext *context, size_t operator_index, SimSoundObservationConfig *out_config)
Copy the current sound observation configuration from a registered operator.
SimSoundPitchScale
Pitch-control scale used to derive output frequency.
Definition sound_observation.h:82
@ SIM_SOUND_PITCH_SCALE_MIDI
Definition sound_observation.h:85
@ SIM_SOUND_PITCH_SCALE_LINEAR_HZ
Definition sound_observation.h:83
@ SIM_SOUND_PITCH_SCALE_LOG2_HZ
Definition sound_observation.h:84
SimSoundTranslationSource
Field-derived source used to drive a sound control.
Definition sound_observation.h:22
@ SIM_SOUND_TRANSLATION_SOURCE_FIELD
Definition sound_observation.h:27
@ SIM_SOUND_TRANSLATION_SOURCE_SPECTRAL_CENTROID
Definition sound_observation.h:26
@ SIM_SOUND_TRANSLATION_SOURCE_OFF
Definition sound_observation.h:23
@ SIM_SOUND_TRANSLATION_SOURCE_PHASE
Definition sound_observation.h:25
@ SIM_SOUND_TRANSLATION_SOURCE_AMPLITUDE
Definition sound_observation.h:24
SimSoundResampleMode
Resampling kernel for converting field samples to raw audio samples.
Definition sound_observation.h:118
@ SIM_SOUND_RESAMPLE_LINEAR
Definition sound_observation.h:120
@ SIM_SOUND_RESAMPLE_NEAREST
Definition sound_observation.h:119
@ SIM_SOUND_RESAMPLE_CUBIC
Definition sound_observation.h:121
SimSoundSamplingMode
Reduction used when sampling a field for sound observation.
Definition sound_observation.h:42
@ SIM_SOUND_SAMPLING_RMS
Definition sound_observation.h:45
@ SIM_SOUND_SAMPLING_POINT
Definition sound_observation.h:43
@ SIM_SOUND_SAMPLING_MEAN
Definition sound_observation.h:44
@ SIM_SOUND_SAMPLING_ABS_MEAN
Definition sound_observation.h:47
@ SIM_SOUND_SAMPLING_WINDOWED_RMS
Definition sound_observation.h:49
@ SIM_SOUND_SAMPLING_PEAK
Definition sound_observation.h:46
@ SIM_SOUND_SAMPLING_ABS_PEAK
Definition sound_observation.h:48
SimResult sim_add_sound_observation_operator(struct SimContext *context, const SimSoundObservationConfig *config, size_t *out_index)
Register a sound observation operator.
Simulation runtime state.
Definition sim_context.h:70
Configuration for sound observation and audio-control extraction.
Definition sound_observation.h:127
SimSoundTranslationSource gain_source
Definition sound_observation.h:140
SimSoundSamplingDomain sampling_domain
Definition sound_observation.h:135
double gain_base
Definition sound_observation.h:142
double gain_max
Definition sound_observation.h:145
SimSoundTranslationSource pitch_source
Definition sound_observation.h:151
size_t modulator_field
Definition sound_observation.h:129
double smoothing_tau
Definition sound_observation.h:164
SimSoundSamplingMode sampling_mode
Definition sound_observation.h:134
bool scale_by_dt
Definition sound_observation.h:165
double release_ms
Definition sound_observation.h:163
size_t window_length
Definition sound_observation.h:137
double output_send
Definition sound_observation.h:132
double attack_ms
Definition sound_observation.h:162
SimSoundRawChannelMode raw_channel_mode
Definition sound_observation.h:167
SimSoundTranslationSource fm_source
Definition sound_observation.h:156
SimSoundModulatorSource gain_modulator
Definition sound_observation.h:141
SimSoundTranslationSource pan_source
Definition sound_observation.h:146
SimSoundPanLaw pan_law
Definition sound_observation.h:150
size_t sample_index
Definition sound_observation.h:139
double fm_center
Definition sound_observation.h:159
size_t output_bus
Definition sound_observation.h:131
double pan_width
Definition sound_observation.h:149
double gain_scale
Definition sound_observation.h:143
SimSoundModulatorSource pitch_modulator
Definition sound_observation.h:152
SimSoundRawSampleSource raw_source
Definition sound_observation.h:166
size_t window_offset
Definition sound_observation.h:138
double raw_gain
Definition sound_observation.h:168
bool output_pre_fader
Definition sound_observation.h:133
double fm_ratio
Definition sound_observation.h:160
double pitch_range_octaves
Definition sound_observation.h:154
double raw_clip
Definition sound_observation.h:169
double gain_min
Definition sound_observation.h:144
SimSoundWindowType window_type
Definition sound_observation.h:136
double fm_depth
Definition sound_observation.h:158
SimSoundModulatorSource fm_modulator
Definition sound_observation.h:157
double fm_clip
Definition sound_observation.h:161
double pitch_base_hz
Definition sound_observation.h:153
size_t input_field
Definition sound_observation.h:128
SimSoundModulatorSource pan_modulator
Definition sound_observation.h:147
SimSoundOutputMode output_mode
Definition sound_observation.h:130
SimSoundResampleMode raw_resample_mode
Definition sound_observation.h:170
double pan_center
Definition sound_observation.h:148
SimSoundPitchScale pitch_scale
Definition sound_observation.h:155
Latest sound-control values produced by an observation operator.
Definition sound_observation.h:176
double gain
Definition sound_observation.h:177
double pitch_hz
Definition sound_observation.h:179
bool valid
Definition sound_observation.h:182
SimSoundOutputMode output_mode
Definition sound_observation.h:181
double pan
Definition sound_observation.h:178
double fm
Definition sound_observation.h:180
size_t step_index
Definition sound_observation.h:183