Package de.maramuse.soundcomp.events

Examples of de.maramuse.soundcomp.events.AbruptTempoChangeEvent


  private void prepareTimingData() {
  // search for the maximum "negative delay" because we need that to delay everything
  // else in the opposite direction
  maximumNegativeEventDelay=0.1d; // temporary solution until we really have a way of specifying
  globalTempo=new AbruptTempoChangeEvent(maximumNegativeEventDelay);
  globalTempo.setStartBpm(txt.getGlobalParameters().getStartTempo());
  globalTempo.setBeat(0);
  }
View Full Code Here


        String markname=((de.maramuse.soundcomp.parser.Setmark)pv).getMarkName();
        for(Voice vv:voices.values()){
          if(vv.getSynchronizeMark()!=null&&vv.getSynchronizeMark().equals(markname)){
          // stop waiting
          vv.setSynchronizeMark(null);
          TempoChangeEvent tce=new AbruptTempoChangeEvent(t);
          vv.setLastTimingEvent(tce);
          vv.setNextEventTimestamp(t);
          // TODO if the waiting voice is following global timing, it may now
          // have a random beat offset to global - we need to calculate this.
          if(vv.isFollowGlobal()){
            vv.setBeatOffsetToGlobal(v.getCurrentBeat()-globalBeat);// TODO calculate from last global timing event and current timestamp
            vv.setNextEventGlobalBeat(globalBeat);
          }
          }
        }
        }else if(pv instanceof de.maramuse.soundcomp.parser.TimingEvent){
        // accelerandi / ritardandi treated here
        ((de.maramuse.soundcomp.parser.TimingEvent)pv).setTempTimestamp(t
          +maximumNegativeEventDelay);
        TempoChangeEvent tce=((de.maramuse.soundcomp.parser.TimingEvent)pv).toTempoEvent();
        if(v.isFollowGlobal()){
          if(!(tce instanceof ReturnToGlobalTiming)) // ignore if redundant RTGT appears
          if(Double.isNaN(tce.getStartTempo())){
          System.out.println("changing global tempo");
          tce.setBeat(globalBeat);
          globalTempo=tce;// no start tempo given, take the current global tempo
          }
          if(tce.isVoicelocal()){
          // this voice now leaves global timing
          System.out.println("leaving global tempo");
          v.setLastTempoChange(tce);
          v.setFollowGlobal(false);
          }else{
          // the global timing is about to change
          }
        }else{
          if(Double.isNaN(tce.getStartTempo())){
          // no start tempo given, take the current local tempo
          tce.setStartTempo(v.getCurrentTempo(t));
          }
          v.setLastTempoChange(tce);
          if(tce instanceof ReturnToGlobalTiming){
          // calculate the beat offset of this voice compared to global beat
          // then return
View Full Code Here

  @Override
  public de.maramuse.soundcomp.events.TempoChangeEvent toTempoEvent() {
  TempoChangeEvent tce=null;
  switch(accelMode){
    case ACCELMODE_ABRUPT:
    tce=new AbruptTempoChangeEvent(tempTimestamp);
    break;
    case ACCELMODE_EXPONENTIAL:
    tce=new ExponentialTempoChangeEvent(tempTimestamp);
    break;
    case ACCELMODE_HARMONIC:
View Full Code Here

TOP

Related Classes of de.maramuse.soundcomp.events.AbruptTempoChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.