樹莓派 HATs ︰ 規格鳥瞰

雖說樹莓派 HATs 並非大部頭之規格︰

B+ HAT requirements

A board can only be called a HAT if:

  1. It conforms to the basic add-on board requirements
  2. It has a valid ID EEPROM (including vendor info, GPIO map and valid device tree information).
  3. It has a full size 40W GPIO connector.
  4. It follows the HAT mechanical specification
  5. It uses a GPIO connector that spaces the HAT between 10mm and 12mm from the Pi (i.e. uses spacers between 10mm and 12mm).
  6. If back powering via the GPIO connector the HAT must be able to supply a minimum of 1.3A continuously to the Pi (but ability to supply 2A continuously recommended).

Of course users are free to put an ID EEPROM on boards that don’t otherwise conform to the remainder of the specifications – in fact we strongly encourage this; we just want things called HATs to be a known and well-specified entity to make life easier for customers, particularly the less technical ones.

Design Resources

Before designing any new add-on board (HAT compliant or not) please read the design guide carefully.

For what to flash into the ID EEPROM see the ID EEPROM data format spec.

There are tools and documentation on how to flash ID EEPROMs here.

 

瀏覽過整份文件者,當會發現其實也十分複雜。作者因不知是否有什麼快解速讀之法,通常將之比擬成拼圖,起初略分『已知』、『未知 』的『資料』;初步考察『大架構』、『小部件』的『組成 』。然後隨著『資料』的查詢與收集,架構部件『組成』的理解,一次又一次重新『閱讀』,總能明白的吧!!??由於文本的主要目的是探究 ID EEPROM 與樹莓派軟件系統之關係,因此只以幾張簡單圖示代表一般所謂的 HATs Add-On Card 的了︰

【HATs 機構圖】

hatmech

 

【ID EEPROM 電路圖】

eeprom-circuit

 

【5V 供電安全性示意圖】

backpowering-diagram

 

不論用什麼作拼圖之起點,終究選一個理解較多的開始較好,所以作者從命令列之 shell script

#!/bin/sh

MODE="NOT_SET"
FILE="NOT_SET"
TYPE="NOT_SET"

usage()
{
	echo "eepflash: Writes or reads .eep binary image to/from HAT EEPROM on a Raspberry Pi"
	echo ""
	echo "./eepflash.sh"
	echo "	-h --help: display this help message"
	echo "	-r --read: read .eep from the eeprom"
	echo "	-w --write: write .eep to the eeprom"
	echo "	-f=file_name --file=file_name: binary .eep file to read to/from"
	echo "	-t=eeprom_type --type=eeprom_type: eeprom type to use"
	echo "		We support the following eeprom types:"
	echo "		-24c32"
	echo "		-24c64"
	echo "		-24c128"
	echo "		-24c256"
	echo "		-24c512"
	echo "		-24c1024"
	echo ""
}
………

modprobe i2c_dev
dtoverlay i2c-gpio i2c_gpio_sda=0 i2c_gpio_scl=1
rc=? if [rc != 0 ]; then
	echo "Loading of i2c-gpio dtoverlay failed. Do an rpi-update (and maybe apt-get update; apt-get upgrade)."
	exit rc fi modprobe at24 rc=?
if [ rc != 0 ]; then 	echo "Modprobe of at24 failed. Do an rpi-update." 	exitrc
fi

if [ ! -d "/sys/class/i2c-adapter/i2c-3/3-0050" ]; then
	echo "TYPE 0x50" > /sys/class/i2c-adapter/i2c-3/new_device fi   if [ "MODE" = "write" ]
 then
	echo "Writing..."
	dd if=FILE of=/sys/class/i2c-adapter/i2c-3/3-0050/eeprom 	rc=?
elif [ "MODE" = "read" ]  then 	echo "Reading..." 	dd if=/sys/class/i2c-adapter/i2c-3/3-0050/eeprom of=FILE
	rc=? fi  if [rc != 0 ]; then
	echo "Error doing I/O operation."
	exit rc else 	echo "Done." fi </pre>    <span style="color: #003300;">讀碼展開。先查了一下到底</span> <h1><span style="color: #003300;"><a style="color: #003300;" href="http://lxr.free-electrons.com/source/">Linux</a>/<a style="color: #003300;" href="http://lxr.free-electrons.com/source/drivers/">drivers</a>/<a style="color: #003300;" href="http://lxr.free-electrons.com/source/drivers/misc/">misc</a>/<a style="color: #003300;" href="http://lxr.free-electrons.com/source/drivers/misc/eeprom/">eeprom</a>/<a style="color: #003300;" href="http://lxr.free-electrons.com/source/drivers/misc/eeprom/at24.c">at24.c</a></span></h1> <pre class="lang:python decode:true">  1 /*   2  * at24.c - handle most I2C EEPROMs   3  *   4  * Copyright (C) 2005-2007 David Brownell   5  * Copyright (C) 2008 Wolfram Sang, Pengutronix   6  *   7  * This program is free software; you can redistribute it and/or modify   8  * it under the terms of the GNU General Public License as published by   9  * the Free Software Foundation; either version 2 of the License, or  10  * (at your option) any later version.  11  */  12 #include <linux/kernel.h>  13 #include <linux/init.h>  14 #include <linux/module.h>  15 #include <linux/slab.h>  16 #include <linux/delay.h>  17 #include <linux/mutex.h>  18 #include <linux/mod_devicetable.h>  19 #include <linux/log2.h>  20 #include <linux/bitops.h>  21 #include <linux/jiffies.h>  22 #include <linux/of.h>  23 #include <linux/acpi.h>  24 #include <linux/i2c.h>  25 #include <linux/nvmem-provider.h>  26 #include <linux/platform_data/at24.h>  27   28 /*  29  * I2C EEPROMs from most vendors are inexpensive and mostly interchangeable.  30  * Differences between different vendor product lines (like Atmel AT24C or  31  * MicroChip 24LC, etc) won't much matter for typical read/write access.  32  * There are also I2C RAM chips, likewise interchangeable. One example  33  * would be the PCF8570, which acts like a 24c02 EEPROM (256 bytes).  34  *  35  * However, misconfiguration can lose data. "Set 16-bit memory address"  36  * to a part with 8-bit addressing will overwrite data. Writing with too  37  * big a page size also loses data. And it's not safe to assume that the  38  * conventional addresses 0x50..0x57 only hold eeproms; a PCF8563 RTC  39  * uses 0x51, for just one example.  40  *  41  * Accordingly, explicit board-specific configuration data should be used  42  * in almost all cases. (One partial exception is an SMBus used to access  43  * "SPD" data for DRAM sticks. Those only use 24c02 EEPROMs.)  44  *  45  * So this driver uses "new style" I2C driver binding, expecting to be  46  * told what devices exist. That may be in arch/X/mach-Y/board-Z.c or  47  * similar kernel-resident tables; or, configuration data coming from  48  * a bootloader.  49  *  50  * Other than binding model, current differences from "eeprom" driver are  51  * that this one handles write access and isn't restricted to 24c02 devices.  52  * It also handles larger devices (32 kbit and up) with two-byte addresses,  53  * which won't work on pure SMBus systems.  54  */  55</pre>    <span style="color: #003300;">是什麼?複習了一下,</span>  <span style="color: #ff9900;">echo "TYPE 0x50" > /sys/class/i2c-adapter/i2c-3/new_device

的意義︰

Linux/Documentation/i2c/instantiating-devices
207 Method 4: Instantiate from user-space
208 -------------------------------------
209 
210 In general, the kernel should know which I2C devices are connected and
211 what addresses they live at. However, in certain cases, it does not, so a
212 sysfs interface was added to let the user provide the information. This
213 interface is made of 2 attribute files which are created in every I2C bus
214 directory: new_device and delete_device. Both files are write only and you
215 must write the right parameters to them in order to properly instantiate,
216 respectively delete, an I2C device.
217 
218 File new_device takes 2 parameters: the name of the I2C device (a string)
219 and the address of the I2C device (a number, typically expressed in
220 hexadecimal starting with 0x, but can also be expressed in decimal.)
221 
222 File delete_device takes a single parameter: the address of the I2C
223 device. As no two devices can live at the same address on a given I2C
224 segment, the address is sufficient to uniquely identify the device to be
225 deleted.
226 
227 Example:
228 # echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device
229 
230 While this interface should only be used when in-kernel device declaration
231 can't be done, there is a variety of cases where it can be helpful:
232 * The I2C driver usually detects devices (method 3 above) but the bus
233   segment your device lives on doesn't have the proper class bit set and
234   thus detection doesn't trigger.
235 * The I2C driver usually detects devices, but your device lives at an
236   unexpected address.
237 * The I2C driver usually detects devices, but your device is not detected,
238   either because the detection routine is too strict, or because your
239   device is not officially supported yet but you know it is compatible.
240 * You are developing a driver on a test board, where you soldered the I2C
241   device yourself.
242 
243 This interface is a replacement for the force_* module parameters some I2C
244 drivers implement. Being implemented in i2c-core rather than in each
245 device driver individually, it is much more efficient, and also has the
246 advantage that you do not have to reload the driver to change a setting.
247 You can also instantiate the device before the driver is loaded or even
248 available, and you don't need to know what driver the device needs.

 

於是心中大體有了個譜??!!

 

【I2C 參考文本】

W!o+ 的《小伶鼬工坊演義》︰ 一窺全豹之系統設計《解讀》

W!o+ 的《小伶鼬工坊演義》︰ 一窺全豹之系統設計‧探索開始

 

 

 

 

 

 

 

 

 

 

 

樹莓派 HATs ︰ Hardware Attached on Top

猶記當初最早接觸帽子 HATs ,是想玩『計算模組』

Compute Module

compute-module

The Compute Module is a Raspberry Pi in a more flexible form factor, intended for industrial application.

The compute module contains the guts of a Raspberry Pi (the BCM2835 processor and 512Mbyte of RAM) as well as a 4Gbyte eMMC Flash device (which is the equivalent of the SD card in the Pi). This is all integrated on to a small 67.6x30mm board which fits into a standard DDR2 SODIMM connector (the same type of connector as used for laptop memory). The Flash memory is connected directly to the processor on the board, but the remaining processor interfaces are available to the user via the connector pins. You get the full flexibility of the BCM2835 SoC (which means that many more GPIOs and interfaces are available as compared to the Raspberry Pi), and designing the module into a custom system should be relatively straightforward as we’ve put all the tricky bits onto the module itself.

The compute module is available for purchase in single units, or in batches of hundreds or thousands. To get started designing a PCB to use the module, we provide an open-source breakout board with a single module in an affordable development kit.

 

上的『立體視覺』︰

Real-time depth perception with the Compute Module

Liz: We’ve got a number of good friends at Argon Design, a tech consultancy in Cambridge. (James Adams, our Director of Hardware, used to work there; as did my friend from the time of Noah, @eyebrowsofpower; the disgustingly clever Peter de Rivaz, who wrote Penguins Puzzle, is an Argon employee; and Steve Barlow, who heads Argon up, used to run AlphaMosaic, which became Broadcom’s Cambridge arm, and employed several of the people who work at Pi Towers back in the day.)

We gave the Argon team a Compute Module to play with this summer, and they set David Barker, one of their interns, to work with it. Here’s what he came up with: thanks David, and thanks Argon!

This summer I spent 11 weeks interning at a local tech company called Argon Design, working with the new Raspberry Pi Compute Module. “Local” in this case means Cambridge, UK, where I am currently studying for a mathematics degree. I found the experience extremely valuable and a lot of fun, and I have learnt a great deal about the hardware side of the Raspberry Pi. And here I would like to share a bit of what I did.

15012793237a

My assignment was to develop an example of real-time video processing on the Raspberry Pi. Argon know a lot about the Pi and its capabilities and are experts in real-time video processing, and we wanted to create something which would demonstrate both. The problem we settled on was depth perception using the two cameras on the Compute Module. The CTO, Steve Barlow, who has a good knowledge of stereo depth algorithms gave me a Python implementation of a suitable one.

15199366805a

The algorithm we used is a variant of one which is widely used in video compression. The basic idea is to divide each frame into small blocks and to find the best match with blocks from other frames – this tells us how far the block has moved between the two images. The video version is designed to detect motion, so it tries to match against the previous few frames. Meanwhile, the depth perception version tries to match the left and right camera images against each other, allowing it to measure the parallax between the two images.

 

所以閱讀了

B+ ADD-ON BOARDS AND HATs

NOTE All references to GPIO numbers within this document are referring to the BCM2835 GPIOs (NOT pin numbers on the Pi GPIO header).

Introduction

The Raspberry Pi B+ has been designed specifically with add-on boards in mind. For B+ we are introducing ‘HATs’ (Hardware Attached on Top). A HAT is an add-on board for B+ that conforms to the HAT specifications. HATs are not backward compatible with models A and B.

There are obviously a lot of add-on boards designed for the original model A and B boards (which interface to the original 26 way GPIO header). The first 26 pins of the B+ GPIO header are identical to those of the original models, so most existing boards will still work.

As well as now being a 40W GPIO header (originals on B and A are 26W) the biggest change with B+ add-on boards versus older boards designed for models A and B is that the B+’s header has 2 special pins (ID_SC and ID_SD) that are reserved exclusively for attaching an ‘ID EEPROM’. The ID EEPROM contains data that identifies the board, tells the B+ how the GPIOs need to be set up and what hardware is on the board. This allows the add-on board to be automatically identified and set up by the Pi software at boot time including loading all the necessary drivers.

While we cannot force anyone to follow our minimum requirements or HAT specification, doing so will make users lives easier, safer, and will make us more likely to recommend a product. Likewise if one of the minimum requirements is ignored we are unlikely to look on a product very favourably.

So why are we bothering with all this? Basically we want to ensure consistency and compatibility with future add-on boards, and to allow a much better end-user experience, especially for the less technically aware users.

Finally if you have any questions please head over to the forums to ask them.

New add-on boards basic requirements

If you are designing a new add-on board that takes advantage of the pins on the B+ GPIO header other than the original 26 then you must follow the basic requirements:

  1. The ID_SC and ID_SD pins must only be used for attaching a compatible ID EEPROM. Do not use ID_SC and ID_SD pins for anything except connecting an ID EEPROM, if unused these pins must be left unconnected
  2. If back-powering via the 5V GPIO header pins you must make sure that it is safe to do so even if the Pi 5V supply is also connected. Adding an ideal ‘safety’ diode identical to the one on B+ as per the relevant section of the design guide is the recommended way to do this.
  3. The board must protect against old firmware accidentally driving GPIO6,14,16 at boot time if any of those pins are also driven by the board itself.

Note that for new designs that only use the original 26 way GPIO header pins it is still recommended to follow requirement 2. if the board supports back-powering a Pi.

B+ HAT requirements

A board can only be called a HAT if:

  1. It conforms to the basic add-on board requirements
  2. It has a valid ID EEPROM (including vendor info, GPIO map and valid device tree information).
  3. It has a full size 40W GPIO connector.
  4. It follows the HAT mechanical specification
  5. It uses a GPIO connector that spaces the HAT between 10mm and 12mm from the Pi (i.e. uses spacers between 10mm and 12mm).
  6. If back powering via the GPIO connector the HAT must be able to supply a minimum of 1.3A continuously to the Pi (but ability to supply 2A continuously recommended).

Of course users are free to put an ID EEPROM on boards that don’t otherwise conform to the remainder of the specifications – in fact we strongly encourage this; we just want things called HATs to be a known and well-specified entity to make life easier for customers, particularly the less technical ones.

Design Resources

Before designing any new add-on board (HAT compliant or not) please read the design guide carefully.

For what to flash into the ID EEPROM see the ID EEPROM data format spec.

There are tools and documentation on how to flash ID EEPROMs here.

 

自然也知道

Preliminary B+ HAT (Hardware Attached on Top) docs/specs

by James Adams » Mon Jul 21, 2014 11:00 am

Preliminary docs are here on Github: https://github.com/raspberrypi/hats

The docs are still changing. We want to lock down the spec by the end of the week. Sensible comments welcome :)

Note we are now working on the software to create and flash the HAT EEPROM, hopefully complete by the end of the week also.

[EDIT – update subject to be more descriptive]

……

by hifiberry » Sat Oct 04, 2014 7:44 pm

Any news on the Kernel development for HAT support? Auto-loading the right kernel modules would really help users and this should be possible with the data from the HAT EEPROM.

Best regards
Daniel

……

by joabakk » Mon Jan 19, 2015 10:41 am
So if I understand this thread correctly, we can design the hats and program the eeproms, but there is no way of using the eeprom info in shell or scripts?
Excellent work so far, but I am eager to start testing. Does anyone have a timeline for when the next/final step will come?

……

by ShiftPlusOne » Mon Jan 19, 2015 11:04 am

Device tree data can be accessed through /proc. I don’t know if there’s currently a way to read the vendor data and the other atoms, but there should be eventually.

Things are a bit busy with Astro-Pi and all that, so I think pulling a timeline out of nowhere would just disappoint people.

───

 

議論紛紛的觀點。祇不過是奇怪天下真有『一勞永逸』之事耶??假使只能 Case by Case 豈非玩家的『天堂』乎!!

 

 

 

 

 

 

 

 

 

 

 

樹莓派 HATs ︰ 40W GPIO

在《Physical computing ︰《一》引言》系列文本中,談了樹莓派之 GPIO 的點點滴滴。怎知現今 B+ 的 40W GPIO 彷彿是 □□派的標準的呢?然而兩年已過去,那頂○○帽子 HATs 到底是什麼??

Introducing Raspberry Pi HATs

Just over two weeks ago, we announced the new Raspberry Pi B+ with immediate availability. We’ve been very pleased at the response from the community and press about the B+, and most people seem to appreciate why we decided to evolve the Model B in the way we did – lots of you have been in touch to tell us how much you’re enjoying your new B+.

There are many great new features built into the B+, but today we want to talk about one new feature we are particularly excited about.

One of the brilliant things about the Raspberry Pi has always been the ability to attach physical hardware to the Raspberry Pi’s GPIO (General Purpose Input/Output) connector. There are so many third party add-on boards that attach to the Raspberry Pi and extend its functionality: motor controllers, LEDs, buttons, sensors, microcontrollers, LCDs, ADCs and DACs; you name it, someone has almost certainly created an add-on board that makes it usable with the Raspberry Pi.

PiB-Bplus-GPIO

Model B’s 26W vs Model B+’s 40W GPIO connectors

On the Raspberry Pi models A and B, the GPIO connector has 26 pins. Users attaching an add-board to the model A or B Pi usually have to work out which drivers are required for their specific board, and then edit the relevant Linux files to make them load at boot time before the board is usable (or load them by hand from the command line). The Raspberry Pi has no knowledge of whether it has a board attached or not, and the various drivers, when loaded, will simply assume that they can make exclusive use of the GPIO interface. Most of the time this all works OK, but it can be a bit challenging for new users. Linux drivers blindly assuming GPIO pins are available can also occasionally cause confusion.

The Raspberry Pi B+ has been designed specifically with add-on boards in mind and today we are introducing ‘HATs’ (Hardware Attached on Top). A HAT is an add-on board for B+ that conforms to a specific set of rules that will make life easier for users. A significant feature of HATs is the inclusion of a system that allows the B+ to identify a connected HAT and automatically configure the GPIOs and drivers for the board, making life for the end user much easier!

Before we go any further, it is worth noting that there are obviously a lot of add-on boards designed for the original model A and B boards (which interface to the original 26 way GPIO header). The first 26 pins of the B+ GPIO header are identical to those of the original models, so most existing boards will still work. We are not breaking compatibility for existing boards; we’re creating a specification that B+ add-on board designers can follow (if they so wish), which is designed to make end users’ lives much easier.

So what is a HAT?

HAT-Pi-Flexis

B+ sporting a (mechanical sample of a) HAT and showing camera and display connections

In a nutshell a HAT is a rectangular board (65x56mm) that has four mounting holes in the (nicely rounded) corners that align with the mounting holes on the B+, has a 40W GPIO header and supports the special autoconfiguration system that allows automatic GPIO setup and driver setup. The automatic configuration is achieved using 2 dedicated pins (ID_SD and ID_SC) on the 40W B+ GPIO header that are reserved for an I2C EEPROM. The EEPROM holds the board manufacturer information, GPIO setup and a thing called a ‘device tree‘ fragment – basically a description of the attached hardware that allows Linux to automatically load the required drivers.

What we are not doing with HATs is forcing people to adopt our specification. But you can only call something a HAT if it follows the spec.

 

依舊迷迷濛濛!那個 ID EEPROM 如何使用,更是撲朔神秘!!這引起了作者的好奇,決定一訪其境也。

 

 

 

 

 

 

 

 

 

 

 

Phonon Republic ︰【聲子共和國】的超級對撞機

如果說人們建造大型強子對撞機

Large Hadron Collider

The Large Hadron Collider (LHC) is the world’s largest and most powerful particle collider, the largest, most complex experimental facility ever built, and the largest single machine in the world.[1] It was built by the European Organization for Nuclear Research (CERN) between 1998 and 2008 in collaboration with over 10,000 scientists and engineers from over 100 countries, as well as hundreds of universities and laboratories.[2] It lies in a tunnel 27 kilometres (17 mi) in circumference, as deep as 175 metres (574 ft) beneath the France–Switzerland border near Geneva, Switzerland. Its first research run took place from 30 March 2010 to 13 February 2013 at an initial energy of 3.5 teraelectronvolts (TeV) per beam (7 TeV total), almost 4 times more than the previous world record for a collider,[3] rising to 4 TeV per beam (8 TeV total) from 2012.[4][5] On 13 February 2013 the LHC’s first run officially ended, and it was shut down for planned upgrades. ‘Test’ collisions restarted in the upgraded collider on 5 April 2015,[6][7] reaching 6.5 TeV per beam on 20 May 2015 (13 TeV total, the current world record). Its second research run commenced on schedule, on 3 June 2015.[8]

The LHC’s aim is to allow physicists to test the predictions of different theories of particle physics, high-energy physics and in particular, to further test the properties of the Higgs boson[9] and the large family of new particles predicted by supersymmetric theories,[10] and other unsolved questions of physics, advancing human understanding of physical laws. It contains seven detectors, each designed for certain kinds of research. The proton-proton collision is the primary operation method, but the LHC has also collided protons with lead nuclei for two months in 2013 and used lead–lead collisions for about one month each in 2010, 2011, 2013 and 2015 for other investigations.

The LHC’s computing grid is a world record holder. Data from collisions was produced at an unprecedented rate for the time of first collisions, tens of petabytes per year, a major challenge at the time, to be analysed by a grid-based computer network infrastructure connecting 140 computing centres in 35 countries[11][12] – by 2012 the Worldwide LHC Computing Grid was also the world’s largest distributed computing grid, comprising over 170 computing facilities in a worldwide network across 36 countries.[13][14][15]

large_hadron_collider_dipole_magnets_img_0955

A section of the LHC

 

是為了探索宇宙未知的奧秘。

那麼創作超級對撞機

SuperCollider

SuperCollider 是一個最初由 James McCartney 在1996年發布的程式語言和聲音編程環境,主要用於實時聲音合成算法作曲[1][2]

自此之後,它逐步變成一個被科學家與藝術家們共同開發和操作聲音的系統。這個高效和有表現力的動態語言,為聲學算法音樂交互式編程提供了一個框架。[3]

在2002年以GNU通用公共許可協議發布,SuperCollider 是自由軟體。 最新的主發行版(3.6.6)在2013年11月發布。[4]

ixiquarks

Screenshot of SuperCollider running the ixiQuarks GUI tools.

 

之實時聲音合成 scsynth 、程式語言 sclang 和聲音編程環境 scide︰

sc_cube_32x32 SuperCollider

SuperCollider is a platform for audio synthesis and algorithmic composition, used by musicians, artists, and researchers working with sound. It is free and open source software available for Windows, Mac OS X, and Linux.

SuperCollider features three major components:

  • scsynth, a real-time audio server, forms the core of the platform. It features 400+ unit generators (“UGens”) for analysis, synthesis, and processing. Some of the audio techniques it supports include additive synthesis, subtractive, FM, granular, FFT, and physical modelling. You can write your own UGens in C++, and users have already contributed several hundred more to the sc3-plugins repository.
  • sclang, an interpreted programming language, controls scsynth via Open Sound Control. You can use sclang for algorithmic sequencing, connecting your app to external hardware including MIDI controllers, or writing GUIs and visual displays. sclang has a stock of user-contributed extensions called Quarks.
  • scide is an editor for sclang with an integrated help system.

SuperCollider was developed by James McCartney and originally released in 1996. In 2002, he generously released it as free software under the GNU General Public License. It is now maintained and developed by an active and enthusiastic community.

 

是尋找聲子的蹤跡?窮究有聲世界之起源乎!

聲子共和國之理念是音聲共鳴和奏,有聲能與有情水乳交融,宛如一首空靈清麗的詩︰

山居秋暝‧王維

空山新雨後,
天氣晚來秋,
明月松間照,
清泉石上流;
竹喧歸浣女,
蓮動下漁舟,
隨意春芳歇,
王孫自可留。

 

有興趣者可以嘗試

Nick Collins’ Website

SuperCollider tutorial

Also available as a downloadable zip of RTF, HTML and text files:
sctutorial.zip

Shortcuts:
1. Introduction and Overview
2. Sound Synthesis 1: Additive, Subtractive, Modulation
3. Sequencing
4. Interaction 1
5. Sound Synthesis 2: Sample-based, Granular
6. Effects
7. Interaction 2
8. Timing and Psychology of Rhythm
9. Algorithmic Composition
10. Open Sound Control, Server Messaging, Network Music
11. Sound Synthesis 3 – Physical Modelling
12. Sound Analysis
Extra exercises and SC technicalities: from arrays to classes

 

以及

Designing Sound in SuperCollider

This book is an independent project based on Designing Sound by Andy Farnell, all about the principles and techniques needed to design sound effects for real-time synthesis. The original book provides examples in the PureData language – here we have re-created some of the examples using SuperCollider.

The original book includes much more than what you see here – we’re only recreating the examples and not the text! So in a sense this is not a stand-alone book and you’ll get the most out of it if you have the original book with you. But we hope the examples are illustrative in themselves.

Any defects in the code we present should be assumed to be our own mistakes, and no reflection on Andy’s fine book!

 

,體驗將來國度也☆

 

 

 

 

 

 

 

 

 

 

Phonon Republic ︰ midiPi 【美的派】將如何?

Dr Sam Aaron 期許音樂之未來是藝術的編碼

sonicpi-logo

Sonic Pi

The Live Coding Music Synth for Everyone.

Welcome to the future of music.

Simple enough for computing and music lessons.
Powerful enough for professional musicians.
Free to download with a friendly tutorial.

Learn to code creatively by composing or performing music in an incredible range of styles from classical & jazz to EDM.

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

Sonic Pi v2.10.0 is available free for:

 

Created at the University of Cambridge Computer Laboratory
with kind support from the Raspberry Pi Foundation & pi-top.
Sonic Pi is an Open Source Project released under the MIT Licence.

 

一個聽過初音的人,或許見過這個未來

初音未來

初音未來[註 1](日語:初音 ミクはつね ミク Hatsune Miku,中文圈通常簡稱為「初音」)是Crypton Future Media(下略作「Crypton」)以YamahaVOCALOID 2語音合成引擎為基礎,開發販售的虛擬女性歌手軟體,角色主唱系列的第一作、VSTi規格的電子樂器;或此軟體的印象角色(這只是軟體的象徵,不會在實際使用時出現)。2007年8月31日發售,開放價格,官方估計系列軟體實際價格約15,750日圓。原只可用於Microsoft Windows,2008年3月19日隨CrossOver Mac 6.1發表而可用於OS X[3],2014年發布的VOCALOID 3版本的軟體和2016年發布的VOCALOID 4版本的軟體已經原生支援OS X。在GNU/Linux系統上透過修改過的wine也能夠正確執行初音未來[4]。發售後大受歡迎,並出現大量用戶製作的翻唱歌曲、原創曲等。官方表示初音未來擅長由1980年代至最新的流行歌曲。

初音未來除了吸引新一代和從不認識電子音樂的人接觸電子音樂創作,令更多人認識電子音樂製作,亦令約20年前創作熱潮時的老手「回歸」,令電子音樂 創作再度捲起熱潮,另外也刺激到音樂創作以外的繪畫、動畫創作。雖然初音未來並非第一個可以模仿人類歌唱的軟體,但像真度比以往同類軟像高,因而引起的熱 潮帶來業餘音樂製作的革命,促造日本的消費者自組媒體發展。

miku_screenshot

「初音未來」的實際軟體執行截圖。

製作過程、命名

Crypton中負責初音未來企劃的職員有三、四人,實際開發的則為佐佐木涉和另一位兼職員工[12]。形象角色由插畫家KEI以動漫風格設計人物及繪畫,選擇KEI是因Crypton一位職員佐佐木涉喜歡他「十分有透明感的作風」[13],在2007年3或4月開始設計[14],最後發表了共三張插畫,原本計劃其後每月發表新插畫,但出乎意料地,許多用戶自行創作插畫引發一股創作熱潮,每月發表計畫不了了之[15]。由聲優藤田咲提供原聲,選擇的原因是Crypton認為藤田咲的聲音十分配合「未來的偶像」[13]。企畫初期Crypton是想由正職的歌手提供聲音,然而大多數接到洽詢的歌手基於擔心聲音被複製後的用途以及將來的版權相關問題而拒絕,其後才轉向為接觸聲優,但最初進展不太順利,聲優事務所大多不太明白軟體的用途,其後ARTSVISION答應合作[13]。經過考慮近500位聲優(包括動畫配音和旁白)的聲音樣本之後決定起用藤田咲[16]。藤田咲以「清楚而可愛」的印象錄音,錄音時是配合當時播放的音樂唱出一些無意義的片假名,過程分兩天進行,共花費六小時[17],於2007年4月27日之前完成錄音。於6月25日正式公開初音未來的造形[18],當時只有名字「ミク」,於同年7月12日發表其姓氏「初音」[19]。「初音」是指「第一次的聲音(初めての音)」、「出發點」、「最初的VOCALOID2」;「ミク漢字寫作「未來」[20],指「VOCALOID所象徵的將來音樂之可能性」[19]

設定

初音未來的角色設定年齡為16歲、生日8月31日,身高與體重則分別是158cm與42 kg,擅長流行歌曲[5]。擅長的節奏大約在70~245BPM之間(原設定為70~208,但〈初音未來的消失〉節奏高達240,突破原本的208),擅長的音域則在A3~E5之間(原設定為C3~E4[18]。實際軟體的最高極限和最低極限分別是G8和C-2,高過或低過某一定音高後的輸出效果會開始變得不理想,甚至聲音變小)[5]

衣服和機械部分以やまは於1983年發售的DX系列為藍本[20]。左臂「01」的初期設定是一個QR碼[14],衣服的原設計則是水手服,但Crypton覺得不夠好而轉為現在的衣服設計[13]。 人物設計上比2004年的MEIKO優勝[7],在只有基本設定、「不完全」的人物設計下,對創作者而言強求「原設定」並沒有意義,而且初音未來和原聲音的藤田咲的關聯印象不大,創作沒有太大束縛,用戶因此容易對「自己創造的初音未來」產生感情,而產生出大量作品[21][22]

200px-miku_hatsune

初音未來最初的人物形象設計,由KEI繪製

 

直將 Knuth 先生之大作
The Art of Computer Programming

,來個一百八十度大翻轉!

美國著名電腦科學家,史丹福大學電腦系榮譽退休教授,

192px-knuthatopencontentalliance

唐納德‧爾文‧克努斯Donald Ervin Knuth 是現代電腦科學界的先驅 ,他開創了『演算法分析』的領域,並在多個理論計算機學科的分支打下了基石做出了貢獻,且於電腦科學及數學領域發表了許多重要影響的論文和書籍。克努斯是《電腦程式設計藝術》 The Art of Computer Programming 的作者,從出版以來,此書一直是計算機科學領域中必備的參考書籍之一。

artofcomputerprogramming

他也是『排版軟體TeX 與『字型設計系統Metafont 的創造者,同時是『文學編程』 Literate programming 概念的提出者。克努斯是一九七四年『圖靈獎』的得主,一九八八年時,他與 AT&T Ronald L. Graham 和 史丹福大學教授 Oren Patashnik 合著了一本『具體數學』 Concrete Mahematics 的書,這本書是許多資訊科系廣泛使用的數學教科書。

── 摘自《【Sonic π】電路學之補充《四》無窮小算術‧中下中‧上

 

都已 Coding Music 的了,焉能不見 BUS 往來交響呢?故知終將創生美的派矣。

MIDI

MIDI (/ˈmɪdi/; short for Musical Instrument Digital Interface) is a technical standard that describes a protocol, digital interface and connectors and allows a wide variety of electronic musical instruments, computers and other related devices to connect and communicate with one another.[1] A single MIDI link can carry up to sixteen channels of information, each of which can be routed to a separate device.

MIDI carries event messages that specify notation, pitch and velocity, control signals for parameters such as volume, vibrato, audio panning, cues, and clock signals that set and synchronize tempo between multiple devices. These messages are sent via a MIDI cable to other devices where they control sound generation and other features. A simple example of a MIDI setup is the use of a MIDI controller such as an electronic musical keyboard to trigger sounds created by a sound module. This MIDI data can also be recorded into a hardware or software device called a sequencer, which can be used to edit the data and to play it back at a later time.[2]:4 Advantages of MIDI include compactness (an entire song can be coded in a few hundred lines, i.e. in a few kilobytes), ease of modification and manipulation and a wide choice of electronic instruments and synthesizer or digitally-sampled sounds.[3]

MIDI technology was standardized in 1983 by a panel of music industry representatives, and is maintained by the MIDI Manufacturers Association (MMA). All official MIDI standards are jointly developed and published by the MMA in Los Angeles, California, US, and for Japan, the MIDI Committee of the Association of Musical Electronics Industry (AMEI) in Tokyo. In 2016, the MMA established The MIDI Association (TMA) to nurture an inclusive global community of people who work, play, or create with MIDI, establishing the www.MIDI.org website as the central repository of information about anything related to MIDI technology, from early MIDI technology to future developments.[4]