Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
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