back to list

consistency proggie

🔗Carl Lumma <clumma@xxx.xxxx>

1/10/2000 2:07:24 AM

If anybody's interested, here's a LISP run that returns the highest odd
limit at which an ET is consistent, up to the 19-limit, for a range of
ET's...

http://lumma.org/consist.ss

It is a LISP translation (likely a very bad one) of some brilliant
pseudocode that Paul Hahn posted here a while back. You can run it with
the free Chez Scheme Petite...

http://www.scheme.com/

Be sure to download and install SWL (scheme widget library), too. Follow
the "SWL" shortcut, load consist.ss, and type (chart min max), where min
and max are whole numbers representing the smallest and largest ET's in
your range, inclusive. You'll get back a bunch of what look like ordered
pairs. The first number in each pair is the ET number, and the second is
the largest odd limit (up to 19) at which the ET is at least level-1
consistent.

Scheme is interpreted, but on my P2-400 I can do the first 200 ET's
instantly. I checked many of them against Paul Hahn's charts at...

http://library.wustl.edu/~manynote/music.html

...and there seems to be agreement. In case you have another version of
LISP, you can read the source below. It can easily be changed to check at
higher limits than 19, or indeed to check consistency against any set of
odd factors you'd like. Simply change the list (19 17 15 13 11 9 7 5 3)
in the procedure "chart" to the set you want. Just be sure to put the
factors in reverse order of size. Comments (and suggestions, if you know
any LISP) requested...

(define log2?
(lambda (num)
(/ (log num) (log 2))))

(define errors
(lambda (ET lim)
(cond
[(null? lim) '()]
[else (cons (- (* ET (log2? (car lim))) (round (* ET (log2? (car
lim))))) (errors ET (cdr lim)))])))

(define max?
(lambda (ls)
(cond
[(null? (cdr ls)) (car ls)]
[(> (car ls) (max? (cdr ls))) (car ls)]
[else (max? (cdr ls))])))

(define min?
(lambda (ls)
(cond
[(null? (cdr ls)) (car ls)]
[(< (car ls) (min? (cdr ls))) (car ls)]
[else (min? (cdr ls))])))

(define consist?
(lambda (ET lim)
(cond
[(< (- (max? (errors ET lim)) (min? (errors ET lim))) (/ 1 2)) #T]
[else #F])))

(define limit
(lambda (ET lim)
(cond
[(null? lim) (cons 0 '())]
[(consist? ET lim) (cons (car lim) '())]
[else (limit ET (cdr lim))])))

(define chart
(lambda (min_ET max_ET)
(cond
[(equal? (+ 1 max_ET) min_ET) (cons 'FIN '())]
[else (cons (cons min_ET (limit min_ET '(19 17 15 13 11 9 7 5 3)))
(chart (+ 1 min_ET) max_ET))])))

-Carl

🔗Carl Lumma <clumma@xxx.xxxx>

1/10/2000 2:10:35 AM

>If anybody's interested, here's a LISP run that returns the highest odd
>limit at which an ET is consistent, up to the 19-limit, for a range of
>ET's...

I forgot to thank Pauls Hahn and Erlich for the fantastic notion of consistency, and all their help explaining it to me.

-Carl

🔗Carl Lumma <clumma@xxx.xxxx>

1/10/2000 10:15:14 AM

[I wrote...]
>It can easily be changed to check at higher limits than 19, or indeed to
>check consistency against any set of odd factors you'd like. Simply change
>the list (19 17 15 13 11 9 7 5 3) in the procedure "chart" to the set you
>want. Just be sure to put the factors in reverse order of size.

Actually, size order doesn't matter. What you can do, though, is put your
factors in order of importance -- which is reverse size order for complete
odd limits.

IOW, if all you want to do is check for consistency with an entire set, you
can enter the set in any order. If the first item gets returned, the ET is
consistent with the whole set. If any other item gets returned, the ET isn't
consistent with the whole set -- it's consistent with the set to the right of
and including the returned item.

-Carl

🔗Carl Lumma <clumma@xxx.xxxx>

1/10/2000 1:18:08 PM

Apologies to anyone who had trouble accessing files on my web site this
morning. I've moved things around a bit. Everything regarding this thread
is now at...

ftp://lumma.org/pub/

The procedure I posted earlier is now called consist_limit.ss, and the code
I posted earlier is at consist_limit.txt (with a small change that makes it
more forgiving as to the types of input sets you can feed it).

There's also a new procedure called consist_ET.ss. This one returns all
ET's, within the given range, that are consistent at or above the given
level with respect to the given set of odd factors. It looks like this...

(chart lev '(list) min_ET max_ET)

So, if you wanted to know which ET's between 5 and 100 (inclusive) were at
least level-2 consistent with respect to the set (1 3 7 11 19), you would
type...

(chart 2 '(3 7 11 19) 5 100)

...and you would get...

(89 fin)

For regular consistency, just enter a "1" for the level. Also note that
the level does not have to be a whole number, if you're interested
fractional consistency. Just don't forget the ' mark before your list of
factors.

This new procedure may be helpful when searching for ETs to use with
generalized diatonics that are based on unsaturated chords.

Once again, I've used Paul Hahn's killer charts to check my work. And
again, if you don't already have a version of LISP, or you don't feel like
changing all the null?'s to nil's, etc, just download Chez Scheme from
Cadence Research at www.scheme.com.

Oh yeah, please note that these two procedures should be run in seperate
sessions, since I haven't been careful to keep the bindings straight.

-Carl