Classes
Members
- 
			
harmonicarium :HUM
 - 
	
Description
The HUM instance
Details
 - 
			
id :string
 - 
	
Description
The id of this DHC instance
Details
 - 
			
settings :HUM.DHC#DHCsettings
 - 
	
Description
DHC Settings
Details
 - 
			
tables :Object
 - 
	
Description
DHC Tables
Properties
Name Type Description ctrlCtrlKeymap The current Controller Keymap
ftObject.<xtnum, HUM.DHC#Xtone> The current Fundamental Tones table
htObject.<xtnum, HUM.DHC#Xtone> The current Harmonic/Subharmonic Tones table
reverseObject Reverse tables namespace
Name Type Description ftObject.<midinnum, xtnum> Reverse Fundamental Tones table
htObject.<midinnum, xtnum> Reverse Harmonic/Subharmonic Tones table
Details
 - 
			
uiElements :Object
 - 
	
Description
UI HTML elements
Properties
Name Type Description fnObject.<string, HTMLElement> Functional UI elements
inObject.<string, HTMLElement> Input UI elements
outObject.<string, HTMLElement> Output UI elements
Details
 - 
			
registeredApps :Map.<Object, string>
 - 
	
Description
Registered Apps
The key of each record is an app Object and the value is the metod that must be invoked
to send messages towards the app.Details
 - 
			
hstack :HUM.Hstack
 - 
	
Description
The Hstack instance
Details
 - 
			
synth :HUM.Synth
 - 
	
Description
The Synth instance
Details
 - 
			
midi :HUM.midi.MidiHub
 - 
	
Description
The MidiHub instance
Details
 - 
			
hancock :HUM.Hancock
 - 
	
Description
The Hstack instance
Details
 - 
			
pipe :Object
 - 
	
Description
Piper's default settings
Properties
Name Type Description maxLenghtnumber How many steps has the Pipe
queueArray.<HUM.DHCmsg> Last HT MIDI Note-ON messages received
pipeArray.<HUM.DHCmsg> MIDI Note-ON messages stored into the Pipe
currStepnumber Last step played by the Piper
currToneHUM.DHCmsg Last fake MIDI Note-ON message send
Details
 - 
			
playQueue :Object
 - 
	
Description
Queues for FT/HT playing and muting management
Properties
Name Type Description ftArray.<HUM.DHCmsg> Queue for FT key-press tracking
htArray.<HUM.DHCmsg> Queue for HT key-press tracking
Details
 - 
			
ctrlKeymapPreset :HUM.CtrlKeymapPreset
 - 
	
Description
The container for all the Controller keymap presets
Details
 - 
			
backendUtils :BackendUtils
 - 
	
Description
The Backend Utils instance
Details
 
Methods
- 
			
_init()
 - 
	
Description
Initialize the new instance of DHC
Details
 - 
			
registerApp( app, method, priority )
 - 
	
Description
Register a new App (module)
Parameters
Name Type Description appObject The instance of the app to be registered
methodstring The name of the method to use to send messages
prioritynumber The priority with which the registered app will receive messages
Details
 - 
			
sendMessageToApps( dhcMsg )
 - 
	
Description
Send a DHCmsg message to all the registered apps
Parameters
Name Type Description dhcMsgHUM.DHCmsg The message to send
Details
 - 
			
initTables()
 - 
	
Description
Recompile FT & HT tables in the right order
Details
 - 
			
createFTtable()
 - 
	
Description
Recompile the Fundamental Tones (FT) table
Details
 - 
			
createHTtable( fundamental )
 - 
	
Description
Recompile the Harmonic/Subarmonic Tones (HT) table
Parameters
Name Type Description fundamentalhertz The tone on which to build the table, expressed in hertz (Hz)
Details
 - 
			
getFM( method ) → {hertz}
 - 
	
Description
Get the Fundamental Mother (FM) from the UI input
Parameters
Name Type Description method'mc' | 'hz' Method to use to get the FM
Returns
Details
 - 
			
setFM( hz )
 - 
	
Description
Set the Fundamental Mother (FM) and re-init the tone tables
Parameters
Name Type Description hzhertz Frequency expressed in hertz (Hz)
Details
 - 
			
printFundamentalMother( hz, mc )
 - 
			
switchFTsys( sys [, sys_hs ], init )
 - 
	
Description
Switch the FT TUNING SYSTEM (called when UI is updated)
Parameters
Name Type Attributes Default Description sys'nedx' | 'hs' FTs tuning method; 'nedx' (equal temperament) or 'hs' (harm/subharm)
sys_hs'natural' | 'sameOctave' <optional> false FTs Harm/Subharm tuning method; 'natural' (no transposition) or 'sameOctave' (to the same octave)
initboolean false If the method has been called by the ._init() method
Details
 - 
			
setNEDX()
 - 
	
Description
Set the nEDx (called when UI is updated)
Details
 - 
			
transposeFThs( ratio, type )
 - 
			
transposeHT( ratio, type, octave )
 - 
	
Description
Transpose HT (sub)harmonics (called when UI is updated)
Parameters
Name Type Description ratiotratio The ratio with which to compute the transposition
type'h' | 's' Type of transposition; 'h' for harmonics or 's' for subharmonics
octaveboolean If it's an octave transposition or not.
If it's true, the 'ratio' should be 2 (for octave up) or 0.5 (for octave down).Details
 - 
			
updateKeymapPreset()
 - 
	
Description
Update the preset list according to the selected FTs Tuning System
Details
 - 
			
loadKeymapPreset( changeEvent )
 - 
	
Description
Load a Controller keymap from 'ctrlKeymapPreset' according to the selection on UI
Parameters
Name Type Description changeEventEvent Change HTML event on 'select' element (ctrl keymap dropdown)
Details
 - 
			
handleKeymapFile( changeEvent )
 - 
	
Description
On loading the Controller Keymap file
Parameters
Name Type Description changeEventEvent HTML change event on 'input' element (ctrl keymap file uploader)
Details
 - 
			
readKeymapFile( file )
 - 
	
Description
Initialize the reading process of the Controller Keymap file
Parameters
Name Type Description fileFile The file to be read
Details
 - 
			
processKeymapData( data, name )
 - 
	
Description
Build the Controller Keymap table on the incoming raw data from .hcmap file
Parameters
Name Type Description datastring The text content of the Controller keymap file
namestring The filename
Details
 - 
			
keymap2Html()
 - 
	
Description
Create an HTML table from the controller keymap and write it to the UI under a modal element
Details
 - 
			
playFT( dhcMsg )
 - 
	
Description
Play a Fundamental Tone
Parameters
Name Type Description dhcMsgHUM.DHCmsg The message containing the FT to be played
Details
 - 
			
muteFT( dhcMsg )
 - 
	
Description
Stop playing a Fundamental Tone
Parameters
Name Type Description dhcMsgHUM.DHCmsg The message containing the FT to be muted
Details
 - 
			
playHT( dhcMsg )
 - 
	
Description
Play a Harmonic/Subharmonic Tone
Parameters
Name Type Description dhcMsgHUM.DHCmsg The message containing the HT to be played
Details
 - 
			
muteHT( dhcMsg )
 - 
	
Description
Stop playing a Harmonic/Subharmonic Tone
Parameters
Name Type Description dhcMsgHUM.DHCmsg The message containing the HT to be muted
Details
 - 
			
panic()
 - 
	
Description
Force to stop playing all Fundamental and Harmonic/Subharmonic Tones
Details
 - 
			
piper( dhcMsg )
 - 
	
Description
Store a play-HT message into the Piper's queue
Parameters
Name Type Description dhcMsgHUM.DHCmsg The message containing the HT to be piped
Details
 - 
			
piping( state )
 - 
	
Description
Play or mute the next HT available in the piper's queue.
Usually when HT0 is pressed (or released).Parameters
Name Type Description state0 | 1 Note ON/OFF; 1 is ON (play), 0 is OFF (mute)
Details
 - 
			
initPipeQueue( type )
 - 
	
Description
Experimental function for dynamic default/preloaded piper melody.
Fill the Piper's queue with a sequence of HTs.Parameters
Name Type Description type'h' | 's' | 'hs' The HTs scale type of the current Controller keymap
Details
 - 
			
bendXtone( xtObj ) → {HUM.DHC#Xtone}
 - 
	
Description
Apply the current controller pitchbend amount (if present) to a Xtone object and return a pitch-bent copy of it.
Parameters
Name Type Description xtObjHUM.DHC#Xtone FT or HT object of the tone to bend
Returns
Details
 - 
			
initUImonitors()
 - 
	
Description
Update all parts of the UI with the last computed or set values.
Send the 'init' message to all the redistered Apps.Details
 - 
			
dhcMonitor( type, xtNum )
 - 
			
_initUI()
 - 
	
Description
Initialize the DHC UI controllers
Details
 - 
			
nameToMidiNumber( mode, note ) → {midinnum}
 - 
	
Description
Parse a note name string to get the MIDI note number
Parameters
Name Type Description mode'hancock' | 'ui' | 'scientific' The method in which the 'note' should be interpreted.
notestring The note name in format [A-G]#?-?\d+. E.g. C0, A#4, G-3, D#-1
Returns
Examples
'hancock' C0 == 0 midicent == 0 midinnum 'scientific' C0 == 12 midicent == 12 midinnum 'ui' C0 == // depends on Middle C setting (DHCsettings.global.middle_c)Details
 - 
			
midiNumberToNames( midikey ) → {Array.<string, string, boolean, string>}
 - 
	
Description
Convert a MIDI note number to an array containing 'hancock', 'ui' and 'scientific' note name,
plus the information if the key on the piano should be black or white.Parameters
Name Type Description midikeymidinnum MIDI note number (integer)
Returns
Details
 - 
			
mcToName( mc ) → {Array.<string, number, string, boolean>}
 - 
	
Description
UI Util to get the UI note name +/- cents from given midicent
Parameters
Name Type Description mcmidicent Pitch in midicent (float)
Returns
Details
 - 
			
mcToNameString( mc ) → {string}
 - 
	
Description
Util to get the full string of UI note name +/- cents
Parameters
Name Type Description mcmidicent Pitch in midicent (float)
Returns
Details
 - 
			
<static> mcToFreq( mc ) → {hertz}
 - 
	
Description
From MIDI note number to frequency (Hz)
Parameters
Name Type Description mcmidicent MIDI note number expressed in midi.cents
Returns
Details
 - 
			
<static> freqToMc( freq ) → {midicent}
 - 
	
Description
From frequency (Hz) to MIDI note number
Parameters
Name Type Description freqhertz Frequency expressed in hertz (Hz)
Returns
Details
 - 
			
<static> compute_nEDx( relativeTone, unit, division, masterTuning ) → {hertz}
 - 
	
Description
Calculate the n-EDx ("free" equal temperament) of a relative tone
Parameters
Name Type Description relativeTonenumber Relative number of the "step" in the scale (should be integer)
unitnumber Ratio unit (must be greater than zero)
divisionnumber Equal divisions of the ratio unit (must be greater than zero)
masterTuninghertz Reference frequency expressed in hertz (Hz)
Returns
Details
 - 
			
<static> uniqArray( arrArg ) → {Array.<number>}
 - 
	
Description
Remove duplicated values on the array passed via the argument
Parameters
Name Type Description arrArgArray.<number> Array of numbers
Returns
Details