Methods


SynthListCallback( synthlist )

Description

Set a global function for WebMidiLink JSONP script (synthlist.js)
In order to use the original synthlist from g200kg, uncomment one of the following <script> in "./index.html" file:

  • "./assets/js/lib/synthlist.js" for the "local copy" version;
  • "http://www.g200kg.com/webmidilink/synthlist.js" for the "live" version.
Parameters
Name Type Description
synthlist Array.<WmlSynth>

The search term to highlight.

Type Definitions


tratio

Description

Transpose ratio

A positive floating point number.
Examples:


  • 2, 4, 8, 16... for octaves up

  • 0.5, 0.25, 0.125, 0.0625... for octaves down

  • 1 to not transpose

Details
number

midicent

Description

Midicent

A midicent is one floating points MIDI-note-number unit.

It can be a positive or negative floating point number.

Considering the description of midicent proposed in the following links, our midicent should be called hecto-midicent.

  • https:\\/\\/fr.wikipedia.org/wiki/Midicent
  • http:\\/\\/support.ircam.fr/docs/om/om6-manual/co/Score-Objects-Intro.html#zdN1d7
Examples

How to convert a given frequency in hertz to midicent.

// Variables description:
			midiA4 = 69;    // The A4 note in MIDI note number notation
			semitones = 12; // The number of semitones of the 12-EDO
			hzA4 = 440;     // The A4 note in hertz
			// Math.log2()     Because we are dividing the octave (frequency ratio 2)
			
			midicent = midiA4 + semitones * Math.log2(frequency / hzA4)
			//                                        ^^^^^^^^^          
			//                                        Input freq.
Details
number

tonetype

Description

Tone Type

A string composed by two lowercase characters, representing one of the two tone types:
Fundamental Tones (FT -> 'ft') and Harmonic Tones (HT -> 'ht').

Details
'ft' | 'ht'

midinnum

Description

MIDI note number

A integer number, officially it must be a 8-bit unsigned integer (between 0 and 127 included).

Negative numbers and number greater than 127 still mean a certain frequency,
but you cannot send them to MIDI devices.

Details
number

CtrlKeymapPreset

Description

A Controller keymap preset

Properties
Name Type Description
name string

Original filename of the Controller keymap (without extension)

notes string

User-friendly description of the Controller keymap

map CtrlKeymap

The Controller keymap

Details
Object

hertz

Description

Hertz

A positive floating point number, greater than zero.

Details
number

xtnum

Description

Xtone number

An integer number, representing a FT or HT relative tone.

If it represents an FT, it is relative to FT0, alias the FM (Fundamental Mother).
If it represents an HT, it is relative to HT1, alias the fundamental of the harmonic/subharmonic series.

Details
number

CtrlKeymap

Description

A Controller keymap; each key of the Object is a MIDI Note number

Details

velocity

Description

Velocity

8-bit unsigned integer (between 0 and 127 included)

Details
number

CtrlKeymapKey

Description

A single key of the Controller keymap

Properties
Name Type Description
ft xtnum

Fundamental Tone (FT) relative number; +/-64, FT0 is the FM, 129 is no FT

ht xtnum

Harmonic/Subharmonic Tone (HT) relative number; +/-128, 0 is Piper feature, 129 is no HT

Details
Object

midichan

Description

MIDI Channel

4-bit unsigned integer (between 0 and 15 included)

Details
number

msgcmd

Description

DHC Message Command

Details
'init' | 'panic' | 'update' | 'tone-on' | 'tone-off'

wmlmsg0

Description

WebMidiLink Message Link 0

  • 'midi,nn[,nn...]': "midi" is a ID string and following "nn"s are comma-separated MIDI message bytes represented in hexadecimal. Do not use the MIDI running status abbreviation.

MidiInNoteOn

Description

MIDI note number from external input controller

Properties
Name Type Description
keymapped midinnum

The MIDI Note Number on the keymap (internal)

midievent MIDIMessageEvent

The original MIDI event containing the note-on message

Details
Object

wmlmsg1

Description

WebMidiLink Message Link 1

In the Harmonicarium terms:

  • "Synth" or "Synthesizer" means Instrument
  • "Host" means Controller

Harmonicarium can act:

  • as Host if you load a Synth from WebMidiLink Out;
  • as Synth if you load Harmonicarium from a Host;
  • as both, Host and Synth, if you load Harmonicarium from a Host and then you load a Synth from WebMidiLink Out.

Host=>Synth | The messages from Host to Synth are:

  • 'link,reqpatch': The Host request the current configuration data to Synth. The Synth should send following "link,patch" message.
  • 'link,setpatch,<data>': The Host send configuration data to Synth with this message. This is a data acquired with "link,patch,". The Synth should set-up the sound patch with this message.

Synth=>Host | The messages from Synth to Host are:

  • 'link,progress': The Synth should send this message to Host when is loading, just after its window or its iframe has been opened.
  • 'link,ready': The Synth should send this message to Host when ready after start up. The host may be window.opener or window.parent depends on popup or iframe. Host noticed the Synth is LinkLevel 1 with this message and enable following LinkLevel 1 messages.
  • 'link,patch,<data>': The Synth send current configuration data to Host with this message when received the "link,reqpatch". is a proprietary data of this Synth but should be represented as a string and should not use comma (,). For example, it may be a url-encoded query string (a=00&b=11&c=33), or a Base64 / Base64url encoded binary-data.

WmlSynth

Description

The original g200kg's Synth object definition

Properties
Name Type Description
name string

Name of the Synth

url string

URL to the Synth

author string

Author of the Synth

authorurl string

URL to the author

description string

Description of the Synth

latency Object

Typical latency (in milliseconds) in each "platform-browser" environment.
Platform is 'win' or 'mac' and the browser is one of the 'ch' (Chrome), 'ff' (Firefox) or 'sa' (Safari).
The key, "-" is a default value that used when key is not found.

Name Type Description
"win-ch" number

Chrome on Windows

"win-ff" number

Firefox on Windows

"mac-sa" number

Safari on macOS

"mac-ch" number

Chrome on macOS

"mac-ff" number

Firefox on macOS

"*-*" number

Default/fallback value


WmlSynthHum

Description

The Harmonicarium (internal) Synth object definition, that extends the g200kg's one.

Properties
Name Type Description
pbRange string

Default pitchbend range

chVoices string

Number of available voices

chMode string

MIDI Channel Mode compatibility

chModeDesc string

MIDI Channel Mode description

note string

Useful notes about Channel Mode implementation

status string

Notes about possible issues

Details
Object

OtherMidiMsg

Description

A MIDI message (data + timestamp)

Properties
Name Type Description
0 Uint8Array

Message; an array of 8-bit unsigned integers

1 number

Time-stamp; a floating point number

Details
Array.<{2}>

ChanAssignment

Description

A JSON string containing data about the assignment of a MIDI Channel useful on DOM events.

Properties
Name Type Description
port string

MIDI port

chan midichan

MIDI channel on that port

fn tonetype

Tone type (FT or HT)

not tonetype

The opposite tone type (HT or FT) ... don't ask ;)

Details
string

HTMLElement


File


MIDIMessageEvent


AudioContext


GainNode


DynamicsCompressorNode


ConvolverNode


ScriptProcessorNode

Details

WARNING: As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and was replaced by AudioWorklet (see AudioWorkletNode)


MIDIAccess


MIDIConnectionEvent


MIDIPort


ArrayBuffer


Uint8Array


DOMException


HeldChannel

Description

Held channel' infos during the multi-channel polyphony routing;
a Held Channel is a currently busy channel already occupied by an outgoing tone

Properties
Name Type Description
ch midichan

MIDI Channel Number (from 0 to 15)

note midinnum

Final MIDI Note Number on the Instrument

vel velocity

MIDI velocity amount (from 0 to 127)

xt xtnum

Relative tone number (FT or HT)

tsnap boolean

If the note is managed by Tsnap

Details
Object