Syzygy is a timed event dispatching engine for live-coding AV systems.
It aims to be a robust and extensible reimplementation of the TidalCycles pattern engine.
timed event dispatching engine
License: BSD 3-Clause "New" or "Revised" License
Syzygy is a timed event dispatching engine for live-coding AV systems.
It aims to be a robust and extensible reimplementation of the TidalCycles pattern engine.
Currently, embedded in the type of Signal
is a free monoid:
newtype Signal a = mkSignal { signal :: Interval -> [a] }
This means we have all the means to defer monoidal operations until we actually process the data.
I can think of two solutions:
The best solution in my mind is to use a PRNG. Then we can build deterministic "coin flip" signals, without losing out on referential transparency (and therefore the ability to extract events at different sample rates in parallel, etc)
We need a way to use ghcid and preserve the event loop.
Probably use foreign-store
Syzygy backends should be nicely composable.
One way is to define a shared datatype for all backends (Map String (Float | String | Int)
), and have each backend know how to consume that datatype.
We should start with a test that for a continuously running signal querying process, there is no clock drift.
TODO:
NoteOn
and NoteOff
sound
n
speed
Right now our monoid instance works as a functor in the category of monoids that maps a monoid m
to m x (℘(ℝ), ∩, ℝ) x m
, modulo lots of handwaving.
Instead we want the resulting monoid to be m x (℘(ℝ), U, ∅)
.
This will involve using combineEvent instead of combineEventOverlap
Given the following code, sig1
will have audio for the entire beat, while sig2
will "blip" mometarily. That is because in sig2
, the NoteOff
of the short event fires right after the second NoteOn
fires.
sig1 :: Signal Word8
sig1 = mconcat
[ embed 60
]
sig2 :: Signal Word8
sig2 = mconcat
[ embed 60
, shift (-0.01) $ nest [ embed 60, mempty, mempty, mempty, mempty, mempty, mempty, mempty ]
]
The desired behavior of sig2
is the sound that gets drawn out for the entire beat, i.e. that the early NoteOff
gets cancelled.
Otherwise, brief events will be penalize the user by interrupting their long events.
pure
Do we really want pure
to be a periodic embedding in time?
ec6f2b8#diff-1dac8f014dcbad886e10623e125742adR16
If it is a single-time event, then
[0, 1]
? Why?[0, infinity]
? How do we encode that?<*>
I'm not really comfortable with the current semantics of ap
to be the applicative binary operator.
Example: ec6f2b8#diff-0951c5a3c5a6aa64b078d2fd55e035b6R110
ap
right now throws out the temporal structure of the left signal, in favor of the right one. That is, we toss out the time data associated with the events of the left signal. The only
thing we keep from the left signal is the multiplicity of events, simply captured in a list.
https://en.wikibooks.org/wiki/Haskell/Applicative_functors#ZipList comes to mind as a lawful applicative instance that is what we're looking for, since pure
is a periodic lifting.
So the focus instead should be on defining a zip :: Signal a -> Signal b -> Signal (a, b)
instead.
Originally posed as a solution to #14
In order to embed IO actions that affect the actual signal graph, i.e. aleatoric signal transformers, we need to make our signal type monadic. This approach deviates from Tidal in that we introduce a new type parameter, rather than riding on top of the Event type parameter.
This is how the type change would look like:
type Signal e = (Rational, Rational) -> [Event e]
type Signal e a = (Rational, Rational) -> ([Event e], a)
or
type Signal e m a = (Rational, Rational) -> ([Event e], m a)
Do we use mtl
, and get something like the following?
type Signal e m a = ReaderT (Rational, Rational) (WriterT ([Event e]) m) a
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.