Class SteadyBeats

    • Constructor Detail

      • SteadyBeats

        public SteadyBeats​(long anchorBeat,
                           long microSecondsPerBeat,
                           long duration,
                           int beatsPerMeasure)
        Steady beats with known time signature (beats per measure).
        Parameters:
        anchorBeat - one beat defined in microseconds
        microSecondsPerBeat - microseconds per beat
        duration - duration of the song
        beatsPerMeasure - beats per measure, i.e. numerator in TimeSignature
      • SteadyBeats

        public SteadyBeats​(long anchorBeat,
                           long microSecondsPerBeat,
                           long duration)
        Steady beats with unknown time signature (beats per measure).
        Parameters:
        anchorBeat - one beat defined in microseconds
        microSecondsPerBeat - microseconds per beat
        duration - duration of the song
      • SteadyBeats

        public SteadyBeats​(org.json.simple.JSONObject jsonObject)
    • Method Detail

      • getBeatsPerMeasure

        public int getBeatsPerMeasure()
        Description copied from interface: Beats
        Beats per measure.
        Specified by:
        getBeatsPerMeasure in interface Beats
        Returns:
        beats per measure or 1 if unknown
      • getAnchorBeat

        public long getAnchorBeat()
      • getDuration

        public long getDuration()
      • getMicroSecondsPerBeat

        public long getMicroSecondsPerBeat()
      • changeTime

        public Beats changeTime​(TimeSignature timeSignature)
        Description copied from interface: Beats
        Provide a view that reflects the given time signature and adjust beat numbers accordingly. If no beat number information is available at all, the provided view may be identical to the original view.
        Specified by:
        changeTime in interface Beats
        Parameters:
        timeSignature - time signature
        Returns:
        beat number adjusted view on the same beats
      • toJSONString

        public String toJSONString()
        Specified by:
        toJSONString in interface org.json.simple.JSONAware
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object