.. in the visual synthesizer niseq: 13k LOC
.. in the upcoming Pmmd modular synth module
you can use S.fix to bind recursive relationships between modules
so the subscriber relation is inverted, relative to OO, where you register listeners
in effect, a FRP first class module, is a stateful instance, which others can subscribe to
you can use E.fold/S.fix inside a module to accumulate state
you can program with time-semantics in a declarative way
CV-in ports are given as functor params
CV-out ports are returned via functor result
events are equivalent to CV "gates"
signals are equivalent to ordinary CV
.. though ofc. much more is possible with FRP than with modular-synth modules
there is btw. a direct relation between modular-synth modules and this model too
.. and return a module containing events and signals
.. which are module-functors that receive a set of events and signals as input
.. use OCaml first class modules
the setup is as follows:
then you get something that looks a bit like OO, if you squint, but it's safe
and I've found that if you mix OCamls module system with FRP..
I've worked with FRP for a long time now
think
21 thoughts left