Yes, you got that right Pete!
The makeHarmonicKeyboard function assigns intervals upwards and to the right,
starting from the Z key.
A simple to play is the default: It goes 5ths up, thirds (alternating major/minor) to the right, ie
1=E 2=G 3=Bb
q=Bb w=D e=F
a=F s=A d=C
z=C x=E c=G ...
So pressing keys z,a,s gives F major, z,x,s gives A minor chord.
This layout is created by the call:
notemap = makeHarmonicKeyboard(36, 5, [4,3]); // Alternate maj/min thirds in right direction
36: lowest note, C2. 24 also works
5: 5 semis = a fourth
[4,3]: Arrays can be used up or to the right, any number of args, they are just looped.
It's also very playable with other intervals, each will give its own flavour provided you
hammer along with enough lack of concentration!
Neither keyboard nor the GS Midi synth give very good response though, it's best with strings or
synth pads, but the patches in HarmonicKeys.js file do not send noteoffs properly.
So either need to modify it, or choose sounds that fade out fairly quickly.
The Swedish keyboard doesn't work out of the box even for me; when the file is loaded the umlaut chars
are turned into some Greek letters. I need to copy and paste them to the console to get it right.
Need to review file input for load/read functions.
Attention: I insert one \0 char to fill for the righthand SHIFT key.
Also intended to make more keyboard layouts (American, French, Spanish maybe) but forgot it the other day...
This project is not properly announced yet, still playing with various JS scripts
(including Midi file player, really interested to see if it can keep tempo...)
re
On 2010-01-28 20:05, Pete wrote:
> In article<(E-Mail Removed)>,
> Peter Billam<(E-Mail Removed)> wrote:
>> On 2010-01-28, rasmus e<(E-Mail Removed)> wrote:
>>> I have been playing with JavaScript and Midi (wrapping RtMidi
>>> library code into Google's V8). http://www.abc.se/~re/code/v9/
>>>
>>> There's a small script that maps all alphanumeric keys to a
>>> Harmonic keyboard. (ie any three adjacent keys make a major/minor
>>> chord - well, can be configured to any intervals).
>>
>> I understand the Swedish-keyboard difficulty... I'm afraid I've
> Maybe he's thinking about a layout analogous to the bass keys
> of my accordion... Never thought about the similarity before, but,
> yes, they are both rows of keys (or buttons), with alignment slanting
> vertically to the left. A bit hard to show in text, but -- looking
> at the section around 'C':
>
> ... A E B ... "Counter Bass"
> ... F C G ... Fundamental
> ... FM CM GM... Major Chord
> ... Fm Cm Gm... Minor Chord
>
> Makes it easy to play a rhythm accompaniment without being able to
> see the keys!