Science of Chords

十年热恋 提交于 2019-12-11 03:26:33

问题


I've been doing research on trying to understand the way sounds and sine waves work, particularly with chords. So far, my understanding is as follows:

  1. b(t) = sin(Api(t)) is the base note of the chord at frequency A.
  2. T(t) = sin(5/4piA(t)) is the major third of the base b(t).
  3. D(t) = sin(3/2piA(t)) is the dominant (fifth) of the base b(t).
  4. A(t) = sin(2Api(t)) is the octave.

Each one alone is a separate frequency which is easy for a computer generator to sound. However, the major chord of the note with frequency A is as follows:

Major Chord = b+T+D+A

I was wondering if anyone has a way to make a computer synthesizer play this function so I can hear the result; most programs I have found only take Hz as an input, an while this function has a wavelength, it's different from the simple sine wave with the same wavelength.

Note: will post this in the physics and computer sections as well - just wondering if you musicians know something about this.


回答1:


It's a bit unclear to me what you're trying to do, so I'm explaining a few things, and giving you a few options to investigate further, depending on what your purpose is.

The de facto means of synthesizing music on computers uses MIDI (Musical Instrument Digital Interface). Because musicians rarely think directly in terms of frequencies or wavelengths (they count steps or half-steps along a scale), MIDI represents each pitch with an integer, that represents a number of half-steps. By default, MIDI assumes these pitches are tuned using a standard called "12-Tone Equal Temperament" (12TET), and, unfortunately, it isn't particularly easy to make it use other tunings.

What does this mean? And why is it a problem? (I'm not sure how much of this you know already, so I apologize if I'm repeating what you know)

In theory what you say about tuning being based on frequency ratios is 100% absolutely correct -- this is a system called Just Tuning. The major third is a 5/4 ratio and the perfect fifth is a 3/2 ratio. However instruments with fixed-pitches (keyboards, fretted instruments, etc...) are rarely tuned that way in practice. Instead, they compromise, by rounding each note in a chromatic scale to the nearest 12th of an octave. Since an adding octave is equivalent to multiplying the initial frequency by 2, adding a 12th of an octave is the equivalent of multiplying the initial frequency by 2^(1/12). This is how all the half steps on a piano are usually tuned.

So instead of the pure ratios, you would actually have:

  • sin(A pi t)
  • sin(2^(4/12) A pi t)
  • sin(2^(7/12) A pi t)
  • sin(2^(12/12) A pi t)

Note: Compare 2^(4/12) ~ 1.26, with 5/4 = 1.25. Also compare 2^(7/12) ~ 1.498, with 3/2 = 1.5.

These are exactly the frequencies that any MIDI synthesizer will play, given the MIDI notes numbered n, n+4, n+7, and n+12. So, if you are only looking to play a chord, and don't care about the frequency ratios being pure (just), you can just use MIDI.

However, if you are looking for something that will play the actual just ratios, it will be a bit trickier. You might start with looking at some of the things here: https://music.stackexchange.com/questions/351/software-that-allows-playing-in-different-temperaments

If you just want to see what they sound like, you can check out this youtube video: https://www.youtube.com/watch?v=6NlI4No3s0M

If you can write software, you might try writing your own, but I don't want to go into how to do that if that's not going to be helpful.

I'm not sure what kinds of programs you're describing that "only takes Hz as input". Is this a software library (like an API call?) or something different? There are (obviously) API calls that can send more complex data to the soundcard than a single-frequency wave.


EDIT: I've not used it, but it looks like perhaps this software is capable of doing what you want: https://www.youtube.com/watch?v=z0NZQMiDdNU




回答2:


I think you are going at the problem from a wrong direction. You are using sinoid signals as the basis of your "chords" and pure intervals.

The output of that is strictly periodic, with a period that is the least common multiple of the individual periods. So basically you have not as much a "chord" but rather a "tone".

Organs use that technique: you can combine an 8" pipe with a 5⅓" pipe in order to arrive at a tone sounding like it came from some funny 16" pipe. That's not a "chord", that's registration. Classical composition theory does not allow quint parallels to avoid that effect: quints must only occur transitorily and more often than not moving in a different direction or out of synch with the base note.

"chords" play with aural ambiguities between tone colors and voices: they excite the same region in your inner ear. However, real "chords" and choral effects also have beatings and interferences from non-ideal frequency ratios, and the tones they are made of have harmonics of their own, making it possible to discern them as independent entities.

The experienced music listener perceives all that as an independent phenomenon. However, if you start with pure sinoids or highly frequency-locked comparatively pure sources like snare-less organ pipes, this becomes hard to do.

So I'm not sure you are doing yourself a favor by looking at sinoids. It's like trying to understand a painting based on primary color components. It's more of a reproduction toolkit than anything tied to higher-level perception.




回答3:


A very low-barrier way to play is to use wavepot

The code to do what you ask in your question is

var A = 440
export function dsp(t) {
  var b = Math.sin(t * Math.PI * 2 *       A);
  var T = Math.sin(t * Math.PI * 2 * 5/4 * A);
  var D = Math.sin(t * Math.PI * 2 * 3/2 * A);
  var O = Math.sin(t * Math.PI * 2 * 2   * A);
  return (b + T + D+ O) * 1/4
}

which is at this link.

Note that this might not sound much like a chord to you due to the fact that sine waves have no harmonics. Here is the same example, but using a saw-tooth waveform, which has many harmonics.

var A = 440
//function f(x){return Math.sin(x)   }
function f(x){return 2 * ( (x/(2*Math.PI) % 1) -.5)   } //sawtooth

export function dsp(t) {
  var b = f(t * Math.PI * 2 *       A);
  var T = f(t * Math.PI * 2 * 5/4 * A);
  var D = f(t * Math.PI * 2 * 3/2 * A);
  var O = f(t * Math.PI * 2 * 2   * A);
  return (b + T + D+ O) * 1/4
}


来源:https://stackoverflow.com/questions/26334531/science-of-chords

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!