[Tutor] putting a short list of integers into a (specific) compactform

kevin parks kp8 at mac.com
Sun Oct 12 22:34:21 EDT 2003


On Sunday, October 12, 2003, at 12:41  PM, Alan Gauld wrote:

>> I've got a question. It is a bit of a brain teaser for me and i am
>> trying to figure out nice and pythonic way of going about things,
>
> I'm trying to think why on earth anyone would want to do such
> a thing! Can you assuage my curiosity?

Hi Alan. Thanks for your reply. I am still working on this and have the 
first few steps taken care of.
but, since you and a bunch of other folks are curious I ought to 
explain what this is needed for. I didn't
mean for it to be so mysterious, but i noticed my post was already 
getting quite convoluted so
i was trying to cut to the chase as best as i could.

I am trying to use this to form what is called the 'normal form' of a 
set of musical pitches. Here the pitches
are all represented as numbers 0-11. In order to compare sets and see 
if they are inversionally or
transpositionally related, or if they will have any common tones under 
transposition or inversion
it is helpful to put the sets in this compact form. There are lots of 
buggy little java applets that do this
on the web.

http://mail.rochester.edu/~af006m/Clock2.html
http://www.jaytomlin.com/music/settheory/
http://www.webcalc.net/calc/0515.php
http://gigue.peabody.jhu.edu/~pnelson/PCSets/setfinder.html
http://www.cosmoedu.net/DoctorFields/TTTBLow.html

but i want to do this from within python.

As i said i have the unique(), sort, and rotate() thing sort of 
working, but then i have to figure out how
work with that to get my steps 3,4 (and 5). Raymond Hettinger has 
replied as well an i am looking at
how he has broken the problem down and it is helping me understand a 
bit better.


-kevin







More information about the Tutor mailing list