PURE DATA forum~

...that deal with pure data

You are not logged in.

#1 2010-05-06 01:59:51

bwong
Member

My 1st patch, etrcalc.pd

Here is my 1st patch, a little tool for working with equal temperament tunings. It allows you to find the closest match to a specific ratio within any equal temperament tuning. Instructions available on website at http://www.bwong.ca

I am sure others have made far better utilities, but it is my first attempt at working with pd. Comments and suggestions for improvement welcome.

Offline

 

#2 2010-05-18 15:07:47

arif
Member

Re: My 1st patch, etrcalc.pd

i don't get what it does, but it sure looks complex.

I wonder why you use objects like [pulse] and [counter] in a mathematical operation.

either way, good work. I'm sure someone in the future will be saved by this.


Dual 1.8 IBM G5: Mac OSX 10.4.11 -- Asus eeePC 701: Pure:Dyne / eeeXubuntu GNU/Linux -- myspace.com/thearifd

Offline

 

#3 2010-05-18 15:35:48

bwong
Member

Re: My 1st patch, etrcalc.pd

Well, what it does is find the closest match to a particular ratio in any equal temperament tuning. For example, to find the closest match to an octave in the Bohlen-Pierce 13 tone equal temperament, you would enter an interval of 3, divisions of 13, and a target of 2, then hit run. After a couple of seconds it will return the closest match (1.96613) and a variance value (0.033866). This type of tool would be useful in analyzing new equal temperament tunings, and is inspired by the work described by Wendy Carlos in development of the Alpha, Beta, and Gamma tunings.

I used [pulse] as a way to get it to run through the operations the appropriate number of times for the tuning (ie 13 times maximum for BP13TET), and [counter] to help keep track of finding the closest match below and above the target ratio. It is probably more convoluted than it needs to be; keep in mind this is my first pd patch. :)

I don't doubt that a simpler and cleaner solution could be found and would be certainly be interested to see any improvements more experienced pd users can come up with. Expansion to deal with multiple target ratios would obviously be useful.

Offline

 

#4 2010-05-21 15:05:20

arif
Member

Re: My 1st patch, etrcalc.pd

thanks for the description, but in your example, why an interval of 3? and isn't a an octave ALWAYS an exact doubling of frequency whether in equal temperament or not? - And I thought equal temperament simply meant an octave is divided by x number of equal steps? man i have some major music theory revision to do!!

look up help for [until]


Dual 1.8 IBM G5: Mac OSX 10.4.11 -- Asus eeePC 701: Pure:Dyne / eeeXubuntu GNU/Linux -- myspace.com/thearifd

Offline

 

#5 2010-05-21 16:28:53

Maelstorm
Administrator

Re: My 1st patch, etrcalc.pd

I think "interval" might be a confusing word choice here. It probably should be something like "ratio". The octave is a 2:1 ratio, but Bohlen-Pierce is based on the tritave, which is 3:1. Equal temperament just means every interval is equally spaced. So with BP, it's a 3:1 ratio divided into 13 equal steps.

By the way, bwong, I've enjoyed your Csound contributions. Welcome to the world of Pd!


.mmb

Offline

 

#6 2010-05-21 17:06:28

bwong
Member

Re: My 1st patch, etrcalc.pd

Thanks arif, I will check out [until].

Terminology for general equal temperament tunings is a bit vague, I used "interval" to describe the frequency being divided up, while using "target ratio" to describe the desired target number. In this I was taking the 1978 article "A Theory of Equal-Tempered Scales", by Kees van Prooijen as a precedent.

BTW, I just released a new piece yesterday called "Tritium Tea" which is composed in three different tritave equal temperaments. You can find it on my website at http://bwong.ca

Offline

 

#7 2010-05-24 06:28:49

Maelstorm
Administrator

Re: My 1st patch, etrcalc.pd

bwong, I was just thinking about this today, and I think this could be made more efficient by running the target through an inverse equation like this:

[expr (log($f1)/log($f2))*$f3]

where $f1 is the target, $f2 is the interval, and $f3 is the divisions. Then you can get the int of the output (you could even do that within the [expr]), run that answer and that answer + 1 through you original pow() equation and compare those two numbers. I don't really have time to patch this together right now, but I think you can get the idea.

The way you are doing it now is kind of a "brute force" approach where you go through every one until you find a match. Doing it the above way would be more like finding a name in a phone book and going straight to the part of the alphabet you're looking for.


.mmb

Offline

 

#8 2010-05-24 06:58:50

bwong
Member

Re: My 1st patch, etrcalc.pd

Nice solution Maelstorm! By simply rounding the result of your equation to the nearest integer we have our solution, expressed as a scale degree. Actual scale ratio and variance values can then be directly calculated as in my original design. The elegance of your solution should also make expansion of the patch for multiple targets much easier, as well as obviously being much faster, particularly as the number of scale degrees rises.

Thanks very much, I will start working on etrcalc2! :)

Offline

 

#9 2010-05-27 01:18:20

bwong
Member

Re: My 1st patch, etrcalc.pd

Attached is a copy of etrcalc2.pd, remade using Maelstorm's equation. This version also gives the note number, and runs much faster than the previous version. Thanks again Maelstorm!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson


pd.webring info