synthesizer-midi 0.6.1.2 → 0.7
raw patch · 6 files changed
+59/−41 lines, 6 filesdep ~deepseqdep ~semigroupsdep ~synthesizer-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: deepseq, semigroups, synthesizer-core, synthesizer-dimensional
API changes (from Hackage documentation)
- Synthesizer.MIDI.CausalIO.Process: instance Synthesizer.Generic.Cut.Read Synthesizer.MIDI.CausalIO.Process.NoteOffList
- Synthesizer.MIDI.PiecewiseConstant.ControllerSet: instance Synthesizer.Generic.Cut.Read (Synthesizer.MIDI.PiecewiseConstant.ControllerSet.T key a)
- Synthesizer.MIDI.Value.BendModulation: [bend, depth] :: T a -> a
- Synthesizer.MIDI.Value.BendWheelPressure: [bend_, wheel_, pressure_] :: T -> Int
+ Synthesizer.MIDI.CausalIO.Process: instance Synthesizer.Generic.Cut.Consume Synthesizer.MIDI.CausalIO.Process.NoteOffList
+ Synthesizer.MIDI.Dimensional: bendWheelPressureCore :: (C event, Transform sig q, C q, C q, C q q, C u) => (Signal s Scalar q (T q) -> Signal s Scalar q (sig q)) -> Channel -> Int -> T (Recip u) q -> q -> q -> Filter event s u q (Signal s Scalar q (sig q))
+ Synthesizer.MIDI.Dimensional: bendWheelPressureStorable :: (C event, Storable q, C q, C q, C q q, C u) => Channel -> Int -> T (Recip u) q -> q -> q -> Filter event s u q (Signal s Scalar q (T q))
+ Synthesizer.MIDI.PiecewiseConstant.ControllerSet: instance Synthesizer.Generic.Cut.Consume (Synthesizer.MIDI.PiecewiseConstant.ControllerSet.T key a)
+ Synthesizer.MIDI.Value.BendModulation: [bend] :: T a -> a
+ Synthesizer.MIDI.Value.BendModulation: [depth] :: T a -> a
+ Synthesizer.MIDI.Value.BendWheelPressure: [bend_] :: T -> Int
+ Synthesizer.MIDI.Value.BendWheelPressure: [pressure_] :: T -> Int
+ Synthesizer.MIDI.Value.BendWheelPressure: [wheel_] :: T -> Int
- Synthesizer.MIDI.CausalIO.ControllerSet: type T arrow y = arrow (T Controller Int) (T ShortStrictTime y)
+ Synthesizer.MIDI.CausalIO.ControllerSet: type T (arrow :: Type -> Type -> Type) y = arrow T Controller Int T ShortStrictTime y
- Synthesizer.MIDI.CausalIO.Process: applyModulatedInstrument :: (Arrow arrow, Read ctrl) => (Program -> Velocity -> Pitch -> T (T GateChunk ctrl) chunk) -> arrow (T (Events (NoteBoundary (NoteId, Maybe Program))) ctrl) (T (T NoteOffList ctrl) (Events (T (T NoteOffList ctrl) chunk)))
+ Synthesizer.MIDI.CausalIO.Process: applyModulatedInstrument :: (Arrow arrow, Consume ctrl) => (Program -> Velocity -> Pitch -> T (T GateChunk ctrl) chunk) -> arrow (T (Events (NoteBoundary (NoteId, Maybe Program))) ctrl) (T (T NoteOffList ctrl) (Events (T (T NoteOffList ctrl) chunk)))
- Synthesizer.MIDI.CausalIO.Process: applyModulation :: (Transform ctrl, NormalForm ctrl, Read chunk, Monoid time, C time) => T (T ctrl (T time (T ctrl chunk))) (T time chunk)
+ Synthesizer.MIDI.CausalIO.Process: applyModulation :: (Transform ctrl, NormalForm ctrl, Consume chunk, Monoid time, C time) => T (T ctrl (T time (T ctrl chunk))) (T time chunk)
- Synthesizer.MIDI.CausalIO.Process: sequenceCore :: (C event, Monoid chunk, Read chunk, C y) => Channel -> Bank y chunk -> T (Events event) (T StrictTime chunk)
+ Synthesizer.MIDI.CausalIO.Process: sequenceCore :: (C event, Monoid chunk, Consume chunk, C y) => Channel -> Bank y chunk -> T (Events event) (T StrictTime chunk)
- Synthesizer.MIDI.CausalIO.Process: sequenceModulated :: (C event, Monoid chunk, Read chunk, Transform ctrl, NormalForm ctrl, C y) => Channel -> ModulatedBank y ctrl chunk -> T (T (Events event) ctrl) (T StrictTime chunk)
+ Synthesizer.MIDI.CausalIO.Process: sequenceModulated :: (C event, Monoid chunk, Consume chunk, Transform ctrl, NormalForm ctrl, C y) => Channel -> ModulatedBank y ctrl chunk -> T (T (Events event) ctrl) (T StrictTime chunk)
- Synthesizer.MIDI.CausalIO.Process: sequenceModulatedMultiProgram :: (C event, Monoid chunk, Read chunk, Transform ctrl, NormalForm ctrl, C y) => Channel -> Program -> ModulatedBank y ctrl chunk -> T (T (Events event) ctrl) (T StrictTime chunk)
+ Synthesizer.MIDI.CausalIO.Process: sequenceModulatedMultiProgram :: (C event, Monoid chunk, Consume chunk, Transform ctrl, NormalForm ctrl, C y) => Channel -> Program -> ModulatedBank y ctrl chunk -> T (T (Events event) ctrl) (T StrictTime chunk)
- Synthesizer.MIDI.CausalIO.Process: sequenceModulatedMultiProgramVelocityPitch :: (C event, Monoid chunk, Read chunk, Transform ctrl, NormalForm ctrl) => Channel -> Program -> (Program -> Velocity -> Pitch -> T (T GateChunk ctrl) chunk) -> T (T (Events event) ctrl) (T StrictTime chunk)
+ Synthesizer.MIDI.CausalIO.Process: sequenceModulatedMultiProgramVelocityPitch :: (C event, Monoid chunk, Consume chunk, Transform ctrl, NormalForm ctrl) => Channel -> Program -> (Program -> Velocity -> Pitch -> T (T GateChunk ctrl) chunk) -> T (T (Events event) ctrl) (T StrictTime chunk)
- Synthesizer.MIDI.Dimensional: bendWheelPressure :: (C event, Write sig q, Transform sig q, C q, C q, C q q, C u) => Channel -> Int -> T (Recip u) q -> q -> q -> Filter event s u q (Signal s Scalar q (sig q))
+ Synthesizer.MIDI.Dimensional: bendWheelPressure :: (C event, Produce sig q, C q, C q, C q q, C u) => Channel -> Int -> T (Recip u) q -> q -> q -> Filter event s u q (Signal s Scalar q (sig q))
- Synthesizer.MIDI.Dimensional: piecewiseConstant :: Write sig y => T rate amp (T y) -> T rate amp (sig y)
+ Synthesizer.MIDI.Dimensional: piecewiseConstant :: Produce sig y => T rate amp (T y) -> T rate amp (sig y)
- Synthesizer.MIDI.Dimensional: type AmpSignal s amp signal = T (Phantom s) amp signal
+ Synthesizer.MIDI.Dimensional: type AmpSignal s amp signal = T Phantom s amp signal
- Synthesizer.MIDI.Dimensional: type Instrument s u v q signal = ModulatedInstrument s u q (Signal s v q signal)
+ Synthesizer.MIDI.Dimensional: type Instrument s u v q signal = ModulatedInstrument s u q Signal s v q signal
- Synthesizer.MIDI.Dimensional: type LazyTime s = T (Phantom s) Abstract T
+ Synthesizer.MIDI.Dimensional: type LazyTime s = T Phantom s Abstract T
- Synthesizer.MIDI.Dimensional: type ModulatedInstrument s u q signal = q -> T (Recip u) q -> T s u q (LazyTime s -> signal)
+ Synthesizer.MIDI.Dimensional: type ModulatedInstrument s u q signal = q -> T Recip u q -> T s u q LazyTime s -> signal
- Synthesizer.MIDI.Dimensional: type Signal s v y signal = AmpSignal s (Dimensional v y) signal
+ Synthesizer.MIDI.Dimensional: type Signal s v y signal = AmpSignal s Dimensional v y signal
- Synthesizer.MIDI.EventList: type Filter event = State (T StrictTime [event])
+ Synthesizer.MIDI.EventList: type Filter event = State T StrictTime [event]
- Synthesizer.MIDI.Generic: piecewiseConstant :: Write sig y => T StrictTime y -> sig y
+ Synthesizer.MIDI.Generic: piecewiseConstant :: Produce sig y => T StrictTime y -> sig y
- Synthesizer.MIDI.Generic: piecewiseConstantInit :: Write sig y => y -> T StrictTime y -> sig y
+ Synthesizer.MIDI.Generic: piecewiseConstantInit :: Produce sig y => y -> T StrictTime y -> sig y
- Synthesizer.MIDI.Generic: piecewiseConstantInitWith :: Write sig c => (y -> c) -> c -> T StrictTime [y] -> sig c
+ Synthesizer.MIDI.Generic: piecewiseConstantInitWith :: Produce sig c => (y -> c) -> c -> T StrictTime [y] -> sig c
- Synthesizer.MIDI.Generic: replicateLong :: Write sig y => StrictTime -> y -> sig y
+ Synthesizer.MIDI.Generic: replicateLong :: Produce sig y => StrictTime -> y -> sig y
- Synthesizer.MIDI.Generic: type FilterSequence event signal = Filter event (T ShortStrictTime signal)
+ Synthesizer.MIDI.Generic: type FilterSequence event signal = Filter event T ShortStrictTime signal
- Synthesizer.MIDI.Storable: type Bank y yv = Bank y (T yv)
+ Synthesizer.MIDI.Storable: type Bank y yv = Bank y T yv
- Synthesizer.MIDI.Storable: type Instrument y yv = Instrument y (T yv)
+ Synthesizer.MIDI.Storable: type Instrument y yv = Instrument y T yv
- Synthesizer.MIDI.Value.BendModulation: Cons :: a -> T a
+ Synthesizer.MIDI.Value.BendModulation: Cons :: a -> a -> T a
- Synthesizer.MIDI.Value.BendWheelPressure: Cons :: Int -> T
+ Synthesizer.MIDI.Value.BendWheelPressure: Cons :: Int -> Int -> Int -> T
Files
- src/Synthesizer/MIDI/CausalIO/Process.hs +9/−9
- src/Synthesizer/MIDI/Dimensional.hs +30/−9
- src/Synthesizer/MIDI/Dimensional/Example/Instrument.hs +4/−3
- src/Synthesizer/MIDI/Generic.hs +5/−9
- src/Synthesizer/MIDI/PiecewiseConstant/ControllerSet.hs +1/−1
- synthesizer-midi.cabal +10/−10
src/Synthesizer/MIDI/CausalIO/Process.hs view
@@ -220,7 +220,7 @@ EventListTT.duration _constant ::- (Arrow arrow, CutG.Read input) =>+ (Arrow arrow, CutG.Consume input) => y -> arrow input (EventListBT.T PC.ShortStrictTime y) _constant y = arr $ EventListBT.singleton y .@@ -281,7 +281,7 @@ } -instance CutG.Read NoteOffList where+instance CutG.Consume NoteOffList where null (NoteOffList evs) = EventListTT.isPause evs && EventListTT.duration evs == 0 length = fromIntegral . EventListTT.duration . unwrapNoteOffList@@ -484,7 +484,7 @@ PIO.T (Zip.T GateChunk ctrl) chunk applyModulatedInstrument ::- (Arrow arrow, CutG.Read ctrl) =>+ (Arrow arrow, CutG.Consume ctrl) => (MIDIEv.Program -> MIDIEv.Velocity -> MIDIEv.Pitch -> PIO.T (Zip.T GateChunk ctrl) chunk) -> arrow@@ -552,7 +552,7 @@ return (output, CausalState next delete state1) applyChunk ::- (CutG.Read a, CutG.Read b) =>+ (CutG.Consume a, CutG.Consume b) => CausalState a b -> a -> IO (b, Maybe (CausalState a b)) applyChunk (CausalState next delete state0) input = do (output, state1) <- next input state0@@ -567,7 +567,7 @@ -- could be moved to synthesizer-core applyModulation :: (CutG.Transform ctrl, CutG.NormalForm ctrl,- CutG.Read chunk,+ CutG.Consume chunk, Monoid time, ToInteger.C time) => PIO.T (Zip.T ctrl (EventListTT.T time (PIO.T ctrl chunk)))@@ -624,7 +624,7 @@ sequenceCore ::- (Check.C event, Monoid chunk, CutG.Read chunk, Trans.C y) =>+ (Check.C event, Monoid chunk, CutG.Consume chunk, Trans.C y) => MIDIEv.Channel -> Bank y chunk -> PIO.T (Events event) (EventListTT.T StrictTime chunk)@@ -643,7 +643,7 @@ sequenceModulated ::- (Check.C event, Monoid chunk, CutG.Read chunk,+ (Check.C event, Monoid chunk, CutG.Consume chunk, CutG.Transform ctrl, CutG.NormalForm ctrl, Trans.C y) => MIDIEv.Channel -> ModulatedBank y ctrl chunk ->@@ -664,7 +664,7 @@ sequenceModulatedMultiProgram ::- (Check.C event, Monoid chunk, CutG.Read chunk,+ (Check.C event, Monoid chunk, CutG.Consume chunk, CutG.Transform ctrl, CutG.NormalForm ctrl, Trans.C y) => MIDIEv.Channel -> MIDIEv.Program ->@@ -687,7 +687,7 @@ -- | may replace the other functions sequenceModulatedMultiProgramVelocityPitch ::- (Check.C event, Monoid chunk, CutG.Read chunk,+ (Check.C event, Monoid chunk, CutG.Consume chunk, CutG.Transform ctrl, CutG.NormalForm ctrl) => MIDIEv.Channel -> MIDIEv.Program ->
src/Synthesizer/MIDI/Dimensional.hs view
@@ -26,6 +26,7 @@ import qualified Synthesizer.Dimensional.Amplitude as Amp import qualified Synthesizer.Dimensional.Amplitude.Displacement as DispA import qualified Synthesizer.Dimensional.Amplitude.Filter as FiltA+import qualified Synthesizer.Dimensional.Amplitude.Control as CtrlA import qualified Synthesizer.Dimensional.Wave as WaveD import qualified Synthesizer.Basic.Wave as Wave@@ -104,7 +105,7 @@ {-# INLINE piecewiseConstant #-} piecewiseConstant ::- (SigG.Write sig y) =>+ (SigG.Produce sig y) => SigA.T rate amp (MidiPC.T y) -> SigA.T rate amp (sig y) piecewiseConstant =@@ -181,16 +182,16 @@ -- MidiEL.getPitchBendEvents chan -{-# INLINE bendWheelPressure #-}-bendWheelPressure ::- (Check.C event,- SigG.Write sig q, SigG.Transform sig q,+{-# INLINE bendWheelPressureCore #-}+bendWheelPressureCore ::+ (Check.C event, SigG.Transform sig q, RealField.C q, Trans.C q, Module.C q q, Dim.C u) =>+ (Signal s Dim.Scalar q (PC.T q) -> Signal s Dim.Scalar q (sig q)) -> Channel -> Int -> DN.T (Dim.Recip u) q -> q -> q -> Filter event s u q (Signal s Dim.Scalar q (sig q))-bendWheelPressure chan- pitchRange speed wheelDepth pressDepth =+bendWheelPressureCore piecewiseConst+ chan pitchRange speed wheelDepth pressDepth = pure (\bend fm press osci env -> let modu =@@ -203,7 +204,7 @@ in Causal.apply (env <<< Causal.feedSnd modu <<< Causal.canonicalizeFlat)- (piecewiseConstant bend))+ (piecewiseConst bend)) $: pitchBend chan (2^?(fromIntegral pitchRange/12)) (DN.scalar 1) $: controllerLinear chan VoiceMsg.modulation (zero, DN.scalar wheelDepth) zero@@ -212,7 +213,27 @@ $: Filter (return $ OsciR.static (WaveD.flat Wave.sine) zero speed) $: Filter (return $ Filt.envelope) +{-# INLINE bendWheelPressure #-}+bendWheelPressure ::+ (Check.C event, SigG.Produce sig q,+ RealField.C q, Trans.C q, Module.C q q, Dim.C u) =>+ Channel ->+ Int -> DN.T (Dim.Recip u) q -> q -> q ->+ Filter event s u q (Signal s Dim.Scalar q (sig q))+bendWheelPressure =+ bendWheelPressureCore CtrlA.piecewiseConstantGeneric +{-# INLINE bendWheelPressureStorable #-}+bendWheelPressureStorable ::+ (Check.C event, Storable q,+ RealField.C q, Trans.C q, Module.C q q, Dim.C u) =>+ Channel ->+ Int -> DN.T (Dim.Recip u) q -> q -> q ->+ Filter event s u q (Signal s Dim.Scalar q (SigSt.T q))+bendWheelPressureStorable =+ bendWheelPressureCore CtrlA.piecewiseConstantStorable++ type LazyTime s = SigA.T (Rate.Phantom s) Amp.Abstract ChunkySize.T -- type LazyTime s = SigA.T (Rate.Phantom s) Amp.Abstract SigStV.LazySize -- type LazyTime s = SigA.T (Rate.Phantom s) Amp.Abstract MidiEL.LazyTime@@ -232,7 +253,7 @@ chunkySizeFromLazyTime :: MidiEL.LazyTime -> ChunkySize.T chunkySizeFromLazyTime = Chunky.fromChunks .- map (SigG.LazySize . NonNegW.toNumber) .+ map (ChunkySize.LazySize . NonNegW.toNumber) . concatMap PC.chopLongTime . Chunky98.toChunks . Chunky98.normalize
src/Synthesizer/MIDI/Dimensional/Example/Instrument.hs view
@@ -8,6 +8,7 @@ import qualified Synthesizer.Dimensional.Causal.Process as Causal import qualified Synthesizer.Dimensional.Causal.Filter as Filt +import qualified Synthesizer.Dimensional.Duration as Dur import qualified Synthesizer.Dimensional.Rate as Rate import qualified Synthesizer.Dimensional.Rate.Cut as CutR import qualified Synthesizer.Dimensional.Rate.Control as CtrlR@@ -74,8 +75,8 @@ CtrlR.exponential2 (DN.time 0.4) end <- fmap (AnaA.endPrimitive zero) $ fmap ($ decay) SigA.embedSampleRate release <-- SigA.store (DN.time 0.01) $:- (CutR.take (DN.time 0.3) $:+ SigA.store $: Dur.fromTime (DN.time 0.01) $:+ (CutR.take $: Dur.fromTime (DN.time 0.3) $: fmap Flat.canonicalize (DN.scalar end &*^ CtrlR.exponential2 (DN.time 0.1))) append <- CutR.append@@ -171,7 +172,7 @@ because we want to use the chunk structure implied by 'dur'. -} (attack, sustain) <-- CutR.splitAt attackTime $:+ CutR.splitAt $: Dur.fromTime attackTime $: (fmap (SigC.store dur . flip CutA.appendPrimitive cnst . DispA.map sin . Flat.canonicalize)
src/Synthesizer/MIDI/Generic.hs view
@@ -52,15 +52,11 @@ ToDo: move to Generic.Signal -} replicateLong ::- (SigG.Write sig y) =>+ (SigG.Produce sig y) => StrictTime -> y -> sig y replicateLong tl y = CutG.concat $- map (\t ->- SigG.replicate--- (SigG.LazySize $ fromIntegral $ maxBound::Int)- SigG.defaultLazySize- (NonNegW.toNumber t) y) $+ map (\t -> SigG.replicate (NonNegW.toNumber t) y) $ PC.chopLongTime tl {-@@ -68,7 +64,7 @@ -} {-# INLINE piecewiseConstant #-} piecewiseConstant ::- (SigG.Write sig y) =>+ (SigG.Produce sig y) => EventListBT.T StrictTime y -> sig y piecewiseConstant = EventListBT.foldrPair@@ -77,7 +73,7 @@ {-# INLINE piecewiseConstantInit #-} piecewiseConstantInit ::- (SigG.Write sig y) =>+ (SigG.Produce sig y) => y -> EventList.T StrictTime y -> sig y piecewiseConstantInit initial = (\ ~(t,rest) ->@@ -91,7 +87,7 @@ {-# INLINE piecewiseConstantInitWith #-} piecewiseConstantInitWith ::- (SigG.Write sig c) =>+ (SigG.Produce sig c) => (y -> c) -> c -> EventList.T StrictTime [y] -> sig c piecewiseConstantInitWith f initial =
src/Synthesizer/MIDI/PiecewiseConstant/ControllerSet.hs view
@@ -122,7 +122,7 @@ [] -instance CutG.Read (T key a) where+instance CutG.Consume (T key a) where null = List.null . List.filter (> P.fromInteger 0) . EventListTT.getTimes . stream
synthesizer-midi.cabal view
@@ -1,5 +1,5 @@ Name: synthesizer-midi-Version: 0.6.1.2+Version: 0.7 License: GPL License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de>@@ -19,7 +19,7 @@ Build-Type: Simple Source-Repository this- Tag: 0.6.1.2+ Tag: 0.7 Type: darcs Location: http://code.haskell.org/synthesizer/midi/ @@ -31,27 +31,27 @@ description: Choose the new smaller, split-up base package. Flag buildExamples- description: Build example executables- default: False+ Description: Build example executables+ Default: False Library Build-Depends:- synthesizer-dimensional >=0.7 && <0.9,- synthesizer-core >=0.6 && <0.9,+ synthesizer-dimensional >=0.9 && <0.10,+ synthesizer-core >=0.9 && <0.10, sox >=0.2.1 && <0.3, midi >=0.2.1 && <0.3, storable-record >=0.0.2 && <0.1, storablevector >=0.2.5 && <0.3,- deepseq >=1.1 && <1.5,+ deepseq >=1.1 && <1.7, numeric-prelude >=0.3 && <0.5, non-negative >=0.1 && <0.2, event-list >=0.1.2 && <0.2, data-accessor-transformers >=0.2.1 && <0.3, data-accessor >=0.2.1 && <0.3,- containers >=0.1 && <0.7,+ containers >=0.1 && <0.9, array >=0.1 && <0.6, transformers >=0.2 && <0.7,- semigroups >=0.1 && <1.0,+ semigroups >=0.1 && <1, utility-ht >=0.0.1 && <0.1 If flag(splitBase)@@ -68,7 +68,7 @@ Default-Language: Haskell2010 GHC-Options: -Wall- Hs-source-dirs: src+ Hs-Source-Dirs: src Exposed-modules: Synthesizer.MIDI.EventList Synthesizer.MIDI.Generic