Safe Haskell | Safe-Inferred |
---|
Render Sample.Note
s down to audio.
Synopsis
- data Config = Config {
- _quality :: !Quality
- _chunkSize :: !Frames
- _blockSize :: !Frames
- _controlsPerBlock :: !Frames
- _emitProgress :: !Bool
- type Error = Text
- defaultConfig :: Quality -> Config
- data InstrumentEffect = InstrumentEffect {}
- write :: Config -> FilePath -> Set Id.TrackId -> Maybe.Maybe InstrumentEffect -> [Sample.Note] -> IO (Either Error (Config.ChunkNum, Config.ChunkNum))
- toSpan :: Sample.Note -> Checkpoint.Span
- data Playing = Playing {
- _noteHash :: !Note.Hash
- _getState :: IO PlayState
- _audio :: !AUtil.Audio
- _noteRange :: !(Frames, Frames)
- renderAll :: Config -> FilePath -> State -> IORef.IORef State -> Set Id.TrackId -> Maybe.Maybe InstrumentEffect -> Frames -> [Sample.Note] -> AUtil.Audio
- renderNotes :: Config -> FilePath -> [PlayState] -> ([PlayState] -> IO ()) -> Set Id.TrackId -> Frames -> [Sample.Note] -> [Sample.Note] -> [Sample.Note] -> AUtil.Audio
- pull :: Frames -> Frames -> [Playing] -> Resource.ResourceT IO ([Audio.Block], [Playing])
- resumeSamples :: Config -> Frames -> [PlayState] -> [Sample.Note] -> IO [Playing]
- eNote :: Sample.Note -> (Text, Text, Signal.Signal, FilePath)
- startSample :: Config -> Frames -> Maybe.Maybe PlayState -> Sample.Note -> IO Playing
- overlappingNotes :: Frames -> Frames -> [Sample.Note] -> ([Sample.Note], [Sample.Note], [Sample.Note])
- data State = State {}
- emptyState :: State
- serializeState :: State -> Checkpoint.State
- unserializeState :: Checkpoint.State -> Either Error State
- getPlayStates :: [Playing] -> IO [PlayState]
- data PlayState
- data ResampleState = ResampleState {}
- applyEffect :: Config -> Frames -> Maybe.Maybe EffectC.State -> (EffectC.State -> IO ()) -> [Sample.Note] -> InstrumentEffect -> AUtil.Audio -> AUtil.Audio
- renderControls :: Monad m => Effect.Config -> [Control.Control] -> RealTime -> [Sample.Note] -> Map Control.Control (Audio.Audio m rate 1)
- extractControls :: Frames -> [Control.Control] -> [Sample.Note] -> Map Control.Control [(Double, Double)]
- prettyF :: Frames -> Text
Documentation
Config | |
|
defaultConfig :: Quality -> Config Source #
data InstrumentEffect Source #
An instrument level faust processor.
:: Config | |
-> FilePath | |
-> Set Id.TrackId | |
-> Maybe.Maybe InstrumentEffect | |
-> [Sample.Note] | |
-> IO (Either Error (Config.ChunkNum, Config.ChunkNum)) | (writtenChunks, totalChunks) |
toSpan :: Sample.Note -> Checkpoint.Span Source #
A currently playing sample.
renderAll :: Config -> FilePath -> State -> IORef.IORef State -> Set Id.TrackId -> Maybe.Maybe InstrumentEffect -> Frames -> [Sample.Note] -> AUtil.Audio Source #
renderNotes :: Config -> FilePath -> [PlayState] -> ([PlayState] -> IO ()) -> Set Id.TrackId -> Frames -> [Sample.Note] -> [Sample.Note] -> [Sample.Note] -> AUtil.Audio Source #
pull :: Frames -> Frames -> [Playing] -> Resource.ResourceT IO ([Audio.Block], [Playing]) Source #
Get chunkSize from each Playing, and remove Playings which no longer are.
resumeSamples :: Config -> Frames -> [PlayState] -> [Sample.Note] -> IO [Playing] Source #
eNote :: Sample.Note -> (Text, Text, Signal.Signal, FilePath) Source #
Extract from Note for pretty-printing.
:: 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
State | |
|
Instances
emptyState :: State Source #
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 |
Resample !ResampleState | |
Complete | There was a resample, but it's complete. If this shows up, something
is wrong, because |
data ResampleState Source #
The saved state of a note that had to resample.
ResampleState | |
|
Instances
Show ResampleState Source # | |
Defined in Synth.Sampler.Render showsPrec :: Int -> ResampleState -> ShowS # show :: ResampleState -> String # showList :: [ResampleState] -> ShowS # | |
Eq ResampleState Source # | |
Defined in Synth.Sampler.Render (==) :: ResampleState -> ResampleState -> Bool # (/=) :: ResampleState -> ResampleState -> Bool # | |
Pretty.Pretty ResampleState Source # | |
Defined in Synth.Sampler.Render pretty :: ResampleState -> Text Source # format :: ResampleState -> Doc Source # formatList :: [ResampleState] -> Doc Source # | |
Serialize.Serialize ResampleState Source # | |
Defined in Synth.Sampler.Render |
effect
applyEffect :: Config -> Frames -> Maybe.Maybe EffectC.State -> (EffectC.State -> IO ()) -> [Sample.Note] -> InstrumentEffect -> AUtil.Audio -> AUtil.Audio Source #
renderControls :: Monad m => Effect.Config -> [Control.Control] -> RealTime -> [Sample.Note] -> Map Control.Control (Audio.Audio m rate 1) Source #
extractControls :: Frames -> [Control.Control] -> [Sample.Note] -> Map Control.Control [(Double, Double)] Source #