Functional Reactive Programming and the Web Audio API
Functional Reactive Programming (FRP) is a way to model temporal phenomena using events, which carry information corresponding to a precise moment in time, and behaviors, which represent time-varying values. This paper shows how FRP can be used to build reactive audio applications that blend the WebAudio API with other browser-based APIs, such as mouse events and MIDI events. It will start by presenting a brief history of FRP as well as definitions of the Event and Behavior types. It will then discuss the principal challenges of applying the behavior pattern to WebAudio and how these challenges can be solved by using induction on existentially-quantified and linearly-typed Indexed Cofree Comonads. An implementation of this approach is provided via the library purescript-wags.
@inproceedings{2021_55,
abstract = {Functional Reactive Programming (FRP) is a way to model temporal phenomena using events, which carry information corresponding to a precise moment in time, and behaviors, which represent time-varying values. This paper shows how FRP can be used to build reactive audio applications that blend the WebAudio API with other browser-based APIs, such as mouse events and MIDI events. It will start by presenting a brief history of FRP as well as definitions of the Event and Behavior types. It will then discuss the principal challenges of applying the behavior pattern to WebAudio and how these challenges can be solved by using induction on existentially-quantified and linearly-typed Indexed Cofree Comonads. An implementation of this approach is provided via the library purescript-wags.},
address = {Barcelona, Spain},
author = {Solomon, Mike},
booktitle = {Proceedings of the International Web Audio Conference},
editor = {Joglar-Ongay, Luis and Serra, Xavier and Font, Frederic and Tovstogan, Philip and Stolfi, Ariane and A. Correya, Albin and Ramires, Antonio and Bogdanov, Dmitry and Faraldo, Angel and Favory, Xavier},
month = {July},
pages = {},
publisher = {UPF},
series = {WAC '21},
title = {Functional Reactive Programming and the Web Audio API},
year = {2021},
ISSN = {2663-5844}
}