Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellNone

Synth.Faust.PatchC

Description

Low level binding to patch_c.cc and the Patch c++ object, which represents any faust dsp, both instruments and effects processors.

Synopsis

Documentation

type InstrumentP = Ptr CPatchP Source #

An allocated patch.

Instrument

render Source #

Arguments

:: Frames 
-> Frames 
-> InstrumentP 
-> [(Ptr Float, Audio.Block)] 
-> [V.Vector Float]

Input signals. The length must be equal to the the patchInputs, and each vector must have the same length.

-> IO [V.Vector Float]

one block of samples for each output channel

Render chunk of time and return samples.

withControls :: [(Ptr Float, Audio.Block)] -> (CInt -> Ptr (Ptr Float) -> Ptr (Ptr Float) -> IO a) -> IO a Source #

state

unsafeGetState :: InstrumentP -> IO ByteString.ByteString Source #

getState, but without copying, if you promise to finish with the State before you call render, which will change it.

util

withVectors :: [V.Vector Float] -> (Ptr (Ptr Float) -> IO a) -> IO a Source #

Allocate a list of vectors as **float. Pass nullptr for [], to avoid allocation.

withPtrs :: [V.Vector Float] -> ([Ptr Float] -> IO a) -> IO a Source #

Convert a list of vectors to a list of pointers, with no copying.