ABSTRACT
Sonic Pi is a music live coding language that has been designed for educational use as a first programming language. However, it is not straightforward to achieve the necessary simplicity of a first language in a music live coding setting, for reasons largely related to the manipulation of time. The original version of Sonic Pi used a `sleep' function for managing time, blocking computation for a specified time period. However, while this approach was conceptually simple, it resulted in badly timed music, especially when multiple musical threads were executing concurrently. This paper describes an alternative programming approach for timing (implemented in Sonic Pi v2.0) which maintains syntactic compatibility with v1.0, yet provides accurate timing via interaction between real time and a "virtual time''. We provide a formal specification of the temporal behaviour of Sonic Pi, motivated in relation to other recent approaches to the semantics of time in live coding and general computation. We then define a monadic model of the Sonic Pi temporal semantics which is sound with respect to this specification, using Haskell as a metalanguage.
- Samuel Aaron and Alan F Blackwell, From Sonic Pi to Overtone : Creative Musical Experiences with Domain-Specific and Functional Languages, The First ACM SIGPLAN Workshop on Functional Art, Music, Modeling & Design (Boston, Massachusetts, USA), ACM, 2013, pp. 35--46. Google ScholarDigital Library
- Mieke Bal, Travelling concepts in the humanities: A rough guide, University of Toronto Press, 2002.Google Scholar
- Matt Bellingham, Simon Holland, and Paul Mulholland, A cognitive dimensions analysis of interaction design for algorithmic composition software, Proceedings of Psychology of Programming Interest Group Annual Conference 2014 (Benedict du Boulay and Judith Good, eds.), University of Sussex, 2014, pp. 135--140.Google Scholar
- Alan Blackwell, Alex McLean, James Noble, and Julian Rohrhuber, Collaboration and learning through live coding (Dagstuhl Seminar 13382), Dagstuhl Reports 3 (2014), no. 9, 130--168.Google Scholar
- E Allen Emerson, Aloysius K Mok, A Prasad Sistla, and Jai Srinivasan, Quantitative temporal reasoning, Computer-Aided Verification, Springer, 1991, pp. 136--145. Google ScholarDigital Library
- Michael David Fisher, Dov M. Gabbay, and Lluis Vila (eds.), Handbook of Temporal Reasoning in Artificial Intelligence, Elsevier B.V., 2005.Google Scholar
- George Giorgidze and Henrik Nilsson, Switched-on Yampa -- Declarative Programming of Modular Synthesizers, Practical Aspects of Declarative Languages, Springer, 2008, pp. 282-- 298. Google ScholarDigital Library
- Hans Hansson and Bengt Jonsson, A logic for reasoning about time and reliability, Formal aspects of computing 6 (1994), no. 5, 512--535.Google Scholar
- Henkjan Honing, Issues on the representation of time and structure in music, Contemporary Music Review 9 (1993), no. 1, 221--238.Google ScholarCross Ref
- The IEEE and The Open Group, sleep -- the open group base specifications issue 7, 2013, http://pubs.opengroup. org/onlinepubs/9699919799/functions/sleep.html Retrieved 15 May, 2014.Google Scholar
- M. Kutar, C. Britton, and C.L. Nehaniv, Specifying multiple time granularities in interactive systems, Lecture Notes in Computer Science 1946 (2001), 51--63. Google ScholarDigital Library
- Edward A Lee, Computing needs time, Communications of the ACM 52 (2009), no. 5, 70--79. Google ScholarDigital Library
- Alex McLean, The textural x, Proceedings of xCoAx2013: Computation Communication Aesthetics and X (2013), 81--88.Google Scholar
- Sean McDirmid and Jonathan Edwards, Programming with Managed Time, Tech. report, Microsoft, 2014.Google Scholar
- Conor McBride and Ross Paterson, Functional pearl: Applicative programming with effects, Journal of functional programming 18 (2008), no. 1, 1--13. Google ScholarDigital Library
- Henrik Nilsson, Antony Courtney, and John Peterson, Functional reactive programming, continued, Proceedings of the 2002 ACM SIGPLAN workshop on Haskell, ACM, 2002, pp. 51--64. Google ScholarDigital Library
- Daniel Pilaud, N Halbwachs, and JA Plaice, Lustre: A declarative language for programming synchronous systems, Proceedings of the 14th Annual ACM Symposium on Principles of Programming Languages (14th POPL 1987). ACM, New York, NY, vol. 178, 1987, p. 188. Google ScholarDigital Library
- Andrew Sorensen and Henry Gardner, Programming with time: cyber-physical programming with impromptu, ACM Sigplan Notices 45 (2010), no. 10, 822--834. Google ScholarDigital Library
- Murray Shanahan, A circumscriptive calculus of events, Artificial Intelligence 77 (1995), no. 2, 249--284. Google ScholarDigital Library
- Yoav Shoham, Reasoning about change : time and causation from the standpoint of artificial intelligence, The MIT Press series in artificial intelligence, Cambridge, Mass. MIT Press, 1988, Includes index. Google ScholarDigital Library
- GeWang and Perry R Cook, ChucK: A Concurrent, On-the-fly, Audio Programming Language, International Computer Music Conference, 2003, pp. 1--8.Google Scholar
- ZhanyongWan and Paul Hudak, Functional reactive programming from first principles, ACM SIGPLAN Notices, vol. 35, ACM, 2000, pp. 242--252. Google ScholarDigital Library
Index Terms
- Temporal semantics for a live coding language
Recommendations
A live coding improvisation
C&C '13: Proceedings of the 9th ACM Conference on Creativity & CognitionA three-part live coding improvisation will be performed which involves the rhythmic arrangement of audio samples, especially percussion sounds, to emphasize the perception of time. The first section is loosely based on northern Indian improvisational ...
A livecoding semantics for functional reactive programming
FARM 2016: Proceedings of the 4th International Workshop on Functional Art, Music, Modelling, and DesignLivecoding, while extremely powerful for the arts and beyond, has largely had its semantics tied to pervasive direct mutation of state. For the most part, livecoders have not been able to take full advantage of declarative programming, particularly ...
VDM semantics of programming languages: combinators and monads
AbstractThe Vienna Development Method (VDM) was developed in the early 1970s as a variant of denotational semantics. VDM descriptions of programming languages differ from the original Scott–Strachey style by making extensive use of combinators which have ...
Comments