Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Synth.Sampler.Render

Description

Render Sample.Notes down to audio.

Synopsis

Documentation

data Config Source #

Constructors

Config 

Fields

data InstrumentEffect Source #

An instrument level faust processor.

write Source #

Arguments

:: Config 
-> FilePath 
-> Set Id.TrackId 
-> Maybe.Maybe InstrumentEffect 
-> [Sample.Note] 
-> IO (Either Error (Config.ChunkNum, Config.ChunkNum))

(writtenChunks, totalChunks)

data Playing Source #

A currently playing sample.

Constructors

Playing 

Fields

Instances

Instances details
Pretty.Pretty Playing Source # 
Instance details

Defined in Synth.Sampler.Render

pull :: Frames -> Frames -> [Playing] -> Resource.ResourceT IO ([Audio.Block], [Playing]) Source #

Get chunkSize from each Playing, and remove Playings which no longer are.

eNote :: Sample.Note -> (Text, Text, Signal.Signal, FilePath) Source #

Extract from Note for pretty-printing.

startSample Source #

Arguments

:: Config 
-> Frames 
-> Maybe.Maybe PlayState

If Just Just, resume a playing sample which should have started <=now, otherwise start a new one which should start >= now. If Just NoResample, this is a resuming sample, but it wasn't resampled, so there's no resampler state.

-> Sample.Note 
-> IO Playing 

Convert Sample.Note to a Playing.

overlappingNotes :: Frames -> Frames -> [Sample.Note] -> ([Sample.Note], [Sample.Note], [Sample.Note]) Source #

This is similar to Checkpoint.splitOverlapping, but it differentiates notes that overlap the starting time.

State

data State Source #

Constructors

State 

Fields

Instances

Instances details
Pretty.Pretty State Source # 
Instance details

Defined in Synth.Sampler.Render

Serialize.Serialize State Source # 
Instance details

Defined in Synth.Sampler.Render

data PlayState Source #

Constructors

NoResample

If there is no resampling, the state will be NoResample. It's necessary to save that explicitly, so I can still line up notes with states in resumeSamples.

Resample !ResampleState 
Complete

There was a resample, but it's complete. If this shows up, something is wrong, because pull should have filtered out the Playing when it turned up short samples.

data ResampleState Source #

The saved state of a note that had to resample.

Constructors

ResampleState 

Fields

effect

util