logo
pub fn write_float_array_to<T: AsRef<str>>(
    destination_name: T,
    destination_write_offset: i32,
    source: &[f32],
    source_read_amount: i32
) -> Result<(), ArrayError>
Expand description

Writes a slice of f32 to a pd named array.

Reads values as much as read_amount from the array which is given as the source argument and writes them to a named array in pd which is specified with destination_name argument starting at destination_write_offset.

Example

use libpd_rs::array::write_float_array_to;

let mut source = [1.0_f32; 64];
write_float_array_to("my_array", 32, &source, 32).unwrap();

Errors

This function performs no bounds checking on the destination.

If destination_offset + read_amount is greater than the size of the destination or the array which we’re trying to read from is not existent it will return an error.

A list of errors that can occur: