Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

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 # 
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 # 
Instance details

Defined in Synth.Sampler.Render

Serialize.Serialize State # 
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.

Instances

Instances details
Eq PlayState # 
Instance details

Defined in Synth.Sampler.Render

Show PlayState # 
Instance details

Defined in Synth.Sampler.Render

Pretty.Pretty PlayState # 
Instance details

Defined in Synth.Sampler.Render

Serialize.Serialize PlayState # 
Instance details

Defined in Synth.Sampler.Render

data ResampleState Source #

The saved state of a note that had to resample.

Constructors

ResampleState 

Fields

unserializeStates :: Checkpoint.State -> Either Error [PlayState] Source #

These will be sorted in order of Note hash.

effect

util