Life Tips & Miscellaneous Travel and History Sports and Arts Zen and Life Tips Mathematics and Machine Learning Clojure Java Books, TV, Movies and Music Navigation of this blog
Math, Music and Computers
I believe that mathematics abstracts the laws and patterns of the world and gives them form. The fact that mathematics occupies an important position in machine learning and artificial intelligence is not only due to its function in line with the computational function of computers, but also because of its function in abstracting laws and patterns. Furthermore, mathematics is a field that requires “free thinking” and “the ability to feel” in order to find patterns and laws by devising various viewpoints and ideas. From this perspective, “music,” which uses various intuitions and ideas to create patterns that move people’s hearts, can be considered to have something in common with mathematics.
As I mentioned in “Generative Art, Programs, and Algorithms,” mathematics is also strongly involved in the formulation of scientific theories such as complex systems and information theory, as well as natural scientific systems.
The other day, I read a book titled “Life-Changing ‘Mathematics’ and ‘Music’: The Subtle Relationship Not Found in Textbooks,” in which the author, a jazz pianist, describes the similarities between mathematics and music in terms of “free thinking” and “the power of feeling,” and describes this relationship in an interesting way.
The content of the book is as follows.
Mathematics and Music Change Your Life
Prologue
Chapter 1: Are Mathematics and Music Similar?
Math and music are both exciting worlds.
Everyone is a brilliant mathematician and musician.
Math and music are important to each other
Are We in a Second Renaissance? An era of chaos and integration
The key to discovery and creation is the power of feeling
Chapter 2: Let's use our associative power
Don't get caught up in superficial faces, compare the two
Numbers are a game of association
A side trip episode: Finding the "problem" in the amiidakuji lottery
Prime Numbers and Atoms, Seeds of Sound are Trigonometric Functions?
What if everything is made of a rubber membrane that can expand and contract at will?
Column The "promise" of the number of figures (topology)
Chapter 3 Imagination Transcending Dimensions with the Mind's Eye
Imagine the invisible world
Ascending to a higher dimension
Looking into the 4th dimension
A side trip episode Japanese culture and imagination
Chapter 4: Breaking Free from Preconceptions
Numbers are "indivisible
Be free from assumptions! Thinking about Crooked Geometry
Column Is the [99%] System Really High?
Various Paradoxes, Is Mathematics Really Correct?
Is there a middle ground between "correct" and "incorrect"?
Galois and Manojan, heretics of the revolution
Chapter 5: The Mysteries of Nature Mathematics, Music, and Still More Nature is Amazing
Nature knows the answers to unsolved problems
Math is rough, nature is complex
Fractal drawings are efficient
Chapter 6: Let's actually create your own mathematics
Approaching Escher.
Create problems, make predictions
Create new "distances
Create a new "addition
Column If there were only three possible outcomes in the world
Music from mathematics
Chapter 7 Playing and Inventing with Music
The amusing aspect of participating in music, the improvisational nature of "feeling" the scene
Drawing pictures from sounds and chords
Inventing new rhythms, Part 1
Inventing New Rhythms, Part 2
Takehiro Honda's "Jazz and 3", a side trip episode
Making musical instruments
Side Trip Episode Mathematics Hidden in Familiar "Senses
Chapter 8 Music is Freedom
Music and Imagination
The relation of V degree (5 degrees)
A side trip episode Pentatonic scale
Countless "overtones" hidden within a single note
Various Do Re Mi Faso Racido
Except between notes Blues between mi and mi b
Music is freedom
Chapter 9 The Present Age and the Power of Feeling
The 21st Century and the Power of Feeling
Mathematics, which is secretly hidden in various scenes of daily life
The age of synthesis that transcends various barriers
The profoundness of the encounter between human beings
The warmth of human "life" that opens the door to completion
Epilogue
Easy Escher Experience Parts" with the attached photocopy
Reading these things made me want to touch music software, so I touched supercollider, an open-source acoustic programming language.
The Japanese document “A Gentle Introduction to SuperCollider” is a Japanese translation of “A Gentle Introduction to SuperCollider” translated by “Neko to Hondana” (Japanese only).
To use SuperCollider, download the appropriate application for your OS from the official download page. When you launch the downloaded application, a window divided in two appears as shown below.
The left side is the zone for writing code, and the right side is the Post window and Help browser (use the tabs at the bottom to switch). First, open a new document in the left zone as HelloWorld (menu File→New) and enter the following line.
"Hello World".postln;
When you have finished typing, place the cursor anywhere on the line (start, middle, or end) and press “ctrl + enter” (on a mac, “command + enter”) to evaluate the code. Hello World” is output.
Next, start the server to output sound. To do so, select “Server” from the menu at the top, and then select “Boot Server” from the selection menu. If the server is successfully launched, the server will be launched on the local 57110 port and the following message will be seen in post windows:” Booting server ‘localhost’ on address 127.0.0.1:57110″
To actually produce sound, enter the following code and evaluate the code.
{SinOsc.ar}.play;
If it works well, you will hear a continuous beep (a simple sine wave). To turn off the sound, press “ctrl + . (on mac, “command + .”) to mute the sound.
For a more complex synthesizer-like sound, you can enter the following code and evaluate it.
{SinOsc.ar(LFNoise0.kr(10).range(500, 1500), mul: 0.1)}.play;
To build more complex sounds, please refer to “A Gentle Introduction to SuperCollider.
The language used in supercollider (sclang) is simple and easy to use, but wrappers in various languages are available for those who prefer to use their own familiar language. In this article, we will discuss overtone using Clojure. (If you want to handle it in pyhton, FoxDot is a well-known one. Please refer to the article in Japanese.)
As for setting up a clojure environment, please refer to “Setting up a Clojure development environment with SublimeText4 and VS code“. First, create a project in a terminal under an arbitrary directory with the file “lein new overtone-test (arbitrary file name)”.
Next, add the overtone library to the project.clj file in the created project as follows
(defproject overtone-test "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.11.1"]
[overtone "0.10.6"]]←追加
:repl-options {:init-ns overtone-test.core})
To connect from overtone to supercollider, two modes can be selected: internal-server mode (no need to install supercollider) or external-server mode, but the internal-server mode did not work well. However, since the internal-server mode did not work properly, I downloaded supercollider, booted the server as described above, and used the method of connecting with port 57110 of localhost.
If the supercollider server is booted, it can be stopped with a sound by evaluating the clojure code.
(ns overtone-test.core)
(use 'overtone.core) ← Read library
(boot-external-server) ← Connect with supercollider
(definst foo [] (saw 220))← Beep tone setting
(foo) ←Sound on
(kill 34) ←Sound off
For detailed usage, please refer to Getting-started, cheat-sheet, and examples. Live coding using overtone is actually being done around the world, and Algorave, which combines overtone with video, is also being enjoyed.
Art has also been created that combines graphics as described in “Implementation with Clojure’s graphical tools seesaw and quill“.
コメント