Class GlobalTrack

    • Constructor Detail

      • GlobalTrack

        public GlobalTrack()
    • Method Detail

      • getActiveWhen

        public Object getActiveWhen()
        Returns the ActiveWhen object.

        Define a condition for when a track should be active and not.

        Can either be a function callback or a configuration object.

        If a function is used, it should return a boolean for whether or not the track should be active. The function is called for each audio event, and receives a parameter object with time, and potentially point and value properties depending on the track. point is available if the audio event is related to a data point. value is available if the track is used as a context track, and valueInterval is used.

      • setActiveWhen

        public void setActiveWhen​(ActiveWhen activeWhen)
        Sets the ActiveWhen object.

        Define a condition for when a track should be active and not.

        Can either be a function callback or a configuration object.

        If a function is used, it should return a boolean for whether or not the track should be active. The function is called for each audio event, and receives a parameter object with time, and potentially point and value properties depending on the track. point is available if the audio event is related to a data point. value is available if the track is used as a context track, and valueInterval is used.

      • setActiveWhen

        public void setActiveWhen​(org.zkoss.json.JavaScriptValue activeWhen)
        Sets the JavaScriptValue of active when.

        Define a condition for when a track should be active and not.

        Can either be a function callback or a configuration object.

        If a function is used, it should return a boolean for whether or not the track should be active. The function is called for each audio event, and receives a parameter object with time, and potentially point and value properties depending on the track. point is available if the audio event is related to a data point. value is available if the track is used as a context track, and valueInterval is used.

      • getInstrument

        public String getInstrument()
        Returns instrument to use for playing.

        Can either be a string referencing a synth preset, or it can be a synth configuration object.

        Default: "piano"

      • setInstrument

        public void setInstrument​(String instrument)
        Sets instrument to use for playing.

        Can either be a string referencing a synth preset, or it can be a synth configuration object.

      • getMapping

        public Mapping getMapping()
        Returns the Mapping object.

        Mapping options for the audio parameters.

        All parameters can be either:

        • A string, referencing a point property to map to.
        • A number, setting the value of the audio parameter directly.
        • A callback function, returning the value programmatically.
        • An object defining detailed configuration of the mapping.
        If a function is used, it should return the desired value for the audio parameter. The function is called for each audio event to be played, and receives a context object parameter with time, and potentially point and value depending on the track. point is available if the audio event is related to a data point, and value is available if the track is used for a context track using valueInterval.
      • setMapping

        public void setMapping​(Mapping mapping)
        Sets the Mapping object.

        Mapping options for the audio parameters.

        All parameters can be either:

        • A string, referencing a point property to map to.
        • A number, setting the value of the audio parameter directly.
        • A callback function, returning the value programmatically.
        • An object defining detailed configuration of the mapping.
        If a function is used, it should return the desired value for the audio parameter. The function is called for each audio event to be played, and receives a context object parameter with time, and potentially point and value depending on the track. point is available if the audio event is related to a data point, and value is available if the track is used for a context track using valueInterval.
      • getMidiName

        public String getMidiName()
        Returns the name to use for a track when exporting to MIDI. By default it uses the series name if the track is related to a series. Default: null
      • setMidiName

        public void setMidiName​(String midiName)
        Sets the name to use for a track when exporting to MIDI. By default it uses the series name if the track is related to a series.
      • getPointGrouping

        public PointGrouping getPointGrouping()
        Returns the options for point grouping, specifically for instrument tracks.
      • setPointGrouping

        public void setPointGrouping​(PointGrouping pointGrouping)
        Sets the options for point grouping, specifically for instrument tracks.
      • isRoundToMusicalNotes

        public boolean isRoundToMusicalNotes()
        Returns the round pitch mapping to musical notes.

        If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.

        Default: true

      • setRoundToMusicalNotes

        public void setRoundToMusicalNotes​(boolean roundToMusicalNotes)
        Sets the round pitch mapping to musical notes.

        If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.

      • isShowPlayMarker

        public boolean isShowPlayMarker()
        Returns the round pitch mapping to musical notes.

        If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.

        Default: true

      • setShowPlayMarker

        public void setShowPlayMarker​(boolean showPlayMarker)
        Sets the round pitch mapping to musical notes.

        If false, will play the exact mapped note, even if it is out of tune compared to the musical notes as defined by 440Hz standard tuning.

      • getType

        public String getType()
        Returns the type of track. Always "instrument" for instrument tracks, and "speech" for speech tracks.

        Default: "instrument"

      • setType

        public void setType​(String type)
        Sets the type of track. Always "instrument" for instrument tracks, and "speech" for speech tracks.