T
T
TimeCoder2015-02-14 14:55:54
Audio
TimeCoder, 2015-02-14 14:55:54

Who can explain music theory in programming language?

I would be grateful for help in understanding the basics of music theory, expressed in technical language. I read, key words: mode, octaves, tonality, etc. Previously, I had a simple picture in my head: each note has its own frequency, the step between them is the same (N hertz), after Mi and Si step N / 2 (there is no black key between them). The note "C" of the next octave has a frequency 2 times higher than the note "C" of the current one. Seven notes form an octave, and there are 8 such octaves, together they cover a certain frequency range. Knowing the frequency of the "Do" note of the first octave, you can calculate the frequencies for all other notes.
After reading the theory, I only got more confused. It is suspicious that the values ​​of the frequencies are not mentioned anywhere, and it is said that there are different systems of modes. One gets the impression that notes do not have fixed frequencies at all, that the same frequency can correspond to different notes in different modes (or keys, I'm not sure about the terminology here).

Answer the question

In order to leave comments, you need to log in

6 answer(s)
J
jcmvbkbc, 2015-02-14
@jcmvbkbc

each note has its own frequency

Yes.
no. In an equal tempered scale, 12 semitones divide one octave so that the ratio of the frequencies of two adjacent notes spaced 1 semitone apart is constant. Those. F(C#) = F(C) * k, F(D) = F(C#) * k = F(C) * k ^ 2, ... F(C') = F(H) * k = F (C) * k ^ 12. Since the frequency of notes separated by an octave differs by a factor of two, k = pow(2, 1./12).
yes, like any other note in two neighboring octaves.
Yes. Knowing the frequency of any note, you can calculate the frequencies of all other notes.
The exact values ​​of the frequencies are usually of no interest to anyone. From a practical point of view, the intervals between them are interesting.
Read here: https://ru.wikipedia.org/wiki/Equal_Temperature... here https://ru.wikipedia.org/wiki/Natural_Build and follow the links.

A
Armenian Radio, 2015-02-14
@gbg

Here is the frequency table. Please note that the dependence is non-linear: Everything is built relative to the standard frequency - notes LA I octave - 440Hz.

D
Dum_spiro_spero, 2015-02-14
@Dum_spiro_spero

Everything is simple. The point is, it's all relative.
Let some frequency sound. Let's double it - the resulting interval will sound quite so harmonious - it's called an "octave". And let it be 100 and 200 Hz, or 1000 and 2000 - all the same, the feeling from the interval will be the same. Now let's break this interval inside - so that different intervals sound the same relative to different frequencies - and EQUAL TEMPERATION helps here. If the interval is divided by segments that differ in frequency to the root of the 12th degree of two, then we will get what we need. In European music, there are actually not 7, but 12 notes - including sharps and flats. BUT! Psychoacoustics is such a thing ... simple intervals sound best - like 2/3, 3/4 (an octave is 1/2) in frequency - and these roots of ours are close to pure intervals - but ... not quite. "Equal Temperament" a relatively recent thing - before him there were different frets - i.e. systems of organizing notes and frequencies - and in different frets one note will correspond to different frequencies.
https://ru.wikipedia.org/wiki/Equal_Temperature...
we start reading from here - well, further about the natural system, etc. ...
The fact that La = 440 Hertz was not always the case either. There were times when La crawled up to 460 Hz. And now everyone has finally agreed.

A
alec_kalinin, 2015-02-14
@alec_kalinin

Below is my understanding of music theory, which does not claim to be accurate and complete.
Sound is vibrations of air with a certain amplitude and frequency. The amplitude is responsible for the loudness of the sound. Frequency is responsible for the pitch (tone) of the sound, roughly speaking for its perception, coloring.
If we take any real sound (for example, string vibrations), then in its spectrum there will be not only one main frequency, but there will be a set of frequencies (harmonics), which are called overtones. The main harmonic is called the fundamental tone, and then there are the 1st harmonic, the 2nd, and so on. Generally, overtone frequencies are related to fundamental frequency as proper fractions. So the first harmonic is twice the frequency of the fundamental, the second harmonic is related as 3/2, and so on.
A very interesting fact follows from this. Sound highx sounds almost the same to a human with a sound of height 2*x because for a sound of height x the 1st harmonic will be just a height of 2*x , i.e. their spectra will be almost the same. And if so, then we can do one interesting trick.
Let's fix the frequency x . The 1st harmonic will be 2*x high . We get the interval [x; 2*x] . This interval is called an octave. Take the 2nd harmonic, it will be related to the fundamental frequency as 3/2 * x . If the resulting pitch is outside the range of our octave [x; 2*x], then we will do the following trick. It will assume that the resulting pitch is actually the 1st harmonic of some other sound that lies within our interval [x; 2*x] . Thus, we get some new tone within our octave. Next, we take the 3rd harmonic of height x and also lower it into our octave [x; 2*x] .
As a result of this process, inside the octave [x; 2*x] you can build 7 tones, which (surprisingly) make up some system (from the point of view of human perception). Those. all these 7 tones have internal gravitations, connections that can be somehow used. So all these 7 tones are called the natural mode, and the connections within the mode are called modal gravity.
At the same time, there are two dimensions inside the fret. Notes within a scale can be played sequentially, one after the other. It's called a melody. But notes within a fret can be played at the same time. At the same time, it turned out that if you play three notes at the same time, built through one step, then you get a system of triads (chords), which in turn also has its own laws, there are all sorts of tonic, subdominant and dominant chords, etc. Plus, if we add rhythm here, then we get all the main components of music: melody, rhythm, harmony.
In reality, natural frets can be built in slightly different ways, each time getting slightly different stable systems. There are many natural frets. The most ancient are all sorts of different pentatonic scales - stable systems of five, not seven notes, etc.
When music became a broad social phenomenon in the Middle Ages, the question of standardization sharply arose. Each musician can use their own natural number, which means that it will no longer be possible to play together with another musician.
The issue of standardization was solved in the following way. We chose one base frequency, let it be A - 440 Hz. After that, the entire range of sounds was divided into octaves, decreasing and increasing the base frequency by half. And each octave was divided into 12 equal parts - notes. With such a partition, it turned out that from each of the 12 notes, it is possible to build a major and minor modes from 7 notes. The major mode is built according to the system: tone-tone-semitone ... etc. (may be wrong), minor: tone-semitone-tone, etc. (I can be wrong). Major and minor modes are good approximations of natural modes, although they do not sound as perfect. But over the years, everyone has become accustomed to this, the standards turned out to be more important, and the person adapted.
Thus, we have 12 notes in an octave and two modes: major and minor. Thus, we get 24 sound systems from 7 notes. Such a system is called tonality. For example, C major, B flat minor, etc. Each tonality will have its own emotional coloring.
As a proof of concept, Bach wrote the Well-Tempered Clavier set of pieces, where he used all the keys.
The theory of music itself studies all the regularities of modes and develops more or less standard patterns of use.

T
TimeCoder, 2015-02-14
@TimeCoder

Good analogy)
In fact, I'm looking for just a high-level understanding of music, there is no goal to be tied to frequencies. And in this high-level description there are questions. That's even

It is important that 12, and they are distributed evenly
big question about uniformity. As I read from the links earlier, in a uniformly tempo scale, the frequency of the notes changes non-linearly (see the colored plate at the beginning), there is a simple formula: f = f0 * 2^(i / 12), where f0 is the frequency of the TO (apparently, " tonic" in your description), I is the semitone number. In natural tuning, judging by the picture, there is an even more uneven distribution of 12 semitones.
if you shift a note in the key, or add a note to it, or remove a note, and so on, you will get a completely different scale (with a different sequence of intervals), but built from the same tonic.
This is perhaps the most important and difficult thing I am trying to understand. What does it mean to shift a note in key? Maybe then I'll understand what "music in the key of B-flat major" means)

D
denizen, 2015-02-16
@denizen

It completely blew my mind.
The full pdf version is easily searched on the net.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question