/** * Set the tempo of the timekeeper * @param bpm The new beats per minute. */ public void setBPM( final float bpm ) { this.timecode = new MeasuresBeatsTicksTimecode( bpm, this.timecode.getMeasures(), this.timecode.getBeats(), this.timecode.getTicks(), this.timecode.beatsPerMeasure ); }
/** * {@inheritDoc} * @see org.openimaj.audio.timecode.AudioTimecode#toString() */ @Override public String toString() { return getMeasures()+":"+getBeats()+":"+getTicks(); } }
ap.setTimecodeObject( new MeasuresBeatsTicksTimecode( 140 ) ); new MeasuresBeatsTicksTimecode( 140,i,0,0 ), drums ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,5,0,0 ), bass ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,13,0,0 ), tb303 ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,17,0,0 ), tb303 ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,21,0,0 ), bass ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,21,0,0 ), tb303 ) ); for( int i = 21; i < 33; i+=2 ) seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,i,0,0 ), tb2205 ) );
/** * {@inheritDoc} * @see org.openimaj.time.TimeKeeper#getTime() */ @Override public MeasuresBeatsTicksTimecode getTime() { if( this.isRunning ) { // Update the current time. this.currentTime = (System.currentTimeMillis() - this.lastStarted - this.timeOffset); this.timecode.setTimecodeInMilliseconds( this.currentTime ); } return this.timecode; }
/** * {@inheritDoc} * @see org.openimaj.audio.timecode.AudioTimecode#toString() */ @Override public String toString() { return getMeasures()+":"+getBeats()+":"+getTicks(); } }
ap.setTimecodeObject( new MeasuresBeatsTicksTimecode( 140 ) ); new MeasuresBeatsTicksTimecode( 140,i,0,0 ), drums ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,5,0,0 ), bass ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,13,0,0 ), tb303 ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,17,0,0 ), tb303 ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,21,0,0 ), bass ) ); seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,21,0,0 ), tb303 ) ); for( int i = 21; i < 33; i+=2 ) seq.addEvent( new Sequencer.SequencerEvent( new MeasuresBeatsTicksTimecode( 140,i,0,0 ), tb2205 ) );
/** * {@inheritDoc} * @see org.openimaj.time.TimeKeeper#getTime() */ @Override public MeasuresBeatsTicksTimecode getTime() { if( this.isRunning ) { // Update the current time. this.currentTime = (System.currentTimeMillis() - this.lastStarted - this.timeOffset); this.timecode.setTimecodeInMilliseconds( this.currentTime ); } return this.timecode; }
/** * Set the tempo of the timekeeper * @param bpm The new beats per minute. */ public void setBPM( final float bpm ) { this.timecode = new MeasuresBeatsTicksTimecode( bpm, this.timecode.getMeasures(), this.timecode.getBeats(), this.timecode.getTicks(), this.timecode.beatsPerMeasure ); }