new Hancock( dhc )

Description

The Hancock class

A tool to manage and override the Qwerty Hancock lib

Parameters
Name Type Description
dhc HUM.DHC

The DHC instance to which it belongs

Members


dhc :HUM.DHC

Description

The DHC instance

Details

active :boolean

Description

The state of the Hancock; if false, it is turned off.

Details
boolean

settings :Object

Description

Default Qwerty Hancock settings

Properties
Name Type Description
id string

Id of the htmlElement in which to put the keyboard

width number

Width of the keyboard in pixels

height number

Height of the keyboard in pixels

octaves number

How many octaves to show

startNote string

The note name (hancock numbering) of the first key to show

whiteNotesColour string

Default released key color for white keys (bypassed by classes & css)

blackNotesColour string

Default released key color for black keys (bypassed by classes & css)

hoverColour string

Default pressed-key color for all the keys (bypassed by classes & css)

velocity velocity

The velocity value to be used when sending messages; an integer between 1 and 127

channel midichan

The Channel to be used when sending messages; an integer between 0 and 15


uiElements :Object

Description

UI HTML elements

Properties
Name Type Description
fn Object.<string, HTMLElement>

Functional UI elements

in Object.<string, HTMLElement>

Input UI elements

out Object.<string, HTMLElement>

Output UI elements

Details
Object

keyboard :QwertyHancock

Description

The instance of Qwerty Hancock piano keyboard

Details
QwertyHancock

Methods


updatesFromDHC( msg )

Description

Manage and route an incoming message

Parameters
Name Type Description
msg HUM.DHCmsg

The incoming message

Details

sendMidiNote( note, state )

Description

Send a fake MIDI event note ON/OFF directly to midi.in
in order to input Qwerty Hancock as a virtual MIDI device

Parameters
Name Type Description
note string

Hancock note name (e.g. G#5)

state 0 | 1

0 is Note-OFF | 1 is Note-ON

Details

drawKeymap()

Description

Bypass the Qwerty Hancock default key colors (released).
Write the key-numbers according to the keymap.

Details

fitToKeymap()

Description

Adapt the Hancock UI parameters in order to fit the keymap to the piano width.

Details

keyON( ctrlNum )

Description

Bypass the Qwerty Hancock default key colors and set the right color for Note-ON message.

Parameters
Name Type Description
ctrlNum midinnum

MIDI note number

Details

keyOFF( ctrlNum )

Description

Bypass the Qwerty Hancock default key colors and set the right color for Note-OFF message.

Parameters
Name Type Description
ctrlNum midinnum

MIDI note number

Details

allNotesOff()

Description

Turns off all the keys (from midinnum 0 to 127)

Details

update()

Description

Update the Qwerty Hancock keyboard on UI setting changes

Details

changeOffset( midikey )

Description

Set the offset of the Qwerty Hancock and update the UI.
The piano keyboard will start from the given note to the right.

Parameters
Name Type Description
midikey midinnum

MIDI note number representing a piano key

Details

changeRange( octaves )

Description

Set the octave-range of Qwerty Hancock and update the UI

Parameters
Name Type Description
octaves number

Number of octaves to show

Details

changeSize( pixels, dim )

Description

Modify the size of Qwerty Hancock and update the UI

Parameters
Name Type Description
pixels number

Number of pixels

dim 'w' | 'h'

The dimension to change; 'w' is for weight, 'h' is for height

Details

_initUI()

Description

Initialize the UI of the Hancock instance

Details