News:

SMF for DIYStompboxes.com!

Main Menu

Tempometer

Started by karbomusic, June 21, 2017, 03:59:52 PM

Previous topic - Next topic

karbomusic

Anyone interested in tempometers? AKA a unit where you can attach a trigger to a snare which calculates tempo of 1/2 notes et al? I'm designing one for my band with a 4" display that hangs on the wall for the entire band to see...



Yes, the one above has a problem (only visible on the scope in the bg). I've already fixed but it works wonderfully at this point. BTW the RGB LED displays whether the speed is trending slow, fast, or steady but haven't finished how I want to present in final build. I'll be 3D printing the enclosures and I'm going to embed the piezo in a EnviroTex block for mounting to the snare etc. Work in progress over the last two weeks, we'll see how far I get.

If all this continues to go well, it's possible I could make the trigger and display unit wireless but I decided to not even try until the hardwired version is working properly.

Basic flow: Piezo > Preamp > Comparator > Arduino Nano > Display

Side note: That Piezo you see on the bench isn't the one being tested, the one under test is attached to a hand drum just to the right of the video and I'm flicking the drum head with my finger.

R.G.

That was one of the functions in the Visual Sound Time Bandit. It's a fun add-on.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

karbomusic

Yea, snare triggered tempometers have been around since the 80s or earlier (aka beatbug we used to have waaay back then which we used constantly), I actually decided to build one due to featureset expansion and geek reasons. Didn't know about the TB though, cool.

GibsonGM

We've always used that dancing Coors Light can...  ;)
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

karbomusic

It was the bomb when I used one previously (20 years ago). It's the greatest band argument solver eva because no matter how good you are, people's tempo perception tends to ebb and flow based on headspace and mood. 

I doubt the demand is ever that high because too many band members tend to be scared of dealing with tempo in such clinical terms in fear of being exposed. :D Luckily my band is totally into it so having that display on the wall for all of us to see will be a great help as we prep for an upcoming recording session.

R.G.

The Time Bandit came out of a request from a band that liked having a beat reference too. They used MIDI click tracks to stay in sync (and if my experience is any guide, to keep the drummer on the rails  :icon_lol: ), but they wanted to set tap tempos to match the click track without the guitarist having to go manually (er, pedal-ly?) reset the tap devices. The TB would "listen" to the click track, and upon seeing it change, output a newly synched up tap sequence to tapped devices on its output, as well as showing beats per minute.

The insides were an incestuous combination of filtering, analog timing and programming to try and pick out the actual beat from an incoming audio click track. Drove me crazy for several months trying to get that one to run.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

karbomusic

#6
Quote from: R.G. on June 22, 2017, 11:47:33 AM

The insides were an incestuous combination of filtering, analog timing and programming to try and pick out the actual beat from an incoming audio click track. Drove me crazy for several months trying to get that one to run.

I bet!

I spun a little on the normal detection but mostly due to not paying attention LOL. Since no one asked, the problem in the video (see scope output) was a classic resistor misread. I had a gain of 100 which totally flat lined the waveform causing a stream of hundreds of "1s" out of the comparator. I fixed that and also wrote a sample and hold routine (that only runs when we detect a hit) on the microprocessor that follows the "maximum tempo to evaluate" variable. That way, the intelligent debounce/hold is always just short of the fastest tempo that gets evaluated. That worked around the over-gained issue but I obviously still the fixed the gain which brought me down to 20-30 ms anyway so all good so far.

There is also a configurable running average and a few other goodies such as the RGB LED tracking the speedup/slow down trend but I need to attach it to the average instead of instant like I am now. I may do wireless later (Bluetooth or Websockets) but for now, I'll just run a long wire cross the room and manually account for the voltage drop. Has been a lot of fun so far.

Transmogrifox

I made a stab at this once in software.  Relatively trivial with a constant beat but gets complex quickly when trying to track something that isn't always repeating the same pattern in each measure.

I had basically an array of frequency bins looking for the number of hits  within a given time interval.  Then the tempo was based on the bin that got the most hits in a given interval.

The number of bins was too coarse to give the tempo with any degree of accuracy so each bin averaged the actual time measured between triggers, so instead of being "between 80 and 85 BPM" it would further resolve that bin to a more precise center.

This works great for a relatively periodic beat pattern and was pretty workable with setting delay time for guitar as long as I was steady enough -- it's actually really good tempo training.  Probably would have worked better if I had done a proper auto-correlation on the output from envelope follower instead of an array of trigger timers.

I kinda stopped messing with it once it got to be "good enough".  I was thinking as a standalone unit that can give you graphical display, web and wifi capability would be a Raspberry Pi with a USB audio interface.  Then the analog section is just a preamp for the mic and the rest is just ASMOP as RG has expressed this tongue-in-cheek :)

Either way it looks like you're onto a good thing that's working reasonably well.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

karbomusic

Thanks Transmogrifox,

Nice idea on the bins. Yea, I was already used to the snare on 1/2 notes type thing so that's what I'll be using aka, just measure the backbeat and calc the tempo as we just really want to have an overall speedometer while rehearsing. There are some additional params such as MaxTempoAllowed and MinTempoAllowed that will throw out a bit of the noise and what's left we can deal with out of experience.

Since it requires so little I/O processor wise, I may actually drop this code onto an ESP8266 12E instead. The reason is that it will run this exact same code as-is but I can build a small web server on that same processor and WiFi to it with my phone without any other networking hardware involved. That will reduce the number of configuration options I need to expose with hardware. I'll just have it serve up a config web page.

Crap, if I do all that I might as well build in a logger so we can read it and weep after rehearsal. :D

Mark Hammer

Quote from: R.G. on June 22, 2017, 11:47:33 AM
The Time Bandit came out of a request from a band that liked having a beat reference too. They used MIDI click tracks to stay in sync (and if my experience is any guide, to keep the drummer on the rails  :icon_lol: ), but they wanted to set tap tempos to match the click track without the guitarist having to go manually (er, pedal-ly?) reset the tap devices. The TB would "listen" to the click track, and upon seeing it change, output a newly synched up tap sequence to tapped devices on its output, as well as showing beats per minute.

The insides were an incestuous combination of filtering, analog timing and programming to try and pick out the actual beat from an incoming audio click track. Drove me crazy for several months trying to get that one to run.
Ata recent meetup with Steve Bragg of Empress Pedals, and several other pedal guys, I brought up the topic of alternate ways of  producing tap tempo, and mentioned that my Lexicon MX-100 allowed me to set tempo/timing by doing a chunk-chunk-chunk on the muted strings of my guitar.  Steve noted that his delay pedals could also do that, but when he went into what was entailed in determining the underlying beat from an audio input, as opposed to a mere button-press, it got VERY complicated, very quickly, and entailed comparing successive FFTs and such.

karbomusic

Quotebut when he went into what was entailed in determining the underlying beat from an audio input, as opposed to a mere button-press, it got VERY complicated, very quickly, and entailed comparing successive FFTs and such.

First problem I ran into on the detector circuit design but I also had best-case scenario of it being a drum with a reasonable decay. Sample and hold tied to 'maximum allowed tempo' seemed to be the most functional and logical cure though since I did have the luxury of the sound actually ending before the next hit.

karbomusic

#11
She's pretty much a wrap, got a 20 foot wire with near zero voltage drop so that's how far the display can live from the trigger. The detector unit voltage can be increased if needed in case there were voltage drop. Either way here's a small summary...

3D printed a mold with a snare friendly curvature, then embedded the piezo in EnviroTex:






Detector unit as I was designing in Blender...




Ye ole PCB just before population...




Display enclosure just before final assembly...




Display enclosure complete...




Detector just before final assembly...



Detector complete...




And the result. It appears embedding the piezo cost me a good bit of sensitivity so I may redesign that or just use one raw with BlueTak. I was a little concerned about that but it does work. Yippie!!