pub struct ScratchAcousticDsp { /* private fields */ }Implementations§
Source§impl ScratchAcousticDsp
impl ScratchAcousticDsp
pub fn new( output_sample_rate: f64, config: JsValue, ) -> Result<ScratchAcousticDsp, JsValue>
Sourcepub fn prepare_window(
&mut self,
channel_count: u32,
length: u32,
) -> Result<(), JsValue>
pub fn prepare_window( &mut self, channel_count: u32, length: u32, ) -> Result<(), JsValue>
Prepares stable Rust-owned channel storage for a direct AudioWorklet copy. This removes the wasm-bindgen Array traversal from the realtime window replacement path while retaining Rust ownership of source PCM.
pub fn window_channel_ptr(&mut self, channel_index: u32) -> *mut f32
Sourcepub fn commit_window(
&mut self,
source_sample_rate: f64,
window_start: u32,
total_frames: u32,
reset_position: Option<f64>,
) -> Result<(), JsValue>
pub fn commit_window( &mut self, source_sample_rate: f64, window_start: u32, total_frames: u32, reset_position: Option<f64>, ) -> Result<(), JsValue>
Publishes a fully copied prepared window. No allocation occurs on the successful path.
pub fn clear_window(&mut self)
pub fn start(&mut self)
pub fn stop(&mut self)
pub fn set_effects(&mut self, acoustic_enabled: bool, surface_enabled: bool)
pub fn set_manual_fader_gain(&mut self, gain: f64) -> Result<(), JsValue>
pub fn set_manual_crossfader(&mut self, position: f64) -> Result<(), JsValue>
pub fn manual_fader_gain(&self) -> f64
Sourcepub fn set_momentary_crossfader_override(&mut self, active: bool, open: bool)
pub fn set_momentary_crossfader_override(&mut self, active: bool, open: bool)
Overrides the selected technique while the host control is active. The release returns control to the technique through a de-click ramp.
Sourcepub fn set_crossfader_touch_override(&mut self, active: bool, gain: f64)
pub fn set_crossfader_touch_override(&mut self, active: bool, gain: f64)
Gives a touched host fader temporary control of the audible gate. Releasing the fader returns control to the selected scratch technique.
Sourcepub fn audible_crossfader_gain(&self) -> f64
pub fn audible_crossfader_gain(&self) -> f64
Reports the final audible fader gain after all technique and host input.
Sourcepub fn set_output_gain(
&mut self,
gain: f64,
ramp_ms: f64,
) -> Result<(), JsValue>
pub fn set_output_gain( &mut self, gain: f64, ramp_ms: f64, ) -> Result<(), JsValue>
Final post-mix gain used by the host for packet and mixer level. A linear ramp starts from the gain active at the next rendered frame.
pub fn capture_replay_state(&mut self)
pub fn restore_replay_state(&mut self) -> bool
Sourcepub fn begin_deterministic_replay(
&mut self,
position: f64,
rotation_turns: f64,
replay_seed: u32,
) -> Result<(), JsValue>
pub fn begin_deterministic_replay( &mut self, position: f64, rotation_turns: f64, replay_seed: u32, ) -> Result<(), JsValue>
Reinitializes every dynamic input that can color a recorded take. The caller must capture the live state first and restore it after the replay transaction. Static PCM, surface assets and selected controls remain in place.
Sourcepub fn begin_deterministic_replay_from(
&mut self,
position: f64,
rotation_turns: f64,
replay_seed: u32,
rate: f64,
) -> Result<(), JsValue>
pub fn begin_deterministic_replay_from( &mut self, position: f64, rotation_turns: f64, replay_seed: u32, rate: f64, ) -> Result<(), JsValue>
beginDeterministicReplay, with the platter already turning.
A take punched in on a running record starts at speed. Beginning its
replay from rest put a spin-up under the first beat that the take
never had: the motor model ramped from zero toward the transport the
first events set. rate is the platter’s rate at punch-in, in units
of the native speed, and the platter is reset to it rather than
toward it.
Source§impl ScratchAcousticDsp
impl ScratchAcousticDsp
Takes another engine’s record as this engine’s own, without a copy.
The source PCM sits behind an Arc; a headless engine that renders a
take’s log to audio shares the live deck’s record for the length of
the render and lets it go. The record’s speed, seed and wear come
with it, so a log with no world replays on the record as it is.
Transport starts from rest at the top of the side.
Sourcepub fn arm_revolution(
&mut self,
start_position: f64,
max_frames: u32,
replay_seed: u32,
) -> Result<(), &'static str>
pub fn arm_revolution( &mut self, start_position: f64, max_frames: u32, replay_seed: u32, ) -> Result<(), &'static str>
armRevolutionCapture, off the wasm binding.
Sourcepub fn begin_replay(
&mut self,
position: f64,
rotation_turns: f64,
replay_seed: u32,
rate: f64,
) -> Result<(), &'static str>
pub fn begin_replay( &mut self, position: f64, rotation_turns: f64, replay_seed: u32, rate: f64, ) -> Result<(), &'static str>
beginDeterministicReplayFrom, off the wasm binding.
The C ABI and the tests come in here: a JsValue cannot be built on
a host target, so an invalid argument on the binding’s path is an
abort on the phone rather than a refused call.
Source§impl ScratchAcousticDsp
impl ScratchAcousticDsp
Sourcepub fn arm_revolution_capture(
&mut self,
start_position: f64,
max_frames: u32,
replay_seed: u32,
) -> Result<(), JsValue>
pub fn arm_revolution_capture( &mut self, start_position: f64, max_frames: u32, replay_seed: u32, ) -> Result<(), JsValue>
Arms a one-revolution capture from the ring starting at
start_position (source frames; negative means from wherever the
platter is), holding at most max_frames, reseeding the take with
replay_seed on the frame it begins. See RevolutionCapture.
pub fn cancel_revolution_capture(&mut self)
pub fn revolution_capture_armed(&self) -> bool
pub fn revolution_capture_began(&self) -> bool
pub fn revolution_capture_done(&self) -> bool
pub fn revolution_capture_overflowed(&self) -> bool
Sourcepub fn revolution_capture_start_frame(&self) -> f64
pub fn revolution_capture_start_frame(&self) -> f64
This engine’s rendered-frame counter at the frame the capture began.
Sourcepub fn revolution_capture_end_frame(&self) -> f64
pub fn revolution_capture_end_frame(&self) -> f64
This engine’s rendered-frame counter at the frame the capture closed on (exclusive); zero until it has.
pub fn revolution_capture_start_position(&self) -> f64
pub fn revolution_capture_start_rotation_turns(&self) -> f64
pub fn revolution_capture_channels(&self) -> u32
pub fn revolution_capture_frames(&self) -> u32
Sourcepub fn take_revolution_capture(&mut self) -> Vec<f32>
pub fn take_revolution_capture(&mut self) -> Vec<f32>
The captured revolution, interleaved, and the capture is over.
Sourcepub fn rendered_frames(&self) -> f64
pub fn rendered_frames(&self) -> f64
Output frames rendered so far, the clock revolutionCaptureStartFrame
is on.
pub fn set_high_frequency_acceleration_limit( &mut self, strength: f64, ) -> Result<(), JsValue>
pub fn high_frequency_acceleration_limit(&self) -> f64
pub fn set_stylus_tracing_limit(&mut self, strength: f64) -> Result<(), JsValue>
pub fn stylus_tracing_limit(&self) -> f64
pub fn set_texture_scale(&mut self, scale: f64) -> Result<(), JsValue>
pub fn texture_scale(&self) -> f64
Sourcepub fn set_contact_gain(&mut self, gain: f64) -> Result<(), JsValue>
pub fn set_contact_gain(&mut self, gain: f64) -> Result<(), JsValue>
Per-component levels on the surface bed and source texture, each 0
to 4, 1 the historical level. A default changes no sample.
pub fn contact_gain(&self) -> f64
pub fn set_dust_gain(&mut self, gain: f64) -> Result<(), JsValue>
pub fn dust_gain(&self) -> f64
pub fn set_impulse_gain(&mut self, gain: f64) -> Result<(), JsValue>
pub fn impulse_gain(&self) -> f64
pub fn set_wear_gain(&mut self, gain: f64) -> Result<(), JsValue>
pub fn wear_gain(&self) -> f64
pub fn set_source_texture_gain(&mut self, gain: f64) -> Result<(), JsValue>
pub fn source_texture_gain(&self) -> f64
Sourcepub fn set_riaa_speed_tilt(&mut self, enabled: bool)
pub fn set_riaa_speed_tilt(&mut self, enabled: bool)
The speed-dependent half of the phono chain, live. At nominal speed the tilt is exactly unity, so toggling it only changes off-speed content — which makes it a clean A/B for how much of scratch’s edge is the pre-emphasis mismatch rather than the groove itself.
pub fn riaa_speed_tilt(&self) -> bool
Sourcepub fn set_riaa_voicing(&mut self, rate: f64) -> Result<(), JsValue>
pub fn set_riaa_voicing(&mut self, rate: f64) -> Result<(), JsValue>
Optional constant-rate RIAA mismatch for vinyl warmth, live. 1.0 is
the standard curve and is bit-exact transparent; values above it trade
top end for body. The rate is clamped to the same [0.1, 4.0] window
as the speed tilt.
pub fn riaa_voicing(&self) -> f64
Sourcepub fn set_vinyl_voicing(&mut self, amount: f64) -> Result<(), JsValue>
pub fn set_vinyl_voicing(&mut self, amount: f64) -> Result<(), JsValue>
Optional vinyl voicing amount in [0, 1], live. 0 is bypassed
bit-exactly and the blend eases, so toggling it does not click.
pub fn vinyl_voicing(&self) -> f64
Sourcepub fn set_vinyl_voicing_curve(&mut self, curve: u32) -> Result<(), JsValue>
pub fn set_vinyl_voicing_curve(&mut self, curve: u32) -> Result<(), JsValue>
Selects one of the voicing shapes live: 0 coil load, 1 tip mass,
2 curve drift. The running filter keeps its delay, so switching does
not click.
pub fn vinyl_voicing_curve(&self) -> u32
pub fn set_soft_clip(&mut self, enabled: bool)
pub fn soft_clip(&self) -> bool
pub fn set_scratch_preset(&mut self, name: &str) -> Result<(), JsValue>
pub fn set_scratch_clicks(&mut self, clicks: u8)
pub fn set_scratch_gate_algorithm_version(&mut self, version: u32)
pub fn scratch_preset(&self) -> String
pub fn scratch_clicks(&self) -> u8
pub fn scratch_gate_algorithm_version(&self) -> u32
pub fn scratch_gate(&self) -> f64
pub fn scratch_gate_target(&self) -> f64
pub fn scratch_direction(&self) -> i32
pub fn scratch_moving(&self) -> bool
pub fn scratch_gate_phase(&self) -> f64
pub fn scratch_stroke_progress(&self) -> f64
pub fn set_needle_lifted(&mut self, lifted: bool)
Sourcepub fn set_hand_servo(
&mut self,
stabilization_seconds: f64,
max_correction_rad_s: f64,
)
pub fn set_hand_servo( &mut self, stabilization_seconds: f64, max_correction_rad_s: f64, )
How firmly the hand owns the record’s position: the seconds the servo takes to close a position error, and the most it may correct by in rad/s. Non-finite or non-positive values leave that half alone.
pub fn set_native_rpm(&mut self, native_rpm: f64) -> Result<(), JsValue>
Sourcepub fn set_slipmat_response(&mut self, slip: f64) -> Result<(), JsValue>
pub fn set_slipmat_response(&mut self, slip: f64) -> Result<(), JsValue>
Sets how much the record slips: none at zero, loosest mat at one.
The mat is named for what it does, so the number runs with the name. Zero is the tightest coupling the deck has — the record turns with the platter — and one is the loosest mat, which lets the record slide on after the hand leaves it.
Sourcepub fn set_bearing_friction(&mut self, scale: f64) -> Result<(), JsValue>
pub fn set_bearing_friction(&mut self, scale: f64) -> Result<(), JsValue>
Scales the platter bearing’s friction: frictionless at zero, the stock deck at one, heavier beyond.
This is the only brake on a platter thrown by hand with the motor off, so it is the knob that decides how long a free spin coasts — from forever at zero to a fast die-off at the top of the range.
Sourcepub fn set_free_spin_drive(&mut self, per_second: f64) -> Result<(), JsValue>
pub fn set_free_spin_drive(&mut self, per_second: f64) -> Result<(), JsValue>
Sets the motor-off thrust: e-folds of rate per second while the platter coasts. Zero is a plain bearing; 0.02 is a solar sail’s patience; anything near two doubles the spin faster than a hand could. Clamped there because beyond it the platter is a turbine.
Sourcepub fn set_press_defects(
&mut self,
eccentricity_mm: f64,
warp_mm: f64,
) -> Result<(), JsValue>
pub fn set_press_defects( &mut self, eccentricity_mm: f64, warp_mm: f64, ) -> Result<(), JsValue>
Press defects: the spindle hole’s eccentricity and the disc’s warp, both in millimetres, both once-per-revolution and angle-indexed.
Sourcepub fn set_stylus_tap(
&mut self,
degrees: f64,
level: f64,
) -> Result<(), JsValue>
pub fn set_stylus_tap( &mut self, degrees: f64, level: f64, ) -> Result<(), JsValue>
A second stylus riding the same groove degrees behind the first,
mixed at level. Zero level lifts it off.
Sourcepub fn set_angle_gate(
&mut self,
sectors: u32,
depth: f64,
) -> Result<(), JsValue>
pub fn set_angle_gate( &mut self, sectors: u32, depth: f64, ) -> Result<(), JsValue>
The angle gate: sectors openings per revolution, cut to depth.
Zero sectors is off. Geometry, not tempo-sync: it stays locked under
scratching and free-spin decay because it is read off the platter.
Sourcepub fn set_vinyl_vfx(&mut self, scene: u32, amount: f64) -> Result<(), JsValue>
pub fn set_vinyl_vfx(&mut self, scene: u32, amount: f64) -> Result<(), JsValue>
The live vinyl Vfx scene: the shared geometry-driven processor the offline REMIX render and the iOS deck already play. Scene zero is off; amount rides 0..=1.
Sourcepub fn set_locked_groove(&mut self, start_frame: f64) -> Result<(), JsValue>
pub fn set_locked_groove(&mut self, start_frame: f64) -> Result<(), JsValue>
Drops the needle into a locked groove starting at start_frame:
playback wraps every revolution inside that ring until the host
passes a negative frame to clear it. Seeks and hand motion are phase
changes inside the ring; they cannot escape it.
Sourcepub fn set_groove_wear(&mut self, rate: f64) -> Result<(), JsValue>
pub fn set_groove_wear(&mut self, rate: f64) -> Result<(), JsValue>
Groove wear: every pass of the stylus wears where it passed, adding
crackle and dulling the highs in the bars that have been played
most. rate scales both how fast wear accrues and how loudly it
reads; zero is a mint pressing. At one, a region is fully worn after
roughly fifty passes.
Sourcepub fn groove_wear_map(&self) -> Vec<f32>
pub fn groove_wear_map(&self) -> Vec<f32>
The wear map, for persistence: a record’s biography rides with it.
Sourcepub fn restore_groove_wear_map(&mut self, map: &[f32])
pub fn restore_groove_wear_map(&mut self, map: &[f32])
Restores a persisted wear map. Length is reconciled to the loaded source; a map from another pressing simply wears the wrong places, which is the caller’s mistake to avoid via the record hash.
Sourcepub fn halo_wear_map(&self) -> Vec<f32>
pub fn halo_wear_map(&self) -> Vec<f32>
The halo, for a take’s world.
pub fn restore_halo_wear_map(&mut self, map: &[f32])
Sourcepub fn seed_take_capture(&mut self, replay_seed: u32)
pub fn seed_take_capture(&mut self, replay_seed: u32)
The seed a take is cut under.
A replay begins from replay_seed — its surface noise and its flutter
phase are derived from the take’s identity — so the recording has to
have begun from the same place or the two can never agree. Called at
punch-in with the take’s seed: the noise generator and the flutter
phase are re-seeded, and nothing else moves, because the platter is
live and a hand may be on it. Noise is noise, so the join is silent.
Sourcepub fn reset_wear(&mut self, scope: &str) -> Result<(), JsValue>
pub fn reset_wear(&mut self, scope: &str) -> Result<(), JsValue>
Clears accumulated wear, by scope.
Wear is the one thing here meant to outlive a pass, so it only goes away when something says so — one of these scopes, or a new record on the platter. The scopes are the three things that actually accumulate, and nothing else in the engine does:
groove— the WEAR dial’s map, one bucket perWEAR_BUCKET_FRAMESof source, so it wears where the stylus went.halo— WORN HALO’s bins, indexed by phase within one revolution, so it wears where on the turn the stylus went. A different quantity fromgroove, and cleared separately.polar— the revolution memory ADJACENT GHOST, THREE NEEDLES and SPLIT WALLS read back from, and the filters riding on it.all— the three above.
Sourcepub fn groove_wear_level(&self) -> f64
pub fn groove_wear_level(&self) -> f64
The meters’ numbers, one scalar at a time.
wearSummary allocates a string, which the render thread must not do
at telemetry rate, so the worklet reads these instead and the summary
is kept for one-shot queries. Each walks its buffer and allocates
nothing.
pub fn groove_wear_peak(&self) -> f64
pub fn groove_wear_buckets(&self) -> u32
pub fn halo_wear_level(&self) -> f64
pub fn halo_wear_peak(&self) -> f64
pub fn polar_fill(&self) -> f64
Sourcepub fn wear_bytes(&self) -> u32
pub fn wear_bytes(&self) -> u32
Every accumulator’s real allocation, in bytes.
Sourcepub fn wear_summary(&self) -> String
pub fn wear_summary(&self) -> String
What each accumulator is holding — the numbers behind the meters.
Levels are 0..=1 and bytes are the real allocation, so a deck can report what the revolution memory actually costs rather than quoting a constant that drifts when the bin counts change.
Sourcepub fn set_pressing_seed(&mut self, seed: u32)
pub fn set_pressing_seed(&mut self, seed: u32)
Seeds this pressing’s surface character. Two pressings of the same track crackle like two copies, not two files; zero keeps the classic pattern.
pub fn native_rpm(&self) -> f64
pub fn platter_rotation_turns(&self) -> f64
Sourcepub fn deck_recovery_count(&self) -> u64
pub fn deck_recovery_count(&self) -> u64
Counts rejected deck steps that used the last valid motion state.
pub fn set_motion(&mut self, position: f64, rate: f64, impulse: f64)
pub fn set_transport( &mut self, hand_contact: bool, motor_rate: f64, hand_rate: f64, grip: f64, )
pub fn set_position(&mut self, position: f64, impulse: f64)
pub fn reset_position_export(&mut self, position: f64)
pub fn render(&mut self, frame_count: u32, output_channel_count: u32) -> u32
pub fn render_window_missing( &mut self, frame_count: u32, output_channel_count: u32, )
Sourcepub fn render_surface(&mut self, frame_count: u32, output_channel_count: u32)
pub fn render_surface(&mut self, frame_count: u32, output_channel_count: u32)
Render only cartridge/surface foley while keeping the programme readhead fixed. Lead-in and run-out are physical platter regions, not permission to sample the first or last seconds of programme audio underneath them.
pub fn output_ptr(&self) -> *const f32
pub fn output_len(&self) -> usize
pub fn position(&self) -> f64
pub fn effective_rate(&self) -> f64
pub fn take_window_request(&mut self) -> f64
pub fn take_ended(&mut self) -> bool
Sourcepub fn set_surface_asset(
&mut self,
channels: Array,
sample_rate: f64,
) -> Result<(), JsValue>
pub fn set_surface_asset( &mut self, channels: Array, sample_rate: f64, ) -> Result<(), JsValue>
Decoded needle-surface asset PCM (original assets/audio/needle-surface.opus),
provided by the host off the real-time thread.
Sourcepub fn set_surface_gain_multiplier(&mut self, multiplier: f64)
pub fn set_surface_gain_multiplier(&mut self, multiplier: f64)
Mobile speaker compensation (original resolveNeedleSurfaceGain: ×2.25 on mobile).
Sourcepub fn start_surface_region(&mut self, region: u8, duration_seconds: f64)
pub fn start_surface_region(&mut self, region: u8, duration_seconds: f64)
Start the lead-in (region 0) or deadwax (region 1) surface bed.
pub fn stop_surface_region(&mut self)
Sourcepub fn trigger_needle_drop(&mut self)
pub fn trigger_needle_drop(&mut self)
One-shot needle-drop foley: stylus thump plus a settling crackle burst.
Sourcepub fn trigger_needle_lift(&mut self)
pub fn trigger_needle_lift(&mut self)
Starts a lighter stylus-release thump and a short crackle burst.
Source§impl ScratchAcousticDsp
impl ScratchAcousticDsp
Sourcepub fn new_native(
output_sample_rate: f64,
config: AcousticConfig,
) -> Result<Self, String>
pub fn new_native( output_sample_rate: f64, config: AcousticConfig, ) -> Result<Self, String>
Creates the shared player for a native host.
pub fn deck_recovery_diagnostic(&self) -> Option<DeckRecoveryDiagnostic>
Sourcepub fn set_surface_asset_native(
&mut self,
channels: &[&[f32]],
sample_rate: f64,
) -> Result<(), String>
pub fn set_surface_asset_native( &mut self, channels: &[&[f32]], sample_rate: f64, ) -> Result<(), String>
Installs host-decoded surface PCM without routing native audio through
JavaScript typed arrays. Native mono renderers use the first channel,
while stereo renderers preserve both channels exactly as the WASM host
does through setSurfaceAsset.
Sourcepub fn set_surface_asset_owned_native(
&mut self,
channels: Vec<Vec<f32>>,
sample_rate: f64,
) -> Result<(), String>
pub fn set_surface_asset_owned_native( &mut self, channels: Vec<Vec<f32>>, sample_rate: f64, ) -> Result<(), String>
Installs already-owned native surface PCM with an O(1) audio-state swap. Hosts can allocate and copy the large asset before taking their render-state lock.
Sourcepub fn set_surface_asset_owned_native_deferred(
&mut self,
channels: Vec<Vec<f32>>,
sample_rate: f64,
) -> Result<Arc<Vec<Vec<f32>>>, String>
pub fn set_surface_asset_owned_native_deferred( &mut self, channels: Vec<Vec<f32>>, sample_rate: f64, ) -> Result<Arc<Vec<Vec<f32>>>, String>
Installs owned surface PCM and returns the previous allocation so a native host can retire it after releasing its realtime-state mutex.
Sourcepub fn replace_window_native(
&mut self,
channels: &[&[f32]],
source_sample_rate: f64,
reset_position: Option<f64>,
) -> Result<(), String>
pub fn replace_window_native( &mut self, channels: &[&[f32]], source_sample_rate: f64, reset_position: Option<f64>, ) -> Result<(), String>
Replaces the complete source window with host-owned PCM.
Sourcepub fn replace_window_owned_native(
&mut self,
channels: Vec<Vec<f32>>,
source_sample_rate: f64,
reset_position: Option<f64>,
) -> Result<(), String>
pub fn replace_window_owned_native( &mut self, channels: Vec<Vec<f32>>, source_sample_rate: f64, reset_position: Option<f64>, ) -> Result<(), String>
Replaces native source PCM with an O(1) ownership swap. The host must build the channel vectors before entering its real-time state lock.
Sourcepub fn replace_window_owned_native_deferred(
&mut self,
channels: Vec<Vec<f32>>,
source_sample_rate: f64,
reset_position: Option<f64>,
) -> Result<Arc<Vec<Vec<f32>>>, String>
pub fn replace_window_owned_native_deferred( &mut self, channels: Vec<Vec<f32>>, source_sample_rate: f64, reset_position: Option<f64>, ) -> Result<Arc<Vec<Vec<f32>>>, String>
Publishes a complete native source window and returns the previous Arc so its potentially large backing allocation can be dropped after the host releases the realtime-state mutex.
Sourcepub fn extend_window_native(
&mut self,
channels: &[&[f32]],
source_sample_rate: f64,
) -> Result<(), String>
pub fn extend_window_native( &mut self, channels: &[&[f32]], source_sample_rate: f64, ) -> Result<(), String>
Extends the current native source without resetting transport state.
Sourcepub fn extend_window_owned_native(
&mut self,
channels: Vec<Vec<f32>>,
source_sample_rate: f64,
) -> Result<(), String>
pub fn extend_window_owned_native( &mut self, channels: Vec<Vec<f32>>, source_sample_rate: f64, ) -> Result<(), String>
Extends the current native source from already-owned PCM. Native hosts can copy each decode chunk before entering their render-state lock. If the initial window reserved the final programme capacity, publication is a bounded O(chunk) copy with no allocation or prefix rebuild.
Sourcepub fn replace_window_range_native(
&mut self,
channels: &[&[f32]],
start_frame: usize,
source_sample_rate: f64,
) -> Result<(), String>
pub fn replace_window_range_native( &mut self, channels: &[&[f32]], start_frame: usize, source_sample_rate: f64, ) -> Result<(), String>
Replaces a range in the current native source without resetting transport.
The range can extend the source. Missing frames between the old source end and the new range are silent.
Sourcepub fn native_window_snapshot(&self) -> (Arc<Vec<Vec<f32>>>, f64)
pub fn native_window_snapshot(&self) -> (Arc<Vec<Vec<f32>>>, f64)
Returns an immutable, constant-time snapshot of the native PCM window.
Native hosts use it to build append/range replacements away from their
realtime render mutex, then publish the result with
replace_window_owned_native as one ownership swap.
Sourcepub fn rendered_samples(&self) -> &[f32]
pub fn rendered_samples(&self) -> &[f32]
Returns the interleaved output from the most recent render call.
Source§impl ScratchAcousticDsp
impl ScratchAcousticDsp
Sourcepub fn reset_wear_scope(&mut self, scope: WearScope)
pub fn reset_wear_scope(&mut self, scope: WearScope)
Clears one accumulator, off the wasm binding.
resetWear is the browser’s door onto this; the C ABI and the tests
come in here instead, because a JsValue cannot be built off wasm32.
Trait Implementations§
Source§impl From<ScratchAcousticDsp> for JsValue
impl From<ScratchAcousticDsp> for JsValue
Source§fn from(value: ScratchAcousticDsp) -> Self
fn from(value: ScratchAcousticDsp) -> Self
Source§impl FromWasmAbi for ScratchAcousticDsp
impl FromWasmAbi for ScratchAcousticDsp
Source§impl IntoWasmAbi for ScratchAcousticDsp
impl IntoWasmAbi for ScratchAcousticDsp
Source§impl LongRefFromWasmAbi for ScratchAcousticDsp
impl LongRefFromWasmAbi for ScratchAcousticDsp
Source§type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>
type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>
RefFromWasmAbi::AbiSource§type Anchor = RcRef<ScratchAcousticDsp>
type Anchor = RcRef<ScratchAcousticDsp>
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiSource§impl RefFromWasmAbi for ScratchAcousticDsp
impl RefFromWasmAbi for ScratchAcousticDsp
Source§type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>
type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>
Self are recovered from.Source§type Anchor = RcRef<ScratchAcousticDsp>
type Anchor = RcRef<ScratchAcousticDsp>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for ScratchAcousticDsp
impl RefMutFromWasmAbi for ScratchAcousticDsp
Source§type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>
type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<ScratchAcousticDsp>
type Anchor = RcRefMut<ScratchAcousticDsp>
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for ScratchAcousticDsp
impl SupportsInstanceProperty for ScratchAcousticDsp
impl SupportsStaticProperty for ScratchAcousticDsp
Source§impl TryFromJsValue for ScratchAcousticDsp
impl TryFromJsValue for ScratchAcousticDsp
Source§impl VectorFromWasmAbi for ScratchAcousticDsp
impl VectorFromWasmAbi for ScratchAcousticDsp
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[ScratchAcousticDsp]>
Source§impl VectorIntoWasmAbi for ScratchAcousticDsp
impl VectorIntoWasmAbi for ScratchAcousticDsp
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[ScratchAcousticDsp]>) -> Self::Abi
Source§impl WasmDescribeVector for ScratchAcousticDsp
impl WasmDescribeVector for ScratchAcousticDsp
Auto Trait Implementations§
impl Freeze for ScratchAcousticDsp
impl RefUnwindSafe for ScratchAcousticDsp
impl Send for ScratchAcousticDsp
impl Sync for ScratchAcousticDsp
impl Unpin for ScratchAcousticDsp
impl UnsafeUnpin for ScratchAcousticDsp
impl UnwindSafe for ScratchAcousticDsp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.