Help with Key Operator

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
Post Reply
User avatar
ray
Posts: 238
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Help with Key Operator

Post by ray »

I need some help with the Key Operator.

I have created a list of 94 frequencies defining the notes of an equal temperament scale (ETS).

However, when generating say a major chord (the First, Third and Fifth notes of a scale),
the ratios of the notes really should be 1 1.25 1.5 (as if the scale was well tempered <WTS>),
but in the ETS they are 1 1.25992105 1.498307077.

When producing a visual animation, I am mapping the frequencies being played onto a piano type keyboard.

If all the frequencies are from the ETS, there would be no issue, one exact frequency for each position on the keyboard.
But if I use Chords generated via WTS ratios, it is not so simple, several frequencies are matched to the same position.

Given a vector of frequencies mid way between each note of the (equal temperament) scale,
(think of the points between the notes of the keyboard), then using the Key operator,
I should be able to generate for any given frequency, an index into this keyboard.

But I have never managed to my head around the Key Operator. Can anyone help?
Ray Cannon
Please excuse any smelling pisstakes.
paulmansour
Posts: 431
Joined: Fri Oct 03, 2008 4:14 pm

Re: Help with Key Operator

Post by paulmansour »

Ray, I'm sure I don't fully understand the problem, but I have this vague feeling that interval index is in the solution and not key. Could be totally wrong though.
User avatar
ray
Posts: 238
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: Help with Key Operator

Post by ray »

Thank you Paul, you are so correct! "interval index" is exactly what I needed.

Wishing you all A very Merry Christmas and a Prosperous New Year!

Ray
Ray Cannon
Please excuse any smelling pisstakes.
Post Reply