Jump to content

How do you automate the tempo on a single midi track?


Zwamy

Recommended Posts

Hi there,

 

I'm currently working on a horror movie. In this movie I'm using a heartbeat for some suspension. I would like te increase the tempo gradually the more scary the scene gets. But I can't find anything to change and especcialy automate the tempo (nothing in Smart Controls or Midi Transform). It would be a lot easier to automate than move the midi blocks closer together.

 

So my question: how do you automate the tempo on a single midi region/track?

Link to comment
Share on other sites

Without adjusting the global tempo track (Which moves everything). Personally i'd either cut and then timestretch larger chunks of MIDI (i.e. their regions on the timeline) to step the speed up over time, i.e.:- Option+Drag the right/left side of the clipped region inwards.

 

Or, put the heartbeat on an arpeggiator and automate the tempo of that Arp, perhaps the plugin you're using for the heartbeat has such an option you can automate?

 

If you know the timings it may be much easier to just put the heartbeat into a seperate Logic project and use the global tempo track to ramp it up and export out as audio however.

Link to comment
Share on other sites

- Select All (but the heartbeat) Regions > Lock SMPTE Position

- Open the Tempo List

- Tempo Set: Duplicate Set

- Change the Tempo List so your heartbeat speeds up properly

- Select the heartbeat Region > Lock SMPTE Position

- Tempo Set: Restore the 1st tempo list

- Select All Regions > Unlock SMPTE Position

Link to comment
Share on other sites

Even better. ^^^^

 

I did find this old script I had laying around which might help. Put this Scripter script on the track where you have the heart beat. It won't start beating until you press a key on your keyboard and the actual tempo will be based on the pitch of the note you hit, which you can gradually speed up by hitting higher and higher notes..

 

I think this script could be modified to be smoother and react to automation rather the NoteOn events...but I don't have time to do it today.. and Fuzzfilth probably has the best suggestion anyway.

 

//
// Independent metronome, BPM based on pitch
//

//======= Customization ======

//var clickDuration = 150;
var clickPitch    = MIDI.noteNumber("C5");
var clickVelocity = 127;
var clickChannel  = 1;
var lowBpm        = 60;

//======= init variables =====

// Set up array of delay times in milliseconds
var gap = [];
for(var pitch=0;pitch<128;pitch++) {
   gap[pitch] = lowBpm/(lowBpm+pitch)*1000;
}

var metroActive = false;
var currentPitch;
var nextClick;

//=====================
// callbacks
//=====================

function HandleMIDI(event) {
       
   now = Date.now();

   //===============================================
   // Look for AllNotesOff message to stop metronome
   //===============================================
   
   if (event instanceof ControlChange 
           && event.number == 123) {
       //send AllNotesOff
       MIDI.allNotesOff()
       metroActive = false;
       nextClick = 0;
       return;
   }

   //===============================================
   // Look for a midi key to turn on metronome, 
   // pitch sets tempo    
   //===============================================
   
   if (event instanceof NoteOn) {
   
       Trace("Received ["+MIDI.noteName(event.pitch)+
             "] Setting metronome to "+
             (event.pitch+lowBpm)+" BPM");
       
       // If metro not yet active send first click 
       // and also schedule next one
       if(!metroActive) {
           sendClick(0);
           sendClick(gap[event.pitch]);
           nextClick = now + gap[event.pitch];
           metroActive = true;
       }
       
       // metro is already playing, skip first click, since
       // the next click is already scheduled
       // and calculate best place for future second one
       else if (now > nextClick) {
           var futureClick = nextClick + gap[event.pitch];
           sendClick(futureClick-now);            
       }
       
       currentPitch = event.pitch;
   }
} 


//====================================================
// if metronome currently playing, send a click only if needed
//====================================================
function ProcessMIDI() {
   
   if(metroActive) {
   
       var now = Date.now();
       
       // if we have passed the time of the next click
       // schedule the next one in the future
       if( now > nextClick ) {
           nextClick = nextClick+gap[currentPitch];
           sendClick(nextClick-now);
       }
   }
}

//========================
// support functions
//========================

var metronome = new NoteOn;
metronome.pitch = clickPitch;
metronome.channel = clickChannel;
metronome.velocity = clickVelocity;

//====================
// send a single click
//====================
function sendClick(msDelay) {
   metronome.velocity = clickVelocity;
   metronome.sendAfterMilliseconds(msDelay);
   metronome.velocity = 0;
   metronome.sendAfterMilliseconds(msDelay+(msDelay*0.333));
}
Link to comment
Share on other sites

Thanks for the replies. I followed skijumptoes advice. I went to the end of my project (where the tracks end) and I pasted my midi track behind it. Then I adjusted the project tempo and bounced the midi track.

 

An easy workaround that I didn't think about. Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...