Live data from Hacker News

Show HN: Teoria.js - Music theory for JavaScript

saebekassebil.github.com

1–10 of 24 posts

Re: Show HN: Teoria.js - Music theory for JavaScript

#6
Neat! I've been reading up and playing around with this stuff the past few weeks, from both the waveform synthesis side and the music theory side. I don't think I've quite wrapped my head around the basic concepts yet. (i.e.: Why have non-chromatic scales that skip semitones? Why do some sets of notes sound good and not others? What parts of sound quality derive from innate psychoacoustics, and what parts are my bias from growing up in the Western world?) I'll definitely be taking a closer look at saebekassebil's Javascript code, which seems to be an attempt to organize these concepts.

It's strange how once you get interested in a topic, you start seeing stuff about it everywhere. First the Clojure-based Overtone project, and now this...

Re: Show HN: Teoria.js - Music theory for JavaScript

#7
post #3

This isn't really what I expected when I saw "music theory". It would be more aptly titled something like "frequency visualizer of chords".

I took a quick look at the Javascript code on saebekassebil's GitHub, and it does seem to be the start of some sort of music theory library. The waveform visualizer demo just doesn't seem to be very revealing of what the library is about.

Re: Show HN: Teoria.js - Music theory for JavaScript

#9
post #6

Neat! I've been reading up and playing around with this stuff the past few weeks, from both the waveform synthesis side and the music theory side. I don't think I've quite wrapped my head around the basic concepts yet. (i.e.: Why have non-chromatic scales that skip semitones? Why do some sets of notes sound good and not others? What parts of sound quality derive from innate psychoacoustics, and what parts are my bias…

As to why some sets of notes sound good or harmonious and others sound "bad" or dissonant, we find that frequencies with the simplest mathematical ratios tend to sound the most harmonious, while frequencies with more complex ratios sound more dissonant.

So for example the simplest ratio 2:1 corresponds to an octave interval. Notes which are an octave apart sound so similar that we describe them with same letter. So concert A is 440Hz and the "A" note one octave higher is 880Hz.

The next simplest ratio, 3:2 corresponds to the interval known as a perfect fifth. So given the example of concert A at 440Hz again, one perfect fifth above concert A is the note E which has a frequency of 660Hz as (440 * 3) / 2 = 660.

We find the simplest ratios of frequency intervals present in music from cultures the world over. The traditional classical Western twelve-note scale consists of the 12 simplest frequency ratios. In some Eastern music we hear a pentatonic or five note scale, which consists of the five simplest frequency ratios.

So this aspect of music we can attribute to innate psycho-acoustics or even physics rather than cultural bias.

Re: Show HN: Teoria.js - Music theory for JavaScript

#10
post #6

Neat! I've been reading up and playing around with this stuff the past few weeks, from both the waveform synthesis side and the music theory side. I don't think I've quite wrapped my head around the basic concepts yet. (i.e.: Why have non-chromatic scales that skip semitones? Why do some sets of notes sound good and not others? What parts of sound quality derive from innate psychoacoustics, and what parts are my bias…

As to why some sets of notes sound good or harmonious and others sound "bad" or dissonant, we find that frequencies with the simplest mathematical ratios tend to sound the most harmonious, while frequencies with more complex ratios sound more dissonant. So for example the simplest ratio 2:1 corresponds to an octave interval. Notes which are an octave apart sound so similar that we describe them with same letter. So c…

> So this aspect of music we can attribute to innate psycho-acoustics or even physics rather than cultural bias.

It's inextricable from cultural bias, though the physics obviously plays some role. The cultural bias comes into play more strongly around the question of how much dissonance is "good" vs. "bad", and how the more dissonant bits should interplay with the more consonant bits of music.

Certainly, "more consonant = better" isn't true in any culture I can think of.... Imagine an orchestra that tunes up, then they all play the note A in various octaves for 3 hours.

Possibly also worth mentioning that this isn't quite correct:

> The traditional classical Western twelve-note scale consists of the 12 simplest frequency ratios

You're thinking of the major scale, maybe? The ratios for a tritone, major 7th, etc. are more complex (and not the first 12 simplest...) and if you try to actually come up with ratios for an even-tempered scale you're really in trouble.

Post reply on HN