Class MML

This class manages instance of Part for playing MML (Music Macro Language).

Constructors

Methods

  • This method clears instance of Part.

    Returns MML

    Return value is for method chain.

  • This method gets or sets current sequence index. This method is overloaded for type interface and type check.

    Parameters

    • partNumber: number

      This argument is part of MML.

    Returns number

    Return value is for current sequence index. Otherwise, Return value is for method chain.

  • Parameters

    • partNumber: number
    • sequenceIndex: number

    Returns MML

  • This method gets array that contains instance of Sequence from the all of MML parts.

    Returns Sequence[][]

  • This method gets MML string.

    Parameters

    • index: number

      This argument selects MML part.

    Returns string

  • This method gets array that contains MML string.

    Returns string[]

  • This method gets array that contains instance of Sequence.

    Parameters

    • index: number

      This argument selects MML part.

    Returns Sequence[]

  • This method gets string that represents MML syntax tree.

    Parameters

    • index: number

      This argument selects MML part.

    Returns string

  • This method determines whether sequences exist.

    Returns boolean

    If sequences exist, this value is true. Otherwise, this value is false.

  • This method determines whether MMLs are paused.

    Returns boolean

    If MMLs are paused, this value is true. Otherwise, this value is false.

  • Parameters

    • Optionalcallbacks: {
          endedCallback?(): void;
          errorCallback?(error: MMLSyntaxError): void;
          startCallback?(sequence: Sequence, offset?: number): void;
          stopCallback?(sequence: Sequence, offset?: number): void;
      }
      • endedCallback?:function
      • errorCallback?:function
      • startCallback?:function
        • Parameters

          • sequence: Sequence
          • Optionaloffset: number

          Returns void

      • stopCallback?:function
        • Parameters

          • sequence: Sequence
          • Optionaloffset: number

          Returns void

    Returns MML

  • This method starts designated MML part. Moreover, this method schedules next sequence.

    Parameters

    • partNumber: number

      This argument is part of MML.

    • Optionalhighlight: boolean

      This argument is true in case of surrounding by span.x-highlight HTML. The default value is false.

    Returns MML

    Return value is for method chain.

  • This method stops the all of MML parts.

    Returns MML

    Return value is for method chain.

  • This method converts MML to ABC Notation.

    Parameters

    • mml: string

      This argument is MML string.

    • OptionalX: number

      This argument is file number in ABC Notation.

    • OptionalT: string

      This argument is title in ABC Notation.

    • OptionalM: string

      This argument is beat in ABC Notation.

    • OptionalL: string

      This argument is note duration in ABC Notation.

    • OptionalK: string

      This argument is tone in ABC Notation.

    Returns string

    This is returned as ABC Notation.