Class: Grid

Grid(_sketch, param, melEd)

Class representing the grid in the melEd.

Constructor

new Grid(_sketch, param, melEd)

Creates a Grid.

Parameters:
Name Type Description
_sketch p5

The p5.js sketch.

param Object

Object containing parameters.

melEd Object

The melEd object.

Methods

comp_obj2oblongs(c) → {Array}

Creates an array of oblongs for the given component.

Parameters:
Name Type Description
c Object

The Composition object for which to create the array of oblongs.

Returns:

oblongs - The array of oblongs for the given component.

Type
Array

cycle_logos(_visual)

Cycles through logos in the inner object every 5 seconds.

Parameters:
Name Type Description
_visual Visual

The Visual class instance.

draw(recalculateDimensions)

Draws the grid.

Parameters:
Name Type Description
recalculateDimensions Boolean

Whether to recalculate the dimensions.

get_mnns(pitchClasses, mnnRange) → {Array}

Gets MIDI note numbers within the given range, given the array of pitch classes.

Parameters:
Name Type Description
pitchClasses Array

The array of pitch classes.

mnnRange Array

The range of MIDI note numbers.

Returns:

allMnns - The array of MIDI note numbers.

Type
Array

string_fraction2decimal(str) → {Number}

Converts a string fraction to a decimal.

Parameters:
Name Type Description
str String

The string fraction.

Returns:

ans - The decimal representation of the string fraction.

Type
Number

touch_check(touchType, sonic)

Checks for touch events.

Parameters:
Name Type Description
touchType String

The type of touch event.

sonic Sonic

The Sonic class instance.