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.
Details
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
-
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
// 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
-
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
-
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
-
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
-
hertz
-
Description
Hertz
A positive floating point number, greater than zero.Details
-
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
-
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
-
CtrlKeymapKey
-
midichan
-
Description
MIDI Channel
4-bit unsigned integer (between 0 and 15 included)Details
-
msgcmd
-
Description
DHC Message Command
Details
-
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.
Details
-
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
-
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.
Details
-
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
Details
-
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
-
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
-
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
-
HTMLElement
-
Details
-
File
-
Details
-
MIDIMessageEvent
-
Details
-
AudioContext
-
Details
-
GainNode
-
Details
-
DynamicsCompressorNode
-
Details
-
ConvolverNode
-
Details
-
ScriptProcessorNode
-
Details
-
MIDIAccess
-
Details
-
MIDIConnectionEvent
-
Details
-
MIDIPort
-
Details
-
ArrayBuffer
-
Details
-
Uint8Array
-
Details
-
DOMException
-
Details
-
HeldChannel
-
Description
Held channel' infos during the multi-channel polyphony routing;
a Held Channel is a currently busy channel already occupied by an outgoing toneProperties
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