Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Survey of programming languages for sound and m...

Survey of programming languages for sound and music

2021/03/19 SIGPX #8

Tomoya Matsuura

March 19, 2021
Tweet

More Decks by Tomoya Matsuura

Other Decks in Programming

Transcript

  1. • ਆಸ઒ݝכϲ࡚ࢢग़਎(1994) • ਆಸ઒૯߹ߴߍଔ(2013) • ౦ژܳज़େֶԻָ؀ڥ૑଄Պଔ(2017) • ۝भେֶେֶӃܳज़޻ֶ෎ 
 म࢜/ത࢜ޙظ՝ఔ(2017,2019~)

    • ࿇পࣥଠϑϧϑΟϧ(2018~) • YCAM(Intern,2015),teamlab(2015~2017),
 School for Poetic Computation(2018) ࣗݾ঺հ 2 photo: Takehiro Goto
  2. 3 minimal musical medium / a programming language as an

    Infrastructure for sound & music. https://github.com/mimium-org/mimium 3
  3. ԻָʹίϯϐϡʔλʔΛ༻͍ΔϞνϕʔγϣϯ ԻָϓϩάϥϛϯάݴޠΛ࡞ΔϞνϕʔγϣϯ • ϋʔυ΢ΣΞૢ࡞ʢϝϞϦɺεϨουɺεέδϡʔϦϯάʣ
 ͷӅṭʢԻָՈ͸ϝϞϦͷ͜ͱΛؾʹͨ͘͠ͳ͍ʣ • ԋ૗/࡞ۂΠϯλʔϑΣʔεͱͯ͠ͷϓϩάϥϛϯάʢLive Codingʣ • ϝσΟ΢Ϝͱͯ͠ͷιʔείʔυʢ#SC140ɺMML΍ςΩετԻָαΫϥͳͲʣ

    • ϓϩάϥϛϯάڭҭͷπʔϧͱͯ͠(EarSketch,Sonic Pi) Իָϓϩάϥϛϯάݴޠͷ໨త 6 • ίϯϐϡʔλʔͰͳ͚Ε͹ෆՄೳͳදݱɺ৽͍͠දݱʢmicrosoundͳͲʣ • ݱ࣮ͷָثɺ؀ڥͷγϛϡϨʔτ(VSTɺ෺ཧϞσϦϯά߹੒)
  4. • "Languages for Computer Music”,Frontiers in Digital Humanities(2018), Roger B.

    Dannenberg • ԻָݴޠΛಛ௃͚ͮΔ6ཁૉͷఏҊɺԻָݴޠҰൠʹڞ௨͢Δ՝୊ͷ੔ཧ • “Computer Music Languages and Systems: The Synergy Between Technology and Creativity”,pp 1-49 in Handbook of Digital Games and Entertainment Technologies(2016),Hiroki Nishino and Ryohei Nakatsu • “The Development of Computer Music Programming Systems”, Journal of New Music research,42(1), pp97-100(2013) Victor Lazzrini • ↑2ͭ͸ओʹྺ࢙త؍఺ͷ੔ཧ • “Idiomatic Patterns and Aesthetic Influence in Computer Music Languages”, Organized Sound,25(1),pp53-63(2020),Andrew Mcpherson and Koray Tahlroǧlu • Իָϓϩάϥϛϯά؀ڥ͕ͲͷΑ͏ʹͦͷݴޠݻ༗ͷදݱΛੜΈग़͢ͷ͔ΛΠϯλϏϡʔ͔Β ԻָϓϩάϥϛϯάݴޠͷαʔϕΠ 7
  5. ԻָϓϩάϥϛϯάݴޠҰཡ 9 l-BOHVBHFTGPS$PNQVUFS.VTJD 3PHFS#%BOOFOCFSHz 'SPOUJFSTJO%JHJUBM)VNBOJUJFT /PW Ճච͸দӜ Overtone Sam Aaron

    (2011?) Sonic PI Sam Aaron (2012) TidalCycles Alex Mclean (2006~) Chronic Eli Blandt (2002) Kronos Versa Norilo (2015) LC Hiroki Nishino (2013) ixi lang Thor Magnusson (2012) Gibber Charlie Roberts (2012) FoxDot Jean-François Parent (2015) Extempore Andrew Sorensen (2012) impromptu Andrew Sorensen (2010) Common Lisp Music Bill Schottstaedt (1989) SuperCollider- Clients SOUL ROLI (2018) Vult Leonardo Laguna Ruiz (2016) mimium Tomoya Matsuura (2020) Gwion Jérémie Astor (2017) ଞɺmidiϨϕϧΛϝΠϯͷର৅ʹͨ͠؀ڥʹAlda(2012)΍Takt(2014)ɺORCΛ(2017)ͳͲ
  6. 1.ΠϕϯτεέδϡʔϦϯά໰୊ 13 ΦʔσΟΦόοϑΝʢྫ:256αϯϓϧʣຖʹΠϕϯτΩϡʔΛফԽ PuredataɺSuperColliderͳͲ ಉظ(Synchronous) ࿦ཧ࣌ؒʢLogical TimeʣͰॱংΛอূ ChucK,Gwion,mimiumͳͲ w ࣮૷͸ΘΓͱ؆୯ɺಈ࡞ܰྔ

    w .*%*΍6%1ͳͲ*0བྷΈͷ͕࣌ؒਖ਼֬Ͱ͸ͳ͍ w $PODVSSFOUͳॲཧʹ࠷దԽ͠Α͏ͱࢥ͏ͱେม w *0ؔ࿈΋ൺֱతਖ਼֬ʹॲཧͰ͖Δ w εϨου҆શͳ࣮૷ͭΒ͍ w ཁݸผ04ຖͷରԠɺ૊ΈࠐΈͱ͔ʹ͸Ҡ২ͮ͠Β͍ ඇಉظ(Asynchronous) εϨου෼͚ͯϦΞϧλΠϜεέδϡʔϧ Max※,ExtemporeͳͲ ※ਖ਼֬ʹ͸Max͸ΦʔσΟΦͱεϨουΛ෼͚͍ͯΔ͕ΦʔσΟΦͱผϨʔτ(ඪ४ 20msຖ)ͰΠϕϯτΩϡʔΛpoll͍ͯ͠Δɻ
 Extempore͸λεΫ଴ͪ࣌ؒΛܭࢉͯ͠λεΫ͕͋Δ࣌ͷΈىಈ ϋΠϒϦου Ϣʔβʔ͕໌ࣔͯ͠ಉظ/ඇಉظΛ੾Γସ͑ LC(Nishino2013)ͳͲ ྫɿͽͬͨΓαϯϓϧຖʹม਺Λมߋ͍ͨ͠ʜ ͚Ͳຖαϯϓϧॲཧ͢Δͷ͸ա৒ ྫɿͽͬͨΓαϯϓϧຖʹม਺Λมߋ͍ͨ͠ʜ ͚Ͳຖαϯϓϧॲཧ͢Δͷ͸ա৒
  7. • Pd΍SCͰ͸༻ҙ͞ΕͨجຊϞδϡʔϧɿUnit GeneratorʢUGenɺΦγϨʔλ΍ ϑΟϧλͷ͜ͱʣΛ૊Έ߹ΘͤΔ͜ͱͰ৴߸ॲཧΛهड़Ͱ͖Δ • ৽͍͠جຊϞδϡʔϧΛ࡞Γͨ͘ͳͬͨΒͲ͏͢Δʁ
 →C or C++ͰϓϥάΠϯ࡞ͬͯͶʢͭΒ͍ʣ •

    JITίϯύΠϧ͢Ε͹ύϑΥʔϚϯεΛଛͳΘͣ௚઀৴߸ॲཧΛهड़Ͱ͖ΔͷͰ͸ʁ • DSPܥݴޠɿFaust,Soul,Vult,Kronos • JITͷόοΫΤϯυ͸͍͍ͩͨLLVMɺC΍C++ίʔυͱͯ͠τϥϯεύΠϧͰ͖Δ ΋ͷ΋ଟ͍ɻWebAssemblyհͯ͠ϒϥ΢βͰಈ࡞͢Δ΋ͷ΋ • ໰୊ɿDSPݴޠࣗମ͸εέδϡʔϦϯάͷSemanticsΛ࣋ͨͳ͍ͷ͕΄ͱΜͲ 2.௿ϨΠϠͷ֦ுੑ 14
  8. • ϦζϜύλʔϯ/Ի֊/࿨Իͱ͍ͬͨߴ࣍ͷύϥϝʔλΛϓϩάϥϜ͢Δʹ ͸ݴޠͷந৅Խೳྗʢಛʹܕ·ΘΓʣ͕଍Γͳ͍ • ྫ͑͹PdͩͱϓϦϛςΟϒͱϓϦϛςΟϒ͔Β੒ΔϦετ͔͠ѻ͑ͳ͍ • ϙϐϡϥʔͳղܾࡦɿSuperColliderΛωοτϫʔΫίϚϯυͰૢ࡞Ͱ͖Δ γϯηαΠβʔͱͯ͠࢖͍ɺ৽͍͠DSLΛ࡞Δ • SC͸v3ΑΓૄ݁߹ͳαʔόʔɾΫϥΠΞϯτϞσϧΛ࠾༻ɺ৽͍͠γϯηͷఆٛ(SynthDef)Ҏ֎

    ͸΄΅ͳΜͰ΋OSC(UDP্ͷ؆қϓϩτίϧ)Ͱૢ࡞Մೳ • Sonic Pi(Ruby+Erlang)ɺixi(Ruby)ɺFoxDot(Python)ɺTidalCycles(Haskell)ɺOvertone(Clojure)ͳͲ • ໰୊ɿωοτϫʔΫίϚϯυͷਖ਼֬ͳεέδϡʔϦϯάΛ…(σδϟϰ) 3.ߴϨΠϠͷ֦ுੑ 15 DSL on DSLͷϗετͷબ୒ࢶ͸࣮࣭SuperColliderҰ୒ͳͷ͕ݱঢ়
  9. • ࣈ۟ղੳ • ݴޠ֦ு • ݴޠಛघԽ • ύΠϓϥΠϯ • ιʔεtoιʔεม׵

    SpinellisʹΑΔDSL࣮૷ͷσβΠϯύλʔϯΑΓൈਮ Ͳ͏΍࣮ͬͯ૷͢Δʁ 16 Diomidis Spinellis. Notable design patterns for domain specific languages. Journal of Systems and Software, 56(1):91–99, February 2001. (doi:10.1016/S0164-1212(00)00089-3) Ұ൪ετϨʔτͳΞϓϩʔνɺࣗ༝౓ߴ͍͕࣮૷େม ԋࢉࢠΦʔόʔϩʔυ΍ϚΫϩͳͲɺࣗ༝౓͸ϗετݴޠ࣍ୈ ϘΠϥʔϓϨʔτͱ૊Έ߹ΘͤͨΓɺҰ෦ͷػೳ͚ͩ࢖͏ Cͷιʔεʹม׵ͨ͠Γ͢Δ͜ͱͰόοΫΤϯυ؆ུԽ SuperColliderʹ৴߸ॲཧ෦෼͸͓೚ͤ
  10. SuperColliderʹΑΔه๏ 17 { var noise = PinkNoise.ar(0.2); noise = Mix.new(Array.fill(10,

    {arg i; Resonz.ar(noise, i * 800 + 200, 0.05)})); noise = (noise * 0.2 + noise * Decay.kr(Dust.kr(0.5),10)); noise = RHPF.ar(noise, LFNoise0.kr(0.5).range(220, 880), rq:0.001); CombL.ar(noise, delaytime:0.5, decaytime:25).dup() * 0.5 }.play; (-> noise = PinkNoise.ar(0.2) noise = Mix Array.fill 10, (i)-> Resonz.ar(noise, i * 800 + 200, 0.05) noise = (noise * 0.2 + noise * Decay.kr(Dust.kr(0.5), 10)) noise = RHPF.ar(noise, LFNoise0.kr(0.5).range(220, 880), rq:0.001) CombL.ar(noise, delaytime:0.5, decaytime:25).dup() * 0.5 ).play() CoffeColliderʹΑΔه๏ CoffeeScriptͷԋࢉࢠΦʔόʔϩʔυ͚ͩͰՄೳͳݶΓه๏Λࣅ͍ͤͯΔ http://mohayonao.github.io/CoffeeCollider/#noise.coffee
  11. ԻָݴޠͷΞʔΩςΫνϟ 19 ίϯύΠϥ/ ΠϯλϓϦλ ϥϯλΠϜ ιʔείʔυ (ςΩετσʔλ) தؒදݱ UGenάϥϑߏ଄ VM໋ྩྻ

    Ϛγϯίʔυ ϨΠϠʔ ߴ ௿ ϥΠϒϥϦ ҙຯ֦ு • தؒදݱͷཻ౓ʹΑͬͯදݱͷ෯΍ಈతมߋͷ͠΍͕͢͞มΘͬͯ͘Δ 50~80sɿ DSPϋʔυ΢ΣΞ 00s: UGen
  12. ϏδϡΞϧݴޠͷ৔߹ 20 ίϯύΠϥ/ ΠϯλϓϦλ ϥϯλΠϜ ιʔείʔυ (ςΩετ/όΠφϦσʔλ) தؒදݱ UGenάϥϑߏ଄ VM໋ྩྻ

    Ϛγϯίʔυ ϨΠϠʔ ߴ ௿ ϏδϡΞϥΠβ ʢIDEʣ ஌֮/ฤू Մೳͳදݱ ϥΠϒϥϦ ҙຯ֦ு • ͋Δҙຯී௨ͷݴޠ΋UTF-8ͳͲܾ·ͬͨόΠφϦσʔλΛɺςΩετͱ͍͏ਓؒʹೝࣝՄ ೳͳදݱʹม׵͍ͯ͠ΔͷͰ͜ͷਤʹ౰ͯ͸ΊΔ͜ͱ΋Ͱ͖Δ
  13. தؒදݱ͸ͻͱͭͱ͸ݶΒͳ͍ 21 ϥϯλΠϜ ιʔείʔυ (ςΩετ/όΠφϦσʔλ) ϏδϡΞϥΠβ ʢIDEʣ ஌֮/ฤू Մೳͳදݱ ίϯύΠϥ/

    ΠϯλϓϦλ தؒදݱ ϥΠϒϥϦ ίϯύΠϥ/ ΠϯλϓϦλ தؒදݱ ϥΠϒϥϦ ίϯύΠϥ/ ΠϯλϓϦλ தؒදݱ ϥΠϒϥϦ
  14. TidalCyclesͷྫ 22 HaskellΠϯλϓϦλ(GHCI) TidalCycles BP ύʔα ύλʔϯ
 ϥΠϒϥϦ ιʔείʔυ (ςΩετσʔλ)

    ҙຯ֦ு SC ΫϥΠΞϯτ OSC ϝοηʔδ SCSynth Pattern σʔλ • ʢ͍·͍ͪ͏·͘ਤࣔͰ͖ͳ͍ʣ
  15. • Syntax(౷ޠ࿦) • Semantics(ҙຯ࿦) • Runtime • Libraries • Programming

    Environments(IDE) • Community&Resources Dannenbergʢ2018ʣʹΑΔ ԻָݴޠΛಛ௃͚ͮΔཁૉ 23
  16. • ͜͜ͰͷExpressivenessͱ͸“ಡΈ΍͘͢ॻ͖΍͍͢”ɺ
 Generalͱ͸“Մೳͳදݱͷൣғ͕޿͍”ͱ͍͏ҙຯ Expressive vs General 24 E. Brandt, “Temporal

    type constructors for computer music programming,” School of Computer Science, Carnegie Mellon University, 2002. ࣮ࡍʹ͸࣮ߦ࣌ύϑΥʔϚϯε͕ ѱ͘ͳΔͱ͍͏৽ͨͳτϨʔυΦ ϑ͕ൃੜ͍ͯ͠Δ
  17. 3ͭͷہॴԽͱ3ͭͷޮ཰ੑ ཁૉ͕༩͑Δಛ௃ͷ෼ྨʢͷҊʣ 26 6ͭΛશ෦৳͹͢ͷ͸ݫ͘͠ɺτϨʔυΦϑ͕͋Δ Expression Generality දݱͷہॴੑ Platform Independency ؀ڥͷہॴੑ

    Dynamic Modification ܧଓత࣮ߦͷہॴੑ Runtime Efficiency ࣮ߦ࣌ͷܭࢉίετ Learning Efficiency Ϣʔβʔͷֶशίετ Development Efficiency ։ൃίετ গͳ͘ͱ΋ɺ“͋ΒΏΔ؀ڥͰ͋ΒΏΔදݱ͕Ͱ͖ɺಈతมߋ΋͠·͘Εͯ௚ײతʹ࢖͍΍͢ ࣮͘ߦ଎౓΋ωΠςΟϒฒΈ”ͷݴޠΛ࡞Ζ͏ͱ͢Δͱ։ൃίετ͕ͱΜͰ΋ͳ͍͜ͱʹͳΔ
  18. 27 Syntax Semantics Runtime Libraries Programming Environment Community Resources Development

    Efficiency Runtime Efficiency Learning Efficiency Expression Generality Dynamic Modification ֤ཁૉͱಛ௃ͷؔ܎ Platform Independency …ຊ౰ʹ͜ΕΒͷཁૉ͚ͩͰݴޠΛධՁͰ͖ΔͷͩΖ͏͔ʁ
  19. • ΠϕϯτεέδϡʔϧͱJIT DSP͕1ͭͷݴޠମܥͰ׬݁͢Δݴޠ • ࣗݾ൓өੑΛڧΊͨݴޠ಺DSLΛ࡞Γ΍͍͢ݴޠ • ςΩετɺඇςΩετΛ૊Έ߹Θͤ/૒ํ޲ධՁͰ͖Δݴޠ • ෳ਺ͷݴޠʹ·͕ͨͬͯ࢖͑ΔLanguage Server/IDEج൫

    ະདྷͷԻָϓϩάϥϛϯά 32 Language Oriented Programming(Racket)ͷΑ͏ͳੈք؍ʁ ↓↑DAWʢԻ੍ָ࡞ιϑτ΢ΣΞʣͱͷΑΓࠜຊతͳ࿈ܞʁ →mimiumͰϝΠϯͰ࣮ݱ͍ͨ͜͠ͱ ໺ྑϓϩάϥϛϯάݴޠͷϦϙδτϦ͕਺ඦݸGithubʹస͕ͬͯΔΑ͏ʹɺ਺ඦݸͷԻָݴޠ͔Β޷͖ ͳͷΛϑϨΩγϒϧʹ૊Έ߹ΘͤΒΕΔΑ͏ͳੈք͕དྷͯཉ͍͠ʢເʣ