OpenMPT tunings (was: OpenMPT suggestion: well temperament)

Started by furrykef, September 04, 2006, 14:44:14

Previous topic - Next topic

furrykef

This is a suggestion that I'm sure there isn't a great demand for, but I'm hoping to change that. :) Anyway, to explain this properly, we're going to have to discuss a little bit about music history and physics (don't worry, I'll try to make it painless).

Modern music, including every tracker that I know of, generally uses a system called "equal temperament". In equal temperament, the octave is divided into twelve equal semitones. They are "equal" in the sense that the ratio of the frequency from one semitone to the next is always the same. In other words, the same interval always sounds the same. C-G (a perfect fifth) and D-A (another perfect fifth) sound exactly the same, except the latter is a little higher in pitch.

Now here's the part that may seem shocking: equal temperament is actually a little out of tune! The ear actually prefers an uneven scale. This is all complicated to explain, especially in a short forum post. In short, the system the ear prefers is called "just intonation", described here and here (for example). So why don't we use it? Because it's a pain in the butt! You'd have to retune every time you want to use certain chords (like a D chord on a system tuned for C major), because the particular unevenness of the just intonation scale means that, while some chords are more in tune, some others are too out of tune. I do intend to figure out a good way to support just intonation in trackers someday, but it'd certainly be too radical for OpenMPT.

By the way, I actually made a little clip using OpenMPT to compare equal temperament to just intonation: http://en.wikipedia.org/wiki/Image:Just_vs_equal.ogg - here you can hear for yourself how there's a difference. (As for how I got just intonation from OpenMPT... I manually edited the sample playback rate of the piano sample to produce the different notes! Pretty ugly trick.) I think the just intonation chord rings more clearly than the equal temperament chord does. It's a small and subtle difference, but I wouldn't underestimate one's ability to subconsciously notice such things.

But, as I said, implementing just intonation in a useful way for MPT would not be practical due to the way you have to retune. So, instead, I'm going to advocate another system called well temperament. This was the result of attempts to produce equal temperament in the Baroque and Classical periods. When Bach wrote The Well-Tempered Clavier, this was the system he was using. Well temperament is somewhat in between just intonation and equal temperament: all the keys and chords are usable, but they no longer all sound the same! D major no longer sounds exactly like C major only transposed up a notch; the chord has a different character. Some will sound pure and placid, as in just intonation; others will sound slightly out of tune and have a brighter quality. This is why I'm recommending an implementation of well temperament: so that modern trackers can exploit the differences in different chords and keys the same way Bach did!

The implementation ought to be pretty straightforward: in the song properties, the user may set a "well temperament" flag. There might also be another option to choose which key (A through G#) to use as the "base" for the tuning, which dictates which keys have which character. When this flag is set, the program simply uses a different algorithm to convert each note into a pitch. That's all there is to it.

This source has more about historical tunings such as well temperament, including how the scale corresponds to the modern scale in cents (which can be used to derive the algorithm). I'd recommend the Werckmeister III version of well temperament on the grounds that it'd probably produce the most interesting results.

Of course, I don't expect this suggestion to be embraced immediately, coming out of the blue like this. I expect it'll be first met with puzzlement and perhaps resistance: "What are you talking about?" "If this is a good idea, why aren't we doing it already?" "Our tuning sounds fine and the average listener wouldn't ever notice." So I expect I'll probably have to just program it myself and then we'll see whether it is indeed a good idea or not. :) I did want to see what the community thinks of the suggestion, though.

- Kef

SoundCrafter

Yay! A legitmate music topic that I actually know!

It's a great idea, the only reason i think you'll come across any resistance is:

Modplug was meant (I believe) mainly for the production of electronic/a music.  That being said, in electronica, if we want a pitch change, we put it in their ourselves.   (I use 'electronica' as a general term for any type of electronic music, from dance, trance, to dnb) In electronica, we (or at least I) prefer an equal scale, because the notes are always in tune.

However, if I were to record a piece with a piano, and I'm sure I will, i would absolutely use it in trying to achieve the best sound possible.
---Formerly known as ---DjBj---. changed names for lots of reasons.
BooT-SectoR-ViruZ is the new Skaven and the whole world'z goin' to Hell.
Lowpass filter! Perform a generic type of dodge!!! :lol:
Everyone should get on this forum's chatroom RIGHT NOW...still not sure why, though.

furrykef

Nice to see that the first response is something other than "WTF?" :)

I admit I don't really have any idea how many OpenMPT users would be interested in well temperament (after being educated on the matter, of course). You're right, it's probably not well suited to electronica music in general. But, of course, if you don't want it, you don't have to use it. :)

- Kef

LPChip

SoundCrafter, I actually disagree on your statement that OpenMPT was designed to make dance/electo music with it. It mainly is being done alot because that's today's standard so to say.

We've already tried adding some options to humanise the sound. For example: you can have randomised volume parameters, randomised filter settings (to get that once in a while mis with a snare) and I've even suggested making it possible to random a delay to the note.

Its a good suggestion though. I hope to see something like this implemented. It will be optional ofcource.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Relabsoluness

Wow, this is nice to see, for only a few weeks ago a new development branch(~a 'development line' including bit bigger modifications) for OMPT was created in sourceforge, and that branch includes a more or less working tuning system that has been tried to create with a open mind in the sense that it hopefully can be used to create more or less anykind of tuning one wishes to have. Currently tuning modes are instrument specific, i.e. every instrument can have its own tuning mode.

EDIT: Removed broken image link.

Any comments, questions and suggestions concerning this are welcome. It might be worth noticing that I have little theoretical knowledge of tuning theory, so I might have used unconventional or bad concepts and practices in the implementation, or maybe even have something totally wrong in the basics; please rectify if so. This feature is not available in the latest beta build(.45).

speed-goddamn-focus

Quote from: "Relabsoluness"Screenshot: Created just intonation tuning. All available ratios are definable one by one(so, no need to have 12 steps after which ratio doubles etc.). Note that this is a draft version..
If I understand things correctly, which rarely happens btw, it's not *really* just temperament as that depends on the scale, i.e. C# isn't equal to Db.

Relabsoluness

Quote from: "speed-goddamn-focus"
Quote from: "Relabsoluness"Screenshot: Created just intonation tuning. All available ratios are definable one by one(so, no need to have 12 steps after which ratio doubles etc.). Note that this is a draft version..
If I understand things correctly, which rarely happens btw, it's not *really* just temperament as that depends on the scale, i.e. C# isn't equal to Db.
I must admit that I don't understand that :) Especially the "C# isn't equal to Db" part. But as said, my knowledge of these things is weak indeed.

Snu

Quote from: "Relabsoluness"Wow, this is nice to see, for only a few weeks ago a new development branch(~a 'development line' including bit bigger modifications) for OMPT was created in sourceforge, and that branch includes a more or less working tuning system that has been tried to create with a open mind in the sense that it hopefully can be used to create more or less anykind of tuning one wishes to have. Currently tuning modes are instrument specific, i.e. every instrument can have its own tuning mode.
:o!
i cant wait until its implemented!

Sam_Zen

2 Relabsoluness
These tuning properties look very promising !
I learned from working with analog, no division inside an octave-range is impossible.
If one chooses to make some brain-graining compromise with 12 tones, so someone can play on a piano, it's ok by me, but as long as other options are available as well.
0.618033988

furrykef

One problem with just intonation is that it would work best if you could change the tuning with, say, every chord. If you have a song written in C major, but you try to play a D chord on it, it will not sound good because the D chord and its fifth, A, will be a wolf interval. So you would need to change the tuning occasionally for some pieces.

As for the "C# and Db are not equivalent" thing... it has to do with how you arrive at the interval. For example, an augmented fourth or a diminished fifth could be seen as a minor third of a minor third: 6:5 * 6:5 = 36:25. Or it could be a major second of a major third: 9:8 * 5:4 = 45:32. I'd say the smaller ratio (45:32) is the augmented fourth and the larger one (36:25) is the diminished fifth. Of course, in practice, you could use one in place of the other if you wanted (or needed) to, but they're still technically different intervals.

Which one you use -- an augmented fourth or a diminished fifth -- is a matter of diatonic function. I think that you would use an augmented fourth if your chord is C-E-F# (because F# is a major third and a major second), and a diminished fifth if your chord is C-Eb-Gb (because Gb is a minor third and a minor third). Hey, I think I'm starting to get this stuff.

EDIT: I do like the idea of that tuning editor, BTW. I'm surprised -- and happy -- that somebody was already working on this... :)

(EDIT #2: explained what I think is meant by "diatonic function")

- Kef

furrykef

Hey, I downloaded the source code for the version with the tuning thing, but I'm having trouble getting it to build (I don't have VC7, only the Toolkit version). I'll probably figure out something, but it might be nice to post a build somewhere.

EDIT: Crap! MFC's not included in either VC++ Toolkit 2003 or Visual C++ 2005 Express! I guess I'm screwed, then...

- Kef

Relabsoluness

2furrykef

Maybe I'll understand the explanation some day :) But based on
Quote from: "furrykef"One problem with just intonation is that it would work best if you could change the tuning with, say, every chord.
it seems to me that there's no 'trivial' solution for this, but can one achieve this by having the 'same' instrument multiple times but every one of these would have different tuning, and then use appropriate instrument for every chord in the patterns?

About the source:
It indeed is bothersome that OMPT needs MFC - it would be great to have it compilable with free tools but likely that won't happen at least anytime soon. When builds with the tuning things appear, hopefully it'll be informed here in the forums.

SoundCrafter

I assume in this tuning version, it applies only to individual instruments? I'd hate to have it apply to the whole song and have my kick fart everytime I played it.
---Formerly known as ---DjBj---. changed names for lots of reasons.
BooT-SectoR-ViruZ is the new Skaven and the whole world'z goin' to Hell.
Lowpass filter! Perform a generic type of dodge!!! :lol:
Everyone should get on this forum's chatroom RIGHT NOW...still not sure why, though.

furrykef

Quote from: "Relabsoluness"it seems to me that there's no 'trivial' solution for this, but can one achieve this by having the 'same' instrument multiple times but every one of these would have different tuning, and then use appropriate instrument for every chord in the patterns?

Yeah, that's the same solution I thought of, but it would be a pain to do that if you have a lot of instruments to retune. I think the S2x command (for IT) could be used as a tuning switcher, since the docs say it's only there "for MOD compatibility"... i.e., useless as far as I can tell. If for some reason you actually need to use that effect, you wouldn't be using alternative tunings anyway, so it'd be a no-op in OpenMPT with no alternative tunings defined, which makes it exactly the same as before, right?

That'd give you 16 tunings, 0-F, to switch to on the fly, which would probably be plenty. If you want more, you're probably a microtonalist... :)

Quote from: "SoundCrafter"I assume in this tuning version, it applies only to individual instruments? I'd hate to have it apply to the whole song and have my kick fart everytime I played it.

Yes, it only applies to individual instruments (as was stated explicitly in the first post about it), but I don't think it would be a problem with drum instruments. Altering the pitch of your kick drum by 20 cents will very probably not make it "fart", and the pitch might not even be altered at all (e.g., if you tune for C and play only C notes with the kick drum).

There should be a means of applying it to the whole song except for certain instruments (or maybe certain channels), though, but I don't think it'd be a very necessary feature, since you'd generally want each instrument in the same tuning, except for drums, which, again, I'm sure are pretty much unaffected. Perhaps one can set a tuning for the whole song and have a "tuning override" for individual instruments?

- Kef

Relabsoluness

Quote from: "furrykef"I think the S2x command (for IT) could be used as a tuning switcher, since the docs say it's only there "for MOD compatibility"... i.e., useless as far as I can tell. If for some reason you actually need to use that effect, you wouldn't be using alternative tunings anyway, so it'd be a no-op in OpenMPT with no alternative tunings defined, which makes it exactly the same as before, right?

That'd give you 16 tunings, 0-F, to switch to on the fly, which would probably be plenty. If you want more, you're probably a microtonalist... :)
Yes it might be reasonable to have such modcommand available; using S2x might be easy, but since the tuning things are not currently intended to be included in IT(nor XM), it shouldn't be too difficult to add even new command for this. But anyway, this, or the "tuning override" are not on the top of todo's right now; there is more than enough objective get even a simple version 'out' first.