Sonic π ︰ 秘境《乙》

Qiu_Ying_Jade_Cave_Fairy_Land

《玉洞仙源圖》
明代仇英繪

陶淵明‧桃花源詩

嬴氏亂天紀,賢者避其世。
黃綺之商山,伊人亦云逝。
往跡浸復湮,來逕遂蕪廢。
相命肆農耕,日入從所憩。
桑竹垂餘蔭,菽稷隨時藝。
春蠶收長絲,秋熟靡王稅。
荒路曖交通,雞犬亙鳴吠。
俎豆猶古法,衣裳無新製。
童孺縱行歌,斑白歡游詣。
草榮識節和,木衰知風厲。
雖無紀歷志,四時自成歲。
怡然有餘樂,於何勞智慧。
奇蹤隱五百,一朝敞神界。
淳薄既異源,旋復還幽蔽。
借問游方士,焉測塵囂外?
願言躡輕風,高舉尋吾契。

傳聞說『未公開的特色Undocumented feature

“It’s not a bug; it’s an undocumented feature!”

一詞來自早年 Microsoft 對於 Windows Bugs 的辯解。由於作者不知其詳,所以無法評論 WiKi 上的說法。僅就自身經驗上講︰ Intel 808x CPU 有未公開的指令, Microsoft DOS 有後門, Nintendo NES 遊戲有隱藏關卡,…… 卻彷彿是事實,或許說總有原因的吧!

假使你可以將『樹莓派 A/A+』變成『 SD 卡讀寫機』?那麼這是一種『特色』的嗎?如果是,為什麼『樹莓派 B/B+』又不行這麼作的呢??

220px-USB_OTG_Logo.svg
不期而遇
期而不遇

─── 《樹莓派 A/A+ 的秘境??

 

天機深只能『遁甲』,今欲破甲出奧妙,所以始於『乙乙』也。

秘境之探險者,可以從

Sonic Pi – Advanced programming

 

Recently I stumbled upon Sonic Pi, a sequencer with which you can generate music programmatically. There exist versions for Windows, Mac, Linux and Raspberry Pi (that’s where the names comes from). For Windows you can get it as stickware, no installation needed. And the best: it’s free!

If you don’t have it yet, go and get it: http://sonic-pi.net/

I was fascinated and spent hours exploring the endless possibilities of this software. As a developer my focus was on the possibilities of the programming language.

Sonic Pi Music Sequencer

In this article I sum up some of the programming questions I stumbled upon. As Sonic Pi aims at electronic artist, musicians and music teachers, the documentation is much better on the musical possibilities than on documenting programming features. Just try to find such topics as operators or data types in the official Sonic Pi documentation!

Some sort of Ruby

This is not an introduction into Sonic Pi, the basics you can perfectly learn in the excellent tutorial integrated in the program. No need to repeat this here. As I said before, here I document some advanced undocumented topics. The most important thing you have to know is that the programming language of Sonic Pi is a simplified Ruby. If you don’t find an answer to your programming question in the official Sonic Pi documentation you can just google it with Ruby. Many features of Ruby work, just try it out.

………

 

文本入手。

然後多知道一點

Sonic Pi Internals

 SunderB edited this page Mar 28, 2018 · 3 revisions

Introduction

So you want to peek under the hood? Whether you’re a seasoned hacker or a complete newbie, this overview will hopefully help you get the big picture of how Sonic Pi works its magic.

Moving pieces

GUI

You’ve interacted plenty with the user interface of Sonic Pi (the GUI). The GUI is written in C++ and uses the Qt framework, since that’s a nice way to build cross-platform graphical applications (RasPi, Mac, Windows, and Linux at last count). However, the GUI doesn’t do any of the heavy lifting of running code or making sound. Instead, it communicates with…

Server

The server is written in Ruby and starts in the background when Sonic Pi starts up. It’s really the heart of Sonic Pi — you could write a new front end for it and still have Sonic Pi (it’s been done… Emacs is a popular choice for some reason!). The server is responsible for executing your song’s code, and implements the vast array of functions that make Sonic Pi so well suited to making music.

The server is also home to the Time Machine, a truly amazing piece of technical wizardry that is responsible for keeping virtual time, allowing things to stay nicely musical even when different parts are moving at different speeds.

Finally, the server is a sort of zookeeper for SuperCollider, which is up next.

SuperCollider

SuperCollider is the audio synthesis engine that makes Sonic Pi sound good. The server keeps track of all the details of active notes, synthesizer parameters, FX, samples, and so on, and feeding all of that data to SuperCollider as it needs it via SC’s documented OSC API (http://doc.sccode.org/Reference/Server-Command-Reference.html). It runs in the background asscsynth. SuperCollider is a third-party project with a life of its own, and is almost untouched by Sonic Pi developers. The only exception so far is on the Windows platform, where one patch to the network code is applied to keep it from aggravating the Windows Firewall.

………

 

展開旅程呦☆

 

 

 

 

 

 

 

Sonic π ︰ 即時編程《三》下

既然隨著『狐狸蹤跡』 FoxDot 進入山林,豈有空手而回之理!

何況還發現好東東呦☺

/FoxDot

Python driven environment for Live Coding http://foxdot.org

FoxDot – Live Coding with Python v0.7

FoxDot is a Python programming environment that provides a fast and user-friendly abstraction to SuperCollider. It also comes with its own IDE, which means it can be used straight out of the box; all you need is Python and SuperCollider and you’re ready to go!

v0.7 fixes and updates

  • Added Go() function to run FoxDot code from within normal Python programs.
  • Added inf variable, which can be used as a duration in any var object to continually use a value once it has been reached e.g. var([0,1],[4,inf]). This can be combined usefully with a special var object called now which starts the timing cycle for a var at the current time in the clock:
d1 >> play("x-o-", amp=linvar([0,1],[8,inf], start=now))
  • (Experimental) Added Cycle pattern type, which can be used in conjunction with every to more effectively iterate over different values used for different calls to the same method. For example, you spread stutter over 3 beats in one call, then 2 beats in the other, you would have to use a var like so:
d1 >> play("x-o-").every(4, "stutter", dur=var([3,2],4))

This became problematic when introducting sometimes as you would not know the frequency of the call in advance. Now you can just use Cycle which will be converted to a var with appropriate timing values when used with every. Any other use of Cyclewill be treated as a regular Pattern object. Example of how to use Cycle:

d1 >> play("x-o-").sometimes("stutter", dur=Cycle([2,3]))
  • Fix Pattern.offlayer which is similar to offadd but requires a second argument specifying a method apply to the second layer as a string then the duration to delay the layer before specifying the arguments and keyword arguments to be supplied to the given methods. E.g.
# Layer with the pattern trimmed to length 3 with a delay of 0.75 beats
P[0, 1, 2, 3].offlayer("trim", 0.75, 3)

……

Documentation

Link to documentation website (still in progress)

………

Running Python files with FoxDot code

You can import FoxDot into your own Python programs as you would any other module. If you are not writing an interactive program, i.e. only containing FoxDot code, then you need to call a function Go() at the end of your program to get playback otherwise the program will terminate immediately. For example your program, my_file.py, should look something like this:

from FoxDot import *
p1 >> pads([0, 1, 2, 3])
d1 >> play("x-o-")
Go()

 

於是立馬測試︰

scide 【FoxDot.start】

 

【jackd】啟動 OK

pi@raspberrypi:~ ps ax | grep jackd  2257 ?        SLsl   0:00 /usr/bin/jackd -T -ndefault -T -d alsa </pre>    <span style="color: #808080;">【聲音正常】</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from FoxDot import *
IOError: Unable to update 'vibrato' effect.
IOError: Unable to update 'slideTo' effect.
IOError: Unable to update 'slideFrom' effect.
IOError: Unable to update 'pitchBend' effect.
IOError: Unable to update 'coarse' effect.
IOError: Unable to update 'striate' effect.
IOError: Unable to update 'highPassFilter' effect.
IOError: Unable to update 'filterSwell' effect.
IOError: Unable to update 'bandPassFilter' effect.
IOError: Unable to update 'combDelay' effect.
IOError: Unable to update 'spinPan' effect.
>>> p1 >> pads([0, 1, 2, 3])
<p1 - pads>
>>> d1 >> play("x-o-")
<d1 - play2>
>>>

 

樹莓派 3B+ 【負載不重】

 

或可接軌 Keras 架構︰

活在快速變遷的時代,或許更該慎選『API 骨架』耶?

Why use Keras?

There are countless deep learning frameworks available today. Why use Keras rather than any other? Here are some of the areas in which Keras compares favorably to existing alternatives.


Keras prioritizes developer experience

  • Keras is an API designed for human beings, not machines. Keras follows best practices for reducing cognitive load: it offers consistent & simple APIs, it minimizes the number of user actions required for common use cases, and it provides clear and actionable feedback upon user error.
  • This makes Keras easy to learn and easy to use. As a Keras user, you are more productive, allowing you to try more ideas than your competition, faster — which in turn helps you win machine learning competitions.
  • This ease of use does not come at the cost of reduced flexibility: because Keras integrates with lower-level deep learning languages (in particular TensorFlow), it enables you to implement anything you could have built in the base language. In particular, as tf.keras, the Keras API integrates seamlessly with your TensorFlow workflows.

Keras has broad adoption in the industry and the research community

With over 200,000 individual users as of November 2017, Keras has stronger adoption in both the industry and the research community than any other deep learning framework except TensorFlow itself (and Keras is commonly used in conjunction with TensorFlow).

You are already constantly interacting with features built with Keras — it is in use at Netflix, Uber, Yelp, Instacart, Zocdoc, Square, and many others. It is especially popular among startups that place deep learning at the core of their products.

Keras is also a favorite among deep learning researchers, coming in #2 in terms of mentions in scientific papers uploaded to the preprint server arXiv.org:

Keras has also been adopted by researchers at large scientific organizations, in particular CERN and NASA.


Keras makes it easy to turn models into products

Your Keras models can be easily deployed across a greater range of platforms than any other deep learning framework:

……… 摘自《教育和學習︰ UP《GRADE》【六】

 

玩玩『人工智慧』自動『即時編程』乎☆

 

 

 

 

 

 

 

 

Sonic π ︰ 即時編程《三》上

如果你是一位派生 Python 語言愛好者,或曾聽說過 FoxDot 吧!

FoxDot: Live Coding with Python & SuperCollider

This site is the home of the Live Coding environment, FoxDot, which was created in 2015 to try and open the pathways to Live Coding for users who may be new to programming and want to use it create music quickly and easily. FoxDot is an easy-to-use Python library that creates an interactive programming environment and talks to the powerful sound synthesis engine, called SuperCollider to  make music. FoxDot schedules musical events in a user-friendly and easy-to-grasp manner that makes live coding easy and fun for both programming newcomers and veterans alike. Ready to get going? You can find details on how to install here. Remember to check out the starter guide or have a look at FoxDot in action below for a few useful tips. If you’re having any issues with FoxDot or SuperCollider, have a look at the F.A.Q. or ask a question on the discussion forum.

 

近日偶讀

PyDev of the Week: Ryan Kirkbride

This week we welcome Ryan Kirkbride (@ryankirkbride26) as our PyDev of the Week! Ryan is the creator of Foxdot, a live coding library for live coding music in an interactive Python editor. You can see what projects Ryan is a part of by going to his Github page. Let’s take a few moments to get to know Ryan!

Can you tell us a little about yourself (hobbies, education, etc):

I’m currently doing a PhD at the University of Leeds in the School of Music researching collaborative tools for live coding music. Live coding is basically interactive programming for creating music or visuals and probably my favourite thing to do right now. There’s a growing scene called “Algorave” where live coders get together to make music for people to dance to and they’re a lot of fun to perform at.

Why did you start using Python?

I started using Python during my first year of university when I was studying computer science. It’s such as great language for beginners but there’s also so much to learn as you use it more and more.

………

想要安裝哩!

Installation Guide

Downloads

………

因為樹莓派上的 supercollider 版本太舊

pi@raspberrypi:~ apt-cache show supercollider Package: supercollider Version: 1:3.7.0~repack-4 Architecture: armhf Maintainer: Debian Multimedia Packages Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org> Installed-Size: 121 Depends: supercollider-language, supercollider-server, supercollider-ide Recommends: supercollider-supernova Homepage: http://supercollider.github.io Priority: optional Section: sound Filename: pool/main/s/supercollider/supercollider_3.7.0~repack-4_armhf.deb </pre>    <span style="color: #666699;">,雖依其法</span> <h4><span style="color: #808080;">Installing with SuperCollider 3.7 or earlier</span></h4> <span style="color: #808080;">If you are having trouble installing the FoxDot Quark in SuperCollider, it's usually because the version of SuperCollider you are installing doesn't have the functionality for installing Quarks or it doesn't work properly. If this is the case, you can download the contents of the following SuperCollider script:<a style="color: #808080;" href="http://foxdot.org/wp-content/uploads/foxdot.scd">foxdot.scd</a>. Once downloaded, open the file in SuperCollider and press Ctrl+Return to run it. This will make SuperCollider start listening for messages from FoxDot.</span>  <span style="color: #666699;">然以失敗告終也☻</span>  <span style="color: #666699;">所以大膽更新呦︰</span> <h1><span style="color: #ff9900;"><a style="color: #ff9900;" href="https://supercollider.github.io/development/building-raspberrypi">Building From Source on Raspberry Pi</a></span></h1> <h1 id="compiling-scide-natively-on-raspberry-pi-raspbian"><span style="color: #808080;">Compiling SCIDE natively on Raspberry Pi Raspbian</span></h1> <span style="color: #808080;">note: this is for building the latest version of supercollider including qt gui components and the ide under <strong>raspbian stretch with desktop</strong>. it is the easiest way to compile sc and this version can also run headless. see below for building non-qt, non scide under<strong>raspbian stretch lite</strong> (more advanced).</span> <h2 id="requirements"><span style="color: #808080;">requirements</span></h2> <ul>  	<li><span style="color: #808080;">raspberry pi 2 or 3 (also rpi0 and rpi1 but note that compiling will take a <em>long</em> time)</span></li>  	<li><span style="color: #808080;">sd card with <a style="color: #808080;" href="https://www.raspberrypi.org/downloads/raspbian">raspbian-stretch</a> (note: not stretch lite)</span></li>  	<li><span style="color: #808080;">router with ethernet internet connection for the rpi</span></li>  	<li><span style="color: #808080;">screen, mouse and keyboard (although you can also do it all via ssh)</span></li>  	<li><span style="color: #808080;">optional: usb soundcard with headphones or speakers connected</span></li> </ul>    <span style="color: #666699;">結果失之東隅︰</span> <pre class="lang:default decode:true ">pi@raspberrypi:~/.sonic-pi/log more gui.log 
[GUI] - Detecting port numbers...
[GUI] - GUI OSC listen port 4558
[GUI] -    port: 4558 [OK]
[GUI] - Server OSC listen port 4557
[GUI] -    port: 4557 [OK]
[GUI] - Server incoming OSC cues port 4559
[GUI] -    port: 4559 [OK]
[GUI] - Scsynth port 4556
[GUI] -    port: 4556 [OK]
[GUI] - Server OSC out port 4558
[GUI] - GUI OSC out port 4557
[GUI] - Scsynth send port 4556
[GUI] - Erlang router port 4560
[GUI] -    port: 4560 [OK]
[GUI] - OSC MIDI out port 4561
[GUI] -    port: 4561 [OK]
[GUI] - OSC MIDI in port 4562
[GUI] -    port: 4562 [OK]
[GUI] - Init script completed
[GUI] - using default editor colours
[GUI] - launching Sonic Pi Server:
[GUI] - starting UDP OSC Server on port 4558...
[GUI] - UDP OSC Server ready and listening
[GUI] - Ruby server pid registered: 1041
[GUI] - waiting for Sonic Pi Server to boot...
............................................................
[GUI] - Critical error! Could not boot Sonic Pi Server.

 

pi@raspberrypi:~/.sonic-pi/log more scsynth.log  # Starting SuperCollider 2018-12-26 18:13:04 ERROR: API version mismatch: /usr/lib/SuperCollider/plugins/BinaryOpUGens.so     This plugin is not compatible with SuperCollider >=3.9.0     The plugin has not been loaded; please find or compile a newer version.     (Plugin's API version: 2. Expected: 3)  ERROR: API version mismatch: /usr/lib/SuperCollider/plugins/PhysicalModelingUGen s.so     This plugin is not compatible with SuperCollider >=3.9.0     The plugin has not been loaded; please find or compile a newer version.     (Plugin's API version: 2. Expected: 3)  ERROR: API version mismatch: /usr/lib/SuperCollider/plugins/DynNoiseUGens.so     This plugin is not compatible with SuperCollider >=3.9.0     The plugin has not been loaded; please find or compile a newer version.     (Plugin's API version: 2. Expected: 3)  ERROR: API version mismatch: /usr/lib/SuperCollider/plugins/FFT_UGens.so     This plugin is not compatible with SuperCollider >=3.9.0     The plugin has not been loaded; please find or compile a newer version.     (Plugin's API version: 2. Expected: 3)  ERROR: API version mismatch: /usr/lib/SuperCollider/plugins/TestUGens.so --More--(2%) </pre>    <span style="color: #666699;">幸而收之桑榆矣☺</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ sudo pip3 install FoxDot
Collecting FoxDot
  Downloading https://www.piwheels.org/simple/foxdot/FoxDot-0.7.16-py3-none-any.whl (37.7MB)
    100% |████████████████████████████████| 37.7MB 8.2kB/s 
Installing collected packages: FoxDot
Successfully installed FoxDot-0.7.16

 

pi@raspberrypi:~ $ python3 -m FoxDot
IOError: Unable to update 'slideFrom' effect.
IOError: Unable to update 'pitchBend' effect.
IOError: Unable to update 'coarse' effect.
IOError: Unable to update 'striate' effect.
IOError: Unable to update 'highPassFilter' effect.
IOError: Unable to update 'bandPassFilter' effect.
IOError: Unable to update 'combDelay' effect.
IOError: Unable to update 'spinPan' effect.
IOError: Unable to update 'trimLength' effect.

 

 

 

 

 

世事往往魚與熊掌不易兼得啊!

 

 

 

 

 

 

 

Sonic π ︰ 即時編程《二》

TOPLAP Logo

All things live coding

A curated list of live coding languages and tools

This list was created with the intention of giving a quick-glance over the many possibilities to engage in this practice. For further information, head over to TOPLAP.

Contents

 

─── 摘自《/awesome-livecoding

 

想嚐鮮 sonic π 即時編程嗎?想知道他有多迷人嘛!

請跟著 Dr . Sam Aaron 博士之步伐︰

9 – Live Coding

One of the most exciting aspects of Sonic Pi is that it enables you to write and modify code live to make music, just like you might perform live with a guitar. One advantage of this approach is to give you more feedback whilst composing (get a simple loop running and keep tweaking it till it sounds just perfect). However, the main advantage is that you can take Sonic Pi on stage and gig with it.

In this section we’ll cover the fundamentals of turning your static code compositions into dynamic performances.

Hold on to your seats…

9.1 – Live Coding

Now we’ve learned enough to really start having some fun. In this section we’ll draw from all the previous sections and show you how you can start making your music compositions live and turning them into a performance. For that we’ll need 3 main ingredients:

  • An ability to write code that makes sounds – CHECK!
  • An ability to write functions – CHECK!
  • An ability to use (named) threads – CHECK!

Alrighty, let’s get started. Let’s live code our first sounds. We first need a function containing the code we want to play. Let’s start simple. We also want to loop calls to that function in a thread:

define :my_sound do
  play 50
  sleep 1
end

in_thread(name: :looper) do
  loop do
    my_sound
  end
end

If that looks a little too complicated to you, go back and re-read the sections on functions and threads. It’s not too complicated if you’ve already wrapped your head around these things.

What we have here is a function definition which just plays note 50 and sleeps for a beat. We then define a named thread called :looper which just loops around calling my_sound repeatedly.

If you run this code, you’ll hear note 50 repeating again and again…

Changing it up

Now, this is where the fun starts. Whilst the code is still running change 50 to another number, say 55, then press the Run button again. Woah! It changed! Live!

It didn’t add a new layer because we’re using named threads which only allow one thread for each name. Also, the sound changed because we redefined the function. We gave :my_sound a new definition. When the :looper thread looped around it simply called the new definition.

Try changing it again, change the note, change the sleep time. How about adding a use_synth statement? For example, change it to:

define :my_sound do
  use_synth :tb303
  play 50, release: 0.3
  sleep 0.25
end

Now it sounds pretty interesting, but we can spice it up further. Instead of playing the same note again and again, try playing a chord:

define :my_sound do
  use_synth :tb303
  play chord(:e3, :minor), release: 0.3
  sleep 0.5
end

How about playing random notes from the chord:

define :my_sound do
  use_synth :tb303
  play choose(chord(:e3, :minor)), release: 0.3
  sleep 0.25
end

Or using a random cutoff value:

define :my_sound do
  use_synth :tb303
  play choose(chord(:e3, :minor)), release: 0.2, cutoff: rrand(60, 130)
  sleep 0.25
end

Finally, add some drums:

define :my_sound do
  use_synth :tb303
  sample :drum_bass_hard, rate: rrand(0.5, 2)
  play choose(chord(:e3, :minor)), release: 0.2, cutoff: rrand(60, 130)
  sleep 0.25
end

Now things are getting exciting!

However, before you jump up and start live coding with functions and threads, stop what you’re doing and read the next section on live_loop which will change the way you code in Sonic Pi forever…

 

踏進『即時迴圈』的世界︰

9.2 – Live Loops

Ok, so this section of the tutorial is the real gem. If you only read one section, it should be this one. If you read the previous section on Live Coding Fundamentals, live_loop is a simple way of doing exactly that but without having to write so much.

If you didn’t read the previous section, live_loop is the best way to jam with Sonic Pi.

Let’s play. Write the following in a new buffer:

live_loop :foo do
  play 60
  sleep 1
end

Now press the Run button. You hear a basic beep every beat. Nothing fun there. However, don’t press Stop just yet. Change the 60 to 65and press Run again.

Woah! It changed automatically without missing a beat. This is live coding.

 

事實上,早有一本『祕笈』在等著你呢☆

Sonic Pi Essentials

Learn to code musical masterpieces with the creator of Sonic Pi in our best Essentials e-book yet!

sonicpi

 

Sam Aaron, the creator of Sonic Pi, has written this book to complement the software’s built-in tutorial and to help you jump-start your live-coding career. The book is packed with fun, instantly rewarding examples designed to highlight many of the amazing things Sonic Pi enables you to do. By the time you’ve finished you’ll be able to code up some phat bass, sparkling synth leads and start practicing for your first live-coding gig…

Live code and craft amazing sounds across 10 chapters, including:

  • Master live loops
  • Build drum breaks
  • Compose your own melodies
  • Make random riffs and loops
  • Learn to shape and sculpt sounds
  • and much, much more…

 

 

 

 

 

 

 

Sonic π ︰ 即時編程《一》

……黑傑克終於發現了咔嗎的『密室』,在多次的探訪後,找到一道『暗門』,不知通往何鄉何處?心中掂量著該退?最終發了一則『簡訊』,自此消逝於人世間……

1H ㄍㄞˋ 5W ㄉㄨㄟ一˙

1H 解?5W 追?

。黑傑克的言語駁雜,這則簡訊又太短,實在不容易『定論』,就妄說一通吧!『1H 解』當是說他已經了解了『Know How』;順著說『5W 追』自該是『Who?『Where?『When?『What?『Why?由於『誰地時事』大體已解,那可以『』的也只剩下『◎』──  Why 為什麼 ── 了。此處用◎是有原因的,英文的 Why 又說成 For What,這就是『為什麼』的翻譯由來因為見到黑傑克用了『追問』之追,頗感『學問之道』的不容易,故此特用◎,彰顯他的 Why not ── 追追追 ──精神!!

就讓我們開始『自己的旅程』吧!建造咔嗎衛星的人或許憂慮樹莓派的『運作效能』不夠,『即時』 real time 音樂,是需要強力的 CPU 心臟,所以用

ssh -XY ccrma@【咔嗎衛星 IP 地址】

,將視窗的繪製連上它 ── -XY 安全的轉送 forward X 視窗 ──的個人電腦來作,這使它反而更像個『雲端咔嗎』了。

─── 《黑傑克的咔嗎!!明暗之交

 

什麼是『即時編程』 Live Coding 呢?

About

TOPLAP is an organisation founded in 2004, to explore and promote live coding.

Live coding is a new direction in electronic music and video, and is getting somewhere interesting. Live coders expose and rewire the innards of software while it generates improvised music and/or visuals. All code manipulation is projected for your pleasure. Live coding works across musical genres, and has been seen in concert halls, late night jazz bars, as well as algoraves. There is also a strong movement of video-based live coders, writing code to make visuals, and many environments can do both sound and video, creating synaesthetic experiences.

Live coding is inclusive and accessible to all. Many live coding environments can be downloaded and used for free, with documentation and examples to get you started and friendly on-line communities to help when you get problems. Popular live coding software includes ChucK,  Cyrilextemporefluxusimpromptu, overtone and supercollider. Environments designed for fast exploration of musical pattern include ixi lang and TidalCycles. Sonic Pi is designed for teaching both music and computer science in classrooms, as well as performing in algoraves. There are also impressively capable web-based live coding environments like gibber and livecodelab. Live patching is live coding with graph-based languages such as the venerable pure-data. It’s also possible to livecode with a gamepad, e.g. with the robot oriented Al-Jazari.

There is a more complete and up-to-date directory of live coding environments and other things over here: All Things Livecoding.

Historical information about TOPLAP and live coding is available on our wiki and the latest developments in live coding can be seen on our blog. For an up-to-date list of  links to things live coding see here.

Video examples

The Show Us Your Screens documentary by Louis McCallum.

 

莫忘『純數據』 Pure Data 實為即時先驅也。

開出今日滿園『即興』『影』『音』之花朵!

Live coding

Live coding[1] (sometimes referred to as ‘on-the-fly programming’,[2] ‘just in time programming’ and ‘conversational programming’) makes programming an integral part of the running program.[3]

It is most prominent as a performing arts form and a creativity technique centred upon the writing of source code and the use of interactive programming in an improvised way. Live coding is often used to create sound and image based digital media, as well as light systems, improvised dance and poetry,[4][5] though is particularly prevalent in computer music usually as improvisation, although it could be combined with algorithmic composition.[6] Typically, the process of writing source code is made visible by projecting the computer screen in the audience space, with ways of visualising the code an area of active research.[7] Live coding techniques are also employed outside of performance, such as in producing sound for film[8] or audiovisual work for interactive art installations.[9] Also, the interconnection between computers makes possible to realize this practice networked in group.

The figure of live coder is who performs the act of live coding, usually “artists who want to learn to code, and coders who want to express themselves”[10] or in terms of Wang & Cook the “programmer/performer/composer”.[11]

Live coding is also an increasingly popular technique in programming-related lectures and conference presentations, and has been described as a “best practice” for computer science lectures by Mark Guzdial.[12]

Live coding techniques

A range of techniques have been developed and appropriated for the purposes of live coding.

Representation and manipulation of time

The specific affordances of time-based media and live interaction with code has led to a number of novel developments and uses in programming language design. Through mutual embedding of imperative and declarative subsystems, the programming language SuperCollider[13] permitted to build a library that allows incomplete and provisional specifications which can be rewritten at runtime.[14]

The ChucK language introduced an approach to “strongly timed” programming in 2002, embedding precision timing into control flow through a concise syntax.

“Temporal recursion” was a term initially coined in relation to the Impromptu programming environment. Technical elements within a programming environment continue to locate compressors and recursion solutions, but timing had been a major issue. While the general form of a temporal recursion, being any asynchronous function recursion through time, is available to any event driven system, Impromptu has placed a special emphasis on this particular design pattern,[15] making it the centre piece of the concurrency architecture on that platform. Temporal recursion had repeatedly been used in SuperCollider and has since been implemented in the Fluxus environment.

Another functional approach to the representation of time is shown in the Tidal pattern DSL,[16] which represents patterns as combinators operating over functions of time, similar to techniques in functional reactive programming.[17]

Multi-user programming and shared memory

Multi-user programming has developed in the context of group music-making, through the long development of the Republic system developed and employed by members of the network band PowerBooks Unplugged.[18] Republic is built into the SuperCollider language, and allows participants to collaboratively write live code that is distributed across the network of computers. There are similar efforts in other languages, such as the distributed tuple space used in the Impromptu language.[19] Additionally Overtone, Impromptu and Extempore support multi-user sessions, in which any number of programmers can intervene across the network in a given runtime process.[20] More recently systems as Extramuros are used to live coding in group through the technique of shared buffers of code written in SuperCollider and TidalCycles languages. The practice of writing code in group can be done in the same room through a local network or from remote places accessing a common server. Terms like laptop band, laptop orchestra, collaborative live coding or collective live coding are used to frame a networked live coding practice both in a local or remote way.

 

現在樹莓派裡的『超級對撞機』環境或已成熟︰

sudo apt-get install supercollider-ide supercollider-language supercollider

【scide】

 

因沒有用過,不好亂講呦☻

還請讀者自己嘗試哩☺

/howto_co34pt_liveCode

A repository of readmes, techniques, notes and other materials about how i live code in SuperCollider. A (sorta) companion repository to co34pt_livecode

howto_co34pt_liveCode


About

howto_co34pt_liveCode is an attempt to extensively document my live-coding music practice. I live code as co¥ᄀpt, mostly making dance music (including for Algoraves), but I have also employed live coding as part of some other projects. This repo contains a number of articles and essays listed in this contents page which cover various aspects of my live coding practice from the ground up, and also contains a number of files to support your use of SuperCollider in the way that I use it. More info about this in ‘What This Repo Is’

This resource is hosted both on GitHub and on GitHub Pages (you will likely already be on one of these). I’d recommend browsing articles on GitHub pages, and if you want to use any of the examples, see any SuperCollider code and use my setup I’d recommend downloading the repo, this will be covered in ‘How To Use This Repo’. There is also e-book versions of the ‘first edition’ of this repo in the Documents folder in epub, pdf and pages format. Huge thanks to @shamansir for putting these together.

This repository is currently mostly finished, but does need proofreading, which I will be doing soon. It will be continually updated as my live coding practice develops.

I’m always keen to know the ways in which this has been helpful to anyone, or any comments you have at all. Drop me a line onTwitter, GitHub or via [Email](mailto:theseancotterill atsign live period com)