Lume
    Preparing search index...

    Class DiamondChord

    DiamondChord generates a hollow diamond for each currently active MIDI note. The size of each diamond is determined by the MIDI note values, with smaller values producing a smaller value, and vice versa.

    The properties that determine the sizes of the diamonds are sizeOffset, sizeMultiplier, and maximumNoteValue. The formula used is a linear equation where sizeOffset is the constant, and sizeMultiplier is the slope. The property maximumNoteValue overrides this functionality if there are any note values above it, to ensure that the diamonds never exceed a certain size.

    Hierarchy (View Summary)

    Index

    Accessors

    • get boostThreshold(): number

      Returns the boost threshold.

      The boost threshoold refers to the time (in milliseconds) that it takes a newly formed diamond to go from it's boosted size to it's normal size.

      Returns number

    • set boostThreshold(value: number): void

      Sets the boost threshold.

      Parameters

      • value: number

      Returns void

    • get colorNoteHeld(): Color

      Returns the color for held notes.

      Returns Color

      The color transition from note start to held is based off the boostThreshold.

    • set colorNoteHeld(value: Color): void

      Sets the color for held notes.

      Parameters

      • value: Color

      Returns void

    • get maximumNoteValue(): number

      Determines the maximum note value that DiamondChord will accept.

      Notes that exceed this value will have DiamondChord lower the value of all the notes until all notes are equal or lower than the maximum note value.

      Returns number

      This property ensures that DiamondChord does not exceed a certain size boundary.

      127
      
    • set maximumNoteValue(value: number): void

      Sets the maximum note value.

      Parameters

      • value: number

      Returns void

      Value must be a valid MIDI note (an integer between 0-127).

    • get sizeMultiplier(): number

      Returns the size multipler.

      Returns number

    • set sizeMultiplier(value: number): void

      Sets the size multipler property.

      The size multiplier is multiplied with a midi note to help determine it's base size.

      Parameters

      • value: number

      Returns void

    • get sizeOffset(): number

      Returns the size offset.

      Returns number

    • set sizeOffset(value: number): void

      Sets the size offset property.

      The size offset property is added onto the size of all diamonds, increasing their sizes by a flat amount.

      Parameters

      • value: number

      Returns void

    Constructors

    Methods

    • Called by the rendering engine on every frame.

      When overriding this method, ensure that the p5 instance is configured properly. For example, rectangles may be drawn incorrectly if a previous CanvasDrawer had modified p5.rectMode(). CanvasDrawer classes are not obligated/expected to use the default p5 attributes.

      See the p5 documentation on attributes for more information: https://p5js.org/reference/#Attributes

      Returns void