Automated BPM with the Envelope Follower

Automated BPM with the Envelope Follower

Goal

Creating a way to derive the BPM from input of an instrument.

Limitations

To derive the beat from real audio material is beyond the capabilities of the Envelope Follower or the Tap-to-BPM built in to Gig Performer (and anyway those of mine, for that matter :thinking:). So the presented gig files are limited to determining the BPM from input before actually starting a song.

Design

At the heart is the Beat Detector scriptlet. This is a fairly simple scriptlet, just evaluating particular CC or Note messages. If a particular Note or CC message is detected, the parameter is ā€œbeat_detectedā€ is set or reset, depending on the velocity/CC value. That parameter is used in a rackspace script that executes the Tap() function of GP.
There are two ways of operating:

  1. Instruments with only audio signal (like electric guitars and everything that needs a microphone). In this case the Envelope Follower feeds the Beat Detector scriptlet.

  2. Instruments that have MIDI (note) output, like keyboards. In this case the MIDI input can be directly connected to the Beat Detector (if needed through a MIDI filter that only let notes pass thru).


    The wire view of the advanced version

Demo Gig files

I have created two examples to demonstrate how to use this:

  1. ā€œSimple Beat Detector.gigā€. This is a straight forward example.

    afbeelding
    Controls of the simple setup

    You connect your guitar or MIDI instrument, choose the right mode. CC for the Envelope Follower (CC is 7) or Note for a MIDI instrument (select the Note you wish to use). Then you just tap your guitar or hit the key of keyboard: you should see the ā€˜Beatā€™ light blinking for every tap. When you think the tempo is right, select the a ā€˜normalā€™ rackspace.
    The example has automated this somewhat: In Set List mode there are two (empty) songs with a song part that uses the Beat Detector rackspace. Iā€™ve added a song part ā€˜Noneā€™. This is to prevent starting Beat Detection when the song is initially selected. You can handle this as you seem fit.

  2. ā€œAdvanced Beat Detector.gigā€. This is a more advanced example, but it comes with more scripting. It relies on using Set Lists as well as the previous example. The main setup (Mode, Note/CC) are the same as with the simple example.

    afbeelding
    Controls of the advanced setup

    Main features: The Beat Detector has moved to the Global Rackspace and it automatically armed when you selected a song part with the name ā€œTap Counterā€ or ā€œAuto Tap Counterā€ (case sensitive!)
    If you select a song part with the name ā€œTap Counterā€, the audio outputs are muted (you have to route your audio to the Global Rackspace for benefiting from that). The rest is the same as with the simple example. After setting the BPM by tapping your guitar strings or hitting your keyboard, you have to select the next song part yourself.
    However, If you select a song part with the name ā€œAuto Tap Counterā€, the audio outputs are muted as well, but after when youā€™ve tapped or hit a full bar, it will automatically advance to the next song part. (You can influence the amount of taps by adjusting the song part signature and disabling it after doing that!)

    afbeelding
    Override the number of beats by adjusting the Time Signature. Note that the override itself is switched off

    This means for a signature of 4/4 you tap for times and the fifth time the next song part is activated. The fifth ā€˜tapā€™ should be your first real stroke on guitar. On keyboard you might need big hands to play your first real music and press the selected note :grinning:.
    The example uses the actions of the song part to automatically start the Play Head and/or sending a MIDI message to a (not included) sequencer:

    afbeelding
    The actions dialog associated with song part Intro

    Just for fun Iā€™ve added the MIDI file player. If you add a MIDI file to it, you can hear it auto start with the Play Head

Conclusion

The two examples are just that: Examples, but I hope it provides a starting point for setting the BPM without mouse or keyboard. (No: I mean that other keyboard :wink:.)

Advanced Beat Detector.gig (228.3 KB)
Simple Beat Detector.gig (179.8 KB)

5 Likes