{"title":"实时编码语言的时态语义","authors":"Samuel Aaron, Dominic A. Orchard, A. Blackwell","doi":"10.1145/2633638.2633648","DOIUrl":null,"url":null,"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.","PeriodicalId":88474,"journal":{"name":"El Farmaceutico","volume":"43 1","pages":"37-47"},"PeriodicalIF":0.0000,"publicationDate":"2014-09-03","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"12","resultStr":"{\"title\":\"Temporal semantics for a live coding language\",\"authors\":\"Samuel Aaron, Dominic A. Orchard, A. Blackwell\",\"doi\":\"10.1145/2633638.2633648\",\"DOIUrl\":null,\"url\":null,\"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.\",\"PeriodicalId\":88474,\"journal\":{\"name\":\"El Farmaceutico\",\"volume\":\"43 1\",\"pages\":\"37-47\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2014-09-03\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"12\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"El Farmaceutico\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/2633638.2633648\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"El Farmaceutico","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2633638.2633648","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 12
摘要
Sonic Pi是一种音乐现场编码语言,被设计用于教育用途作为第一编程语言。然而,在音乐现场编码设置中实现第一语言的必要简单性并不容易,原因主要与时间操纵有关。最初版本的索尼克派使用了一个“睡眠”功能来管理时间,在指定的时间段内阻塞计算。然而,尽管这种方法在概念上很简单,但它却导致了糟糕的音乐时间,特别是当多个音乐线程同时执行时。本文描述了另一种定时编程方法(在Sonic Pi v2.0中实现),该方法保持了与v1.0的语法兼容性,但通过实时和“虚拟时间”之间的交互提供了精确的定时。我们提供了Sonic Pi的时间行为的正式规范,其动机与其他最近的实时编码和一般计算中时间语义的方法有关。然后,我们使用Haskell作为元语言,定义了Sonic Pi时态语义的一元模型,该模型相对于此规范是合理的。
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.