Jazz-Soft.net

We make it sound!

Home » Documentation » JZZ.js » Modules » JZZ.input.ASCII

JZZ.input.ASCII

Map ASCII keyboard to MIDI notes. This module goes well with JZZ.input.Kbd.

See the demo...

Usage

JZZ.input.ASCII(map);
// or
JZZ.input.ASCII(name, map);
// or
JZZ.input.ASCII.register(name, map);
JZZ().openMidiIn(name);

where map - is the mapping object that maps key names to MIDI values.

Key name can be a letter from A to Z, digit from 0 to 9, underscore '_', or any of the following characters:

' ', '+', '=', '-', '[', '{', ']', '}', '|', '\\', '`', '~', ';', ':', "'", '"', ',', '<', '.', '>', '/', '?' .

MIDI value can be either a number or a human-readable note name like 'C5', 'F#6', 'Bb4', etc...

Additional keys:

Example

<script src='JZZ.js'></script>
<script src='JZZ.input.Kbd.js'></script>
...
<script><!--
// map the keys    s d   g h j
//                z x c v b n m    to the first octave:
JZZ.input.ASCII({
  Z:'C5', S:'C#5', X:'D5', D:'D#5', C:'E5', V:'F5', G:'F#5', B:'G5', H:'Ab5', N:'A5', J:'Bb5', M:'B5'
}).connect(JZZ().openMidiOut());
--></script>

See also