分類彙整: 樹莓派

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧ Hi-Jack‧簡介

『插頭』 jack 概念之淵源久遠,早在那個『接線生』 Operator 尚為專業的『電話』時代,就操作著『通話配線板』

A telephone switchboard is a telecommunications system used in the public switched telephone network or in enterprises to interconnect circuits of telephones to establish telephone calls between the subscribers or users, or between other exchanges. The switchboard was an essential component of a manual telephone exchange, and was operated by one or more persons, called operators who either used electrical cords or switches to establish the connections.

The electromechanical automatic telephone exchange, invented by Almon Strowger in 1888, gradually replaced manual switchboards in central telephone exchanges starting in 1919 when the Bell System adopted automatic switching, but many manual branch exchanges remained operational during the last half of the 20th century in offices, hotels, or other enterprises. Later electronic devices and computer technology gave the operator access to an abundance of features. In modern businesses, a private branch exchange (PBX) often has an attendant console for the operator, or an auto-attendant, which bypasses the operator entirely.

1280px-Offutt_Air_Force_Base_operator

 

,完成『收發』兩方之『通訊』。其後或許因為時代進步,也許是教育發達,那個專業也變成了『直覺』而且『簡易』的了!於是乎應用範圍日增漸廣,其中最主要的應用,還是用在『音響設備』之『連接』上︰

Phone connector (audio)

In electronics, a phone connector, also known as phone jack, audio jack or jack plug, is a common family of connector typically used for analog signals, primarily audio. It is cylindrical in shape, typically with two, three or four contacts. Three-contact versions are known as TRS connectors, where T stands for “tip”, R stands for “ring” and S stands for “sleeve”. Similarly, two- and four-contact versions are called TS and TRRS connectors respectively.

The phone connector was invented for use in telephone switchboards in the 19th century and is still widely used. In its original configuration, the outside diameter of the “sleeve” conductor is 14 inch (exactly 6.35 mm). The “mini” connector has a diameter of 3.5 mm (approx. 18 inch) and the “sub-mini” connector has a diameter of 2.5 mm (approx. 332 inch).

 

TS_0.25inch_mono_plug

A pair of phone connectors: A phone plug (right) is inserted in a phone socket (left). For terms, see section Other connectors, other terms.

A 6.35 mm (14 inch) two-contact phone connector used for various signals including electric guitar, loudspeaker, microphone and line-level audio.

220px-Jack-plug--socket-switch

 

如此當可理解 JACK 這個專業級的『聲音伺服器』,之所以用著『反覆』之詞自名的哩!

JACK Audio Connection Kit

Introduction

JACK is a low-latency audio server, written for any operating system that is reasonably POSIX compliant. It currently exists for Linux, OS X, Solaris, FreeBSD and Windows. It can connect several client applications to an audio device, and allow them to share audio with each other. Clients can run as separate processes like normal applications, or within the JACK server as “plugins”.

JACK was designed from the ground up for professional audio work, and its design focuses on two key areas: synchronous execution of all clients, and low latency operation.

See also:
<http://jackaudio.org>

JACK Overview

Traditionally it has been hard if not impossible to write audio applications that can share data with each other. In addition, configuring and managing audio interface hardware has often been one of the most complex aspect of writing audio software.

JACK changes all this by providing an API that does several things:

1. provides a high level abstraction for programmers that removes the audio interface hardware from the picture and allows them to concentrate on the core functionality of their software.

2. allows applications to send and receive audio data to/from each other as well as the audio interface. There is no difference in how an application sends or receives data regardless of whether it comes from/goes to another application or an audio interface.

For programmers with experience of several other audio APIs such as PortAudio, Apple’s CoreAudio, Steinberg’s VST and ASIO as well as many others, JACK presents a familiar model: your program provides a “callback” function that will be executed at the right time. Your callback can send and receive data as well as do other signal processing tasks. You are not responsible for managing audio interfaces or threading, and there is no “format negotiation”: all audio data within JACK is represented as 32 bit floating point values.

For those with experiences rooted in the Unix world, JACK presents a somewhat unfamiliar API. Most Unix APIs are based on the read/write model spawned by the “everything is a file” abstraction that Unix is rightly famous for. The problem with this design is that it fails to take the realtime nature of audio interfaces into account, or more precisely, it fails to force application developers to pay sufficient attention to this aspect of their task. In addition, it becomes rather difficult to facilitate inter-application audio routing when different programs are not all running synchronously.

Using JACK within your program is very simple, and typically consists of just:

  • calling jack_client_open() to connect to the JACK server.
  • registering “ports” to enable data to be moved to and from your application.
  • registering a “process callback” which will be called at the right time by the JACK server.
  • telling JACK that your application is ready to start processing data.

There is a lot more that you can do with JACK’s interfaces, but for many applications, this is all that is needed. The simple_client.c example demonstrates a complete (simple!) JACK application that just copies the signal arriving at its input port to its output port. Similarly, inprocess.c shows how to write an internal client “plugin” that runs within the JACK server process.

───

 

。同時曉得 JACK 的操作既『直覺』又『簡易』,根本無須再說明的乎!!『出』連『入』,『入』接『出』,『入』『出』間流著『聲音數據 』,如是而已矣??!!

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧ Hi-Jack‧Sonic π 之設定

固然『插頭』 Jack 並非是為 Sonic π 而設計,由於  Sonic π 相關教育資源越來越豐富,因著此一利益,特別以此為中心來談 Jack 的設定 。同時希望更快的進入主題,這裡的說法也不多作解釋,可算是個『快速開始』 quick start 的吧,隨著接續篇章之開展,再於適當處隨處補講的了。

【使用選單啟動 Sonic π 】

Sonic Pi_啟動

 

【 qjackctl 之啟動】

由於預設的選單中並沒有打開 qjackctl 選項顯示,使用者可以用『主選單』編輯器將之打開,

Main Menu Editor_編輯

 

執行 qjackctl 後,將可見到 Sonic π 起始的 jackd 伺服器。

JACK Audio Connection Kit [(default)] Active.畫面

 

【設定 jackd 】

因為我們運行的環境,是由多種 jack 應用軟體組合而成,故而不宜使用系統預設的『設定值』,以下設定是嘗試後之『參考設定』,建議讀者能夠自行玩玩改改的吧。

Setup - JACK Audio Connection Kit_設定

 

【啟動 jackd meterbridge 之示波器】

這是一個『命令列』的應用程式,需要使用『終端機』來啟動。

啟動示波器

sco bridge-2997_啟動

 

【啟動 jackd jaaa 頻譜分析儀】

可以使用【影聲選單】內之『 jaaa (with JACK support) 』來啟動。

Jack-Alsa Audio Analyser-0.8.4 [jaaa]_啟動

 

【將 Sonic π 的聲音輸出連接到多個裝置】

這也就是『音響插頭』的主旨之一。此處將Sonic π 程式的聲音輸出 ,同時接線到『示波器』、『頻譜分析儀』以及『系統喇叭』。

Connections - JACK Audio Connection Kit_接線

 

【執行 Sonic π 範例測試】

Sonic Pi_範例

 

【示波器顯示】

sco bridge-2275_示波器

 

【頻譜分析儀顯示】

Jack-Alsa Audio Analyser-0.8.4 [jaaa]_頻譜分析

 

此時聽著『耳中之聲音』,看著『儀表之顯示』,再次思索所謂的 M♪o 現象『認知學習』之環境,或許將有不同感觸的乎!!??

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧ Hi-Jack‧再相逢

提筆望著文章標題,想起過去和『黑傑克』在一起的一段因緣︰

 

【詩經‧魏風‧碩鼠】

碩鼠碩鼠,無食我黍!三歲貫女,莫我肯顧。

逝將去女,適彼樂土 ;樂土樂土,爰得我所。

碩鼠碩鼠,無食我麥!三歲貫女,莫我肯德。

逝將去女,適彼樂國 ;樂國樂國,爰得我直。

 碩鼠碩鼠,無食我苗!三歲貫女,莫我肯勞。

逝將去女,適彼樂郊 ;樂郊樂郊,誰之永號?

這是一首『民歌』, 出自詩經魏風,三章八句用了九個ㄌㄜˋ字,卻得不著陶淵明.桃花源記裡那點世外的『怡然自樂』。想《爾雅》裡的ㄕˊ,又怎麼會跑到百姓的『田裡』,吃的肥肥大大?該是說上位者剝削無厭,雖然已經『多年慣你』── 三歲貫女 ──,你卻不理的照、恩和辛勞;以至於人民不得不想『誓將棄汝』──  逝將去女 ──,去尋找人間聖境的『香格里拉』,以求安居之,擁有自我價,也免於吁歎永號ㄏㄠˊ!

ㄩㄝˋ字的『造字象木架子上有張弦的琴,有人正說唱著旁;而樂器則是凝鑄聲學成為了音樂。美國 Standford 大學有一個『音樂與聲學的計算機研究中心Center for Computer Research in Music and Acoustics,以『 CCRMA 』的簡稱楊名於外,唸作『 karma 』。很久以前就有 Fernando Lopez-Lezcano 先生所編程發行的 Fedora Linux 音樂軟體匯集『 Planet CCRMA at home 』,模寫了在 CCRMA 『咔嗎』ㄎㄚ ㄇㄚ˙ 研究所裡用的大部分的 Linux 環境與軟體。約莫在 2011 年,又有 Wendy Ju 女士和 Edgar Berdahl 先生所創立的『Satellite CCRMA』──

rpiccrma-satelite

咔嗎衛星是一個平台 platform,一個可以建構『嵌入式樂器』和『安置嵌入式藝術』的平台。整合了開源的軟硬體,還有著一些只見於小說的新奇軟件。最重要的是可以『吃著魚釣魚』,提供的範例能讓一個『新手』幾分鐘內就能上手

── 這一個網站。

目前所用的硬件,漸漸的從高貴的米格魯』Beagle,移向好吃的樹莓派』!!

此曲是一部如何黑傑克hijack 掉  “咔嗎衛星” 的講古

─── 引自《咔嗎尋奇 Standford 的 CCRMA!!首部曲

 

如今那『咔嗎衛星』已不見『米格魯』的蹤影,倒是首選增加了 2B 『樹莓派』大餐。世事變化與時遷移,早忘了當時與音樂平台結緣的初衷是什麼的哩︰

next up previous
Next: Installing Planet CCRMA on Up: Planet CCRMA at home Previous: Planet CCRMA at home

What is Planet CCRMA at Home?

Planet CCRMA at Home is a collection of free, open source software packages that you can add to a computer running Fedora 20, 21 or 22 or CentOS 5 to transform it into an audio/video oriented workstation. Here at CCRMA we use a consistent and well defined Linux environment for our daily work in audio and computer music and research. With the Planet CCRMA at Home package collection, you can easily install most of that environment on your own Linux system.

You will only be able to install Planet CCRMA on top of the supported versions of Fedora or CentOS. For other linux distributions see this entry in the FAQs (Frequently Asked Questions).

First pointers to answers to some important questions (that can, of course, be safely skipped 🙂

how was the planet named?
how did it get created?
how old is it?

───

 

卻記得是認識『音響插頭』 Audio Jack 軟體架構的起始︰

JACKJACK Audio Connection Kit遞迴縮寫)是一個專業級的聲音服務守護行程),它為聲音和MIDI資料提供即時的、低延時的連線,有關的程式使用JACK的API

它是由保羅·戴維斯Paul Davis)(他憑著這項工作贏得了2004年的開源獎[3])帶領的一個開源社群開發。自從2002年初以來一直是Linux下的關鍵的基礎設施和事實上的專業音訊軟體標準。這個服務是在GNU GPL協定下的開源軟體,它的庫則採用更寬鬆的GNU LGPL協定。

Linux_kernel_and_daemons_with_exclusive_access.svg

Like PulseAudio, JACK daemon is an “audio daemon”, i.e. it does hardware mixing. For this it assumes to have exclusive access to the kernel’s audio sub-system.

 

當下再探,實驚訝於數千個日子的流逝,文件依舊稀有,說明仍然撲朔,宛如人煙稀少之花園的耶?數數官網上一大系列的應用軟體 ,竟然有二百多個,真叫人疑惑得很啊!!看來,有如初相遇一般 ,不得不再次從 jackd『手冊』 man 開始,重新咀嚼一大堆『術語 』,嘗試各種伺服器的『設定 』,以期能夠得到在樹莓派上可以接受之『聲音輸出』的『品質』的了!!??

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧安裝篇‧下

為了清楚說明 M♪o 之『學習』『遞迴觀』,也許簡單的辦法是用她自身的『學習』歷程來詮釋︰

 

派生碼訊

辰 龍

遯:亨,小利貞。

彖曰:遯亨,遯而亨也。 剛當位而應,與時行也。 小利貞,浸而長也。遯之時義大矣哉 !

象曰:天下有山,遯﹔君子以遠小人,不惡而嚴。

︰《 易 》易曰︰

六二,執之用黃牛之革,莫之勝說。

象曰:執用黃牛,固志也。

山 山高侵昊 天 天,時 厲 厲,難與行。何德能嘉遯?志固執用黃牛革。傲來有石 猴 猴,獨尊是佛陀,如來血脈一滴傳,因而敢登唯我峰。臨 事 事心踟躕,意緒無處寄

晚晴》李商隱

深居俯夾城,春去夏猶清。
天意憐幽草,人間重晚晴。
並添高閣迥,微注小窗明。
越鳥巢乾後,歸飛體更輕。

,總是時到時擔當。

派︰突然停課,吹嚮了《加百利之號角!!》︰

500px-GabrielHorn

傳說中大天使加百利之號角 Gabriel’s Horn 一旦響起,就是審判日 Judgment Day 的到來。然而卻沒有任何人見過這個號角?這也許正是義大利數學家埃萬傑利斯塔‧托里拆利 Evangelista Torricelli 想像創造托里拆利小號之原因︰它是一個表面積無限大但卻體積有限的三維物體,或許該是用著第五元素乙太才能構成的吧!!

羊角螺旋

Cornu_Spiral.svg

龍捲風

比方說︰『事實就是發生過了的事』? 如果曾經有一隻猴子真的敲打出了莎士比亞的哈姆雷特,那麽這是那隻猴子它自己能知道的事實嗎?假使連它自己都不能知道,人們會認為這是件發生過的事實嗎? 又假使歷史上根本沒有莎士比亞的哈姆雷特,然而未來將會有□□的○○,到那時有隻猴子曾使這事成真的了,難道真的可以歸結說過去曾經有一隻猴子真的敲打出 了□□的○○的嗎?

學習就像是個『羊角螺旋』的軌跡,一再的一次又一次覆裹著中心的主題,每次的回歸 ,總是帶著新的知識與舊的記憶。自古以來人類一直想方設法希望解開大自然的奧秘,也許終將能有一天,這個思想螺旋成了『龍捲風』,大到能含括天地萬物。

這樣的一個學習者將會如何建造自己知識之金字塔的呢?他會不會用『想像的實驗』去釐清『基本概念』之糾葛的呢?還是用『推導歸謬』的邏輯,去探測一個『自明假設』之深遠結論的呢?又或者會將在大自然中發現的方程式求解,然後『畫圖』與『演示』這個解之意義的呢?……

如果從人類的創造發明史來看,那樣的學習者終將使用當時之最好的『學習工具』,打造自己的『學習工具箱』,甚至會創新『既有之工具』。就現今來講,除了使用電腦的一般應用軟體之外 ── 比方說文書處理等等 ──,最重要的就是能掌握 『程式語言』與『數學語言』的工具。或許這正是樹莓派基金會一開始打造樹莓派時所想的重要原因,讓學習者能有學習的工具!!
……

─── 引自《 M♪o 之學習筆記本《辰》組元︰【䷠】黃牛之革

 

這是一條經『生澀』過『熟巧』的道路。或許因此可以知『經驗』之『粹練』如何型塑了一個人的『理解』︰

……

, 真真是,夏日午後雷雨多,把我們當『鴨子』,叫我們『聽雷』的哩!雖是這麼想,那裡頭還彷彿真有『名堂』的ㄟ,即使聽無,就當是異地觀光!!

☆ 編者言說明

自『卯』的首篇 ䷁ 起, M♪o 學習筆記之篇章序次,改成了『十二爻辰』, 或許是因應課綱變了,不宜再用『五行序』。十二爻辰又稱作『十二消息卦』,是一年四季流轉,天地給予『消息』。所謂『八月有凶』,蓋指『臨』䷒ 經過『泰』䷊ ,而後『否』䷋ ,再到『觀』 ䷓ ,中有八個月。由『臨』月始一,八月入『否』。此篇可苦了編者,九天九地,收尋《庫文》《網文》以應其《 數 》數。

 

生 ︰同學們,要深入理解『入出針』,必須確實明白『取樣原理』, 《 技 》技講︰

Sampling (signal processing)

Signal_Sampling

In signal processing, sampling is the reduction of a continuous signal to a discrete signal. A common example is the conversion of a sound wave (a continuous signal) to a sequence of samples (a discrete-time signal).

A sample is a value or set of values at a point in time and/or space.

A sampler is a subsystem or operation that extracts samples from a continuous signal.

A theoretical ideal sampler produces samples equivalent to the instantaneous value of the continuous signal at the desired points.

Theory

Sampling can be done for functions varying in space, time, or any other dimension, and similar results are obtained in two or more dimensions.

For functions that vary with time, let s(t) be a continuous function (or “signal”) to be sampled, and let sampling be performed by measuring the value of the continuous function every T seconds, which is called the sampling interval.[1]  Then the sampled function is given by the sequence:

s(nT),   for integer values of n.

The sampling frequency or sampling rate, fs, is the average number of samples obtained in one second (samples per second), thus fs = 1/T.

Reconstructing a continuous function from samples is done by interpolation algorithms. The Whittaker–Shannon interpolation formula is mathematically equivalent to an ideal lowpass filter whose input is a sequence of Dirac delta functions that are modulated (multiplied) by the sample values. When the time interval between adjacent samples is a constant (T), the sequence of delta functions is called a Dirac comb. Mathematically, the modulated Dirac comb is equivalent to the product of the comb function with s(t). That purely mathematical abstraction is sometimes referred to as impulse sampling.[2]

Most sampled signals are not simply stored and reconstructed. But the fidelity of a theoretical reconstruction is a customary measure of the effectiveness of sampling. That fidelity is reduced when s(t) contains frequency components whose periodicity is smaller than 2 samples; or equivalently the ratio of cycles to samples exceeds ½ (see Aliasing). The quantity ½ cycles/sample × fs samples/sec = fs/2 cycles/sec (hertz) is known as the Nyquist frequency of the sampler. Therefore s(t) is usually the output of a lowpass filter, functionally known as an anti-aliasing filter. Without an anti-aliasing filter, frequencies higher than the Nyquist frequency will influence the samples in a way that is misinterpreted by the interpolation process.[3]
……

ㄚ˙ㄏㄚˋ,AHHA 過去本不是『白老鼠』,焉知 ── 莊子 ──,焉不知 ── 惠施 ──『魚出游』的『感覺』?!

果然然,『拔茅茹,以其夤,』但求『征吉。』??

碼 ︰研 習 。 今天時候晚了,不實作,就研習一點什麼是『取樣』之概念。何謂『平』與『陂』的呢?如果從螞蟻和大象的『觀點』來看,能夠一樣嗎??光以『相對大小』來 講,大象以為『平』的,對螞蟻來說,可以『陂』陡的不得了。再說螞蟻的一步『小』,大象的足距『大』,要是用幾何上的『曲線』比喻,螞蟻『沿』著曲線走, 大象一『踏』就一段。如此螞蟻的『足跡』即使是『離散』也較『符合』那條『曲線』,大象『疏闊』之『步履』恐不存那條『曲線』之形的了。此《 圖

debouce-graph

的精義,就是表達開關『兩態取值』之『取樣』觀。不同的取樣『速度』 ── 頻率 ──,所讀到的『情況』可以不同。『高』頻的似『螞蟻』,『低』頻的如『大象』。若是忽略了『彈跳』的暫態現象,恐會引發『開』或『關』狀態之『誤判』,不可不慎。

同學們可以參考下面程式

pi@raspberrypi ~ $ sudo -s
root@raspberrypi:/home/pi# python3
Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> from time import sleep
>>> GPIO.setmode(GPIO.BCM)
>>> 
>>> 按鍵一 = 23
>>> 頻率 = 100
>>> 數據列 = []
>>> 
>>> def 等入高針按鍵取值(針碼, 取值列, 頻率=100, 資料=100):
...     GPIO.setup(針碼, GPIO.IN, pull_up_down = GPIO.PUD_UP)
...     while True:
...         if GPIO.input(針碼) == 0:
...             for i in range(資料):
...                 取值列.append(GPIO.input(針碼))
...                 sleep(1.0/頻率)
...             break
... 
>>> 等入高針按鍵取值(按鍵一, 數據列)
>>> 數據列
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
>>> len(數據列)
100
>>> 測試列=[]
>>> 等入高針按鍵取值(按鍵一, 測試列, 頻率=500, 資料=500)
>>> len(測試列)
500
>>> 數據列
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
>>>

,試著探討『彈跳現象』。

行 ︰豈可『妄自菲薄』,定要『發憤圖強』。☿

訊 ︰☿ 今方知所謂『無平不陂』矣。

─── 引自《 M♪o 之學習筆記本《卯》基件︰【䷊】無平不陂

 

所以可以將 M♪o 之『學習』『遞迴觀』詮釋為萬事萬物『理解』的『定點』,一再『回歸地』『認識』那個『事物』,終至能達該個『事物』之『理解』。這是『過程』與『結果』間『契合』的共鳴﹐可能也是『理解』之可以『理解』,『生命』『認知』不假外求的『絕待』。然後明白了解,現象『認知學習』之環境的『主旨』就是『生命』之『理解』的『途徑』罷了!!

 

【 JACK 環境安裝】

sudo apt-get install jaaa jack-capture jack-keyboard jack-mixer jack-rack jack-stdio jack-tools jackeq jnoise meterbridge freqtweak 

sudo apt-get install lilypond rosegarden kmidimon

sudo apt-get install qjackctl qsynth

sudo apt-get install puredata

sudo apt-get install brp-pacu japa

sudo apt-get install x42-plugins

sudo apt-get install alsaplayer-gtk alsaplayer-jack alsaplayer-text

sudo pip3 install JACK-Client

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧安裝篇‧中

回想五百個日子之前,曾經介紹英國劍橋的 Dr Sam Aaron 博士寫作的 Sonic  π

音樂 = □ + □

白居易琵琶行

……
千呼萬喚始出來,猶抱琵琶半遮面。
轉軸撥絃三兩聲,未成曲調先有情。
絃絃掩抑聲聲思,似訴平生不得志。
低眉信手續續彈,說盡心中無限事。
輕攏慢撚抹復挑,初為《霓裳》後《六么》。
大絃嘈嘈如急雨,小絃切切如私語。
嘈嘈切切錯雜彈,大珠小珠落玉盤。
間關鶯語花底滑,幽咽泉流水下灘。
水泉冷澀絃凝絕,凝絕不通聲暫歇。
別有幽愁暗恨生,此時無聲勝有聲。
銀瓶乍破水漿迸,鐵騎突出刀槍鳴。
曲終收撥當心畫,四絃一聲如裂帛。
東舟西舫悄無言,唯見江心秋月白。
……

過去唐朝的大詩人白樂天,文章功深力厚又精音通律,於琵琶行一文中描寫著一位『彈著琵琶的女子』,文本直叫能『音聲』透出筆端奪字而來。現今跨海英國劍橋的 Dr Sam Aaron 博士寫作 Sonic  π 要想讓『電腦科學變成聽得到的』!Sonic  π 是用『音符寫程式的電腦語言,用著MIDI ── Music Instrument Digital Interface ──  樂器數位介面的『數字碼』表示各種『聲音合成器』上的音符的『音高』,以『四分音符』為中心,表達著音長的『節拍』與『旋律』。目前雖是個簡單的視窗程式,然而它的功能實足以媲美許多『音樂學習』的電腦輔助系統,更重要的是,你可以用它來『實驗』,證實『樂理』上說的諸諸種種── 那些不靠『聽覺』去親身體驗理解的事──。當下它的使用文件只有『提示紙』幾頁──  Cheat Sheet  ──,故此為著嚐鮮的讀者,癹上 了MIDI 音符碼對照表

sonicpi-midicode

─── 引自《走進音樂世界!!

 

且用一系列文本《Sonic Π ……… 》來推廣『不止』是『電腦科學』可以『聽得到』︰

……

現今『 Sonic π 』2.0 版已經正式發布,據聞將用於英國 KS3 ── 十一歲到十三歲 ── 的『程式語言』教育之中。它的主要『學習目標』是︰

Computer Science concepts:

Sequencing
Debugging
Iteration
Conditionals
Data Structures
Algorithms
Functions
Concurrency

計算機科學概念

編序
除錯
疊代
條件轉移
資料結構
演算法
函式
並行性

Sonic Pi(在 raspberrypi)_069

學習』需是要『溫故知新』,須能夠『專心致志』,方才可『精博通達』。就讓我們藉著『音樂』去悠遊『程式』一番,再次發現自然裡『聲音的宇宙』。

─── 引自《 Sonic π 知音?!

 

甚至整個『科學』也應該能夠『看得見』的吧?當時受限於軟硬體之環境,終究無法跨步向前。如今『 Sonic π 』已經不只是版本的更新而已,而且是多平台的大改裝了︰

Sonic Pi

Live Coding for Everyone

A free live coding synth for everyone originally designed to support computing and music lessons within schools.
Use code to compose and perform in classical and contemporary styles ranging from Canons to Dubstep.

Brought to you by Sam Aaron and the Sonic Pi Core Team,

v2.7.0 is available free for:

Raspberry Pi Mac OS X Windows

───

 

故於介紹 M♪o 的『教育理念』之時,實願統合 Dr Sam Aaron 博士之想法。幸而蒼天不負苦心人,或是天下殊途同歸,『 Sonic π 』也是立基於『插頭』的建制︰

 

home

Have you ever wanted to take the audio output of one piece of software and send it to another? How about taking the output of that same program and send it to two others, then record the result in the first program? Or maybe you’re a programmer who writes real-time audio and music applications and who is looking for a cross-platform API that enables not only device sharing but also inter-application audio routing, and is incredibly easy to learn and use? If so, JACK may be what you’ve been looking for.

───

 

總算是舖平了這條難言之路耶!

 

【驗證結果】

sonicpi