{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "ee1b27f0-32a1-42b0-be45-bfd6af50d259", "metadata": {}, "source": [ "# 課題\n", "\n", "## ピタゴラス音律がルネッサンス以降に平均律に取って代わられた理由を考える" ] }, { "attachments": {}, "cell_type": "markdown", "id": "df9a8dfc-ed1d-4b6b-aae7-f8bb54ce1fba", "metadata": {}, "source": [ "* [Pythagorean tuning - Wikipedia](https://en.wikipedia.org/wiki/Pythagorean_tuning)\n", " * [How Pythagoras Broke Music (and how we kind of fixed it) [see comments for corrections] - YouTube](https://www.youtube.com/watch?v=EdYzqLgMmgk)\n", " - [Pythagorean comma - Wikipedia](https://en.wikipedia.org/wiki/Pythagorean_comma)\n", " - [Wolf interval - Wikipedia](https://en.wikipedia.org/wiki/Wolf_interval)\n", "* [Equal temperament - Wikipedia](https://en.wikipedia.org/wiki/Equal_temperament)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "7b9e54ba-ee47-4438-80e9-30e7395e181b", "metadata": {}, "source": [ "## FMPの \"Pythagorean Tuning\" を参照する\n", "\n", "* [C1E10: Pythagorean Tuning](https://www.audiolabs-erlangen.de/resources/MIR/FMP/C1/C1E10_PythagoreanTuning.html)" ] }, { "cell_type": "code", "execution_count": 1, "id": "b95c5091-8950-4b66-932f-65d089e2241a", "metadata": { "tags": [] }, "outputs": [], "source": [ "import numpy as np\n", "import IPython.display as ipd\n", "import matplotlib.pyplot as plt\n", "import libfmp.c1\n", "import librosa" ] }, { "cell_type": "code", "execution_count": 2, "id": "6b8a9709-fb3b-4e8d-b0f8-2b2278918b2f", "metadata": { "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "from collections import OrderedDict\n", "\n", "# Computation of frequencies and differences\n", "pyt_frac = ['1:1', '$2^8:3^5$', '$3^2:2^3$', '$2^5:3^3$', '$3^4:2^6$', '$2^2:3$', '$3^6:2^9$', \n", " '$3:2$', '$2^7:3^4$', '$3^3:2^4$', '$2^4:3^2$', '$3^5:2^7$', '$2:1$']\n", "pyt_ratio = np.asarray([1, 256/243, 9/8, 32/27, 81/64, 4/3, 729/512, 3/2, 128/81, 27/16, 16/9, 243/128, 2])\n", "p = 60\n", "freq = libfmp.c1.f_pitch(p)\n", "freq_pyt = pyt_ratio * freq\n", "notes = np.asarray(range(p, p + 13))\n", "freq_center = libfmp.c1.f_pitch(notes)\n", "freq_deviation_cents = libfmp.c1.difference_cents(freq_pyt, freq_center)\n", "\n", "# Generation of sinusoids\n", "dur = 4 # seconds\n", "Fs = 4000 # sampling rate\n", "\n", "sinusoid_freq_center = []\n", "for freq in freq_center:\n", " x, t = libfmp.c1.generate_sinusoid(dur=dur, Fs=Fs, freq=freq)\n", " sinusoid_freq_center.append(x)\n", "\n", "sinusoid_freq_pyt = []\n", "for freq in freq_pyt:\n", " x, t = libfmp.c1.generate_sinusoid(dur=dur, Fs=Fs, freq=freq)\n", " sinusoid_freq_pyt.append(x)" ] }, { "cell_type": "code", "execution_count": 3, "id": "b7bba224-aac3-4561-a770-2210933e5ad9", "metadata": { "tags": [] }, "outputs": [], "source": [ "# Generation of sinusoids\n", "dur = 4 #seconds\n", "Fs = 4000 #sampling rate" ] }, { "cell_type": "code", "execution_count": 4, "id": "13b63b93-450b-4fbc-8bf1-87081482c8db", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", " | Note | \n", "ET Freq. (Hz) | \n", "ET Sinusoid | \n", "Pyt. Ratio | \n", "Pyt. Freq. (Hz) | \n", "Pyt. Sinusoid | \n", "Difference (Cents) | \n", "
---|---|---|---|---|---|---|---|
1 | \n", "C4 | \n", "261.63 | \n", "\n", " | 1:1 | \n", "261.63 | \n", "\n", " | 0.00 | \n", "
2 | \n", "C$^\\sharp$4 | \n", "277.18 | \n", "\n", " | $2^8:3^5$ | \n", "275.62 | \n", "\n", " | -9.78 | \n", "
3 | \n", "D4 | \n", "293.66 | \n", "\n", " | $3^2:2^3$ | \n", "294.33 | \n", "\n", " | 3.91 | \n", "
4 | \n", "D$^\\sharp$4 | \n", "311.13 | \n", "\n", " | $2^5:3^3$ | \n", "310.07 | \n", "\n", " | -5.87 | \n", "
5 | \n", "E4 | \n", "329.63 | \n", "\n", " | $3^4:2^6$ | \n", "331.12 | \n", "\n", " | 7.82 | \n", "
6 | \n", "F4 | \n", "349.23 | \n", "\n", " | $2^2:3$ | \n", "348.83 | \n", "\n", " | -1.96 | \n", "
7 | \n", "F$^\\sharp$4 | \n", "369.99 | \n", "\n", " | $3^6:2^9$ | \n", "372.51 | \n", "\n", " | 11.73 | \n", "
8 | \n", "G4 | \n", "392.00 | \n", "\n", " | $3:2$ | \n", "392.44 | \n", "\n", " | 1.96 | \n", "
9 | \n", "G$^\\sharp$4 | \n", "415.30 | \n", "\n", " | $2^7:3^4$ | \n", "413.43 | \n", "\n", " | -7.82 | \n", "
10 | \n", "A4 | \n", "440.00 | \n", "\n", " | $3^3:2^4$ | \n", "441.49 | \n", "\n", " | 5.87 | \n", "
11 | \n", "A$^\\sharp$4 | \n", "466.16 | \n", "\n", " | $2^4:3^2$ | \n", "465.11 | \n", "\n", " | -3.91 | \n", "
12 | \n", "B4 | \n", "493.88 | \n", "\n", " | $3^5:2^7$ | \n", "496.68 | \n", "\n", " | 9.78 | \n", "
13 | \n", "C4 | \n", "523.25 | \n", "\n", " | $2:1$ | \n", "523.25 | \n", "\n", " | 0.00 | \n", "