What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

Metronome with large visual display

Official support for: sonicbirth.sourceforge.net

Moderators: dscro, makira

KVRer
 
6 posts since 30 Jan, 2008, from Seattle

Postby woodandwires; Wed Jan 30, 2008 12:50 pm

For live performance I am seeking a plug-in that would take the DAW (specifically Ableton Live) tempo and show a large visual display as a silent metronome - a bouncing ball swinging from one side of the screen to the other, for instance. I suppose it could even be a large slider moving up and down.

Is this sort of thing something I could tease out of SonicBirth's components?

Many thanks for any advice.

- Joel
KVRist
 
92 posts since 28 Nov, 2007

Postby dscro; Wed Jan 30, 2008 4:04 pm

that's a good one. I don't know. It sure would be useful though. I'll play around a bit tonight and see if that can be done.
KVRist
 
92 posts since 28 Nov, 2007

Postby dscro; Wed Jan 30, 2008 7:37 pm

OK, it can be done a couple of ways.

First you have to get the hosts tempo into Sonic Birth. The settings pane for the main circuit you build has an option called tempo and beat which adds . . . well, the tempo and beat as two adjacent inputs into the circuit. I haven't tried it in a host but my guess is that the beat input will vary between 0 and 1 with the latter indicating the beat. The tempo will just be the one number value that the current hosts temp is set to.

The easiest thing would be to use the beat input and do something like and have it act as a multiplier for something like a square wave that you get from the generators section of the module list. If the beat input varies between one and zero then you have a square wave of amplitude 0 and later 1 etc. Run it's output into a meter from the display section of the module list and make the meter settings tall and wide. Then it should flash every time the beat hits. You might nieed to play around with this idea a little, maybe use a "change slower" module from the misc. section of the list to get the meter to display anything long enough for you to see.

Other wise, you could use the tempo input to drive some oscillator at a certain frequency and use it's output to do a similar thing with the meter. It really doesn't matter what the thing sounds like since you'll never hook up the output of the circuit anyway.

Finally, if for some reason the beat and temp inputs don't work, you could always make a midi recorded click track in your sequencer program with a quantized kick drum for example, don't send it to any output in the DAW but put your SB plug on an insert of the track. Build an SB circuit that squares the incoming waveform and then square roots it, use a low pass filter to smooth it and then you have a basic level detector. Take the output of that detector and use a comparator like "greater" to set up an if statement like: if the level is greate than this, output 1, othewise output 0. Then send that to your meter.

Anyway, you should be able to get this to work without too much trouble. Let me know how it goes.
KVRer
 
6 posts since 30 Jan, 2008, from Seattle

Postby woodandwires; Wed Jan 30, 2008 7:58 pm

dscro wrote:OK, it can be done a couple of ways.

<snip>

Anyway, you should be able to get this to work without too much trouble. Let me know how it goes.


Many thanks! I'll give it a go. But I'm new to this, so don't let that stop anyone else from trying! ;-)

- Joel
KVRer
 
10 posts since 15 Feb, 2008

Postby chris_allen123; Tue Feb 19, 2008 6:16 am

The 'tempo' is, as you quite rightly said a fixed numerical value of whatever the master tempo is and the 'beat' input updates every bar, and counts the number of beats which have passed.

E.g.
at b.1 bb.1 = 0, at b.2 bb. 1 = 4, at b.3 bb.1 = 8, at b.4 bb. 1 = 12

The problem is that it would only be possible to get the metronome to 'move' once every bar, unless the variance in the values changing can be used as some kind of clock, from which 1/4 notes could be derived...

Just some info for those with more experience with SB (who would probably know this already!!).

Chris.
KVRer
 
10 posts since 15 Feb, 2008

Postby chris_allen123; Tue Feb 19, 2008 2:09 pm

Here's what I've managed so far. I've tried it and theres a few things I'm not sure about (which pretty much equate to 'the whole thing, anyway...

The patch functions as follows:

BPM In
/60
Result (lets call it 'r') sets the frequency of a sine wave oscillator
(Greater object: If a>b output c, else d)
r connected to a
constant of 0 connected to b
(if r>0)
constant of 1 connected to c
(then output 1)
constant of 0 connected to d
(when the tempo is 0 (which it is for a split second before the transport begins to move), output 0)

Causes the meter to display 1 at a rate determined by the tempo, I think...

I'm not sure if dividing 120/60 (for eg) gives an accurate enough trigger for the osc. It does restart when playback begins, so it starts at the right time but appears to be slightly behind the tempo of the host, not by much though, which made me think I was on to something.

I wonder if the problem could be:
a) audio latency
b) visual processing latency
c) me being plain wrong with this
d) a combination of the above

I hope this helps / spurrs further contributors on. Feel free to tear my work to SHREDS!

Chris.

The .sbc file
http://rapidshare.com/files/93256790/Metronome.sbc
KVRist
 
92 posts since 28 Nov, 2007

Postby dscro; Tue Feb 19, 2008 6:51 pm

OK I got it almost working but I'm working with bars and not individual beats. I took a different approach from yours, though. After thinking about my initial suggestion of using the tempo input I realize that that probably isn't going to work well. It's fine for short delay plugs, but by bar 20 or something in a song I can't imagine that your DAW and the plug are going to be really synced just because that plug grabbed the tempo value. It won't work, which is why yours seems to be close to the beat but maybe drifting.

Using the beat input is a better approach. But as chris_allen123 mentioned, the beat count just keeps incrementing so unless we could find a way to make the plug flash something based on the change in the number it wouldn't work. The "direction" element will do this for you (it's in the algebra section of the menu. It outputs a 1 if a signal value is increasing, a -1 if it's decreasing (we don't care about that) and a 0 if it's constant.

So take the beat input and run it into this direction module. BUT FIRST, make sure you insert a "change slower" module before the direction element. Find the "change Slower" element in the misc. category. Set it to 100. If you don't do this then the change in the beat number that happens will be too quick and will be missed by the direction element.

This will at least get you a flash on every bar. As Chris says, the beat input only updates once per bar and jumps by 4 when it does. So now my thought is to use the tempo input and trigger a timer to derive the quarter notes as per Chris' suggestion. That timer will reset each time a new bar triggers it. Then I'll use the tempo input to tell the timer what the quarter notes are. Since the timer is reset every bar it will stay well synced with your DAW.

Should have it finished within an hour. I'll post back later.
KVRist
 
92 posts since 28 Nov, 2007

Postby dscro; Tue Feb 19, 2008 7:25 pm

It's finished and working. Download the sbc file beat_metronome_test.sbc at dscrofani.junker.org

A couple of notes: I used sub circuits for fake beat and tempo inputs. Replace these with your actual inputs. I haven't exported it to AU or VST to test there with an actual DAW, hence the fake inputs. The file uses a 120 bpm example.

There's an annoying first flash from the beat meter. I was too lazy to debug it. Also, one measure must pass before beats are counted. This shouldn't be a problem though.

It's not graphically pretty but maybe someone else can fix that.

If interested in the details: I used the method described in the post above where the bar click/flash resets a timer that generates quarter notes derived from the DAW's tempo. I used a floor integer function, a change slower module and a direction module to do this. The absolute value function in the plug is also needed because on timer reset, the direction module sees 4 going to 0 and outputs -1.

The key to getting the quarter note timer to reset correctly was using the delay to the one of the trigger module's inputs.

Let me know how it goes for you.
KVRer
 
6 posts since 30 Jan, 2008, from Seattle

Postby woodandwires; Sun Feb 24, 2008 11:34 am

OK, yet another approach:

Ignore the tempo and channel outputs. In the SB design interface, no need to load an audio sample, just enable "loop," press "start" and the "beat" output begins.

"Beat" output just counts beats at the tempo rate from the beginning of playback, but a "display value" element doesn't show round numbers for some reason. So route beat output to "nearest integer" element and the display is well-behaved: 1,2,3,4,5,6,7,8,9. . .

One option is to have the metronome display beats within a measure: in 4/4 time, 1,2,3,4,1,2,3,4,1,2. . . So we have to start counting again at the beginning of each measure. Take the "nearest integer" output and apply it to the "modulus" element, with a "constant addition" element providing the number of beats per measure, in this case 4. Now the output of "modulus" will count 0,1,2,3,0,1,2,3. . .

Another "constant addition" element set to "1" will correct the count to 1,2,3,4,1,2,3,4,1,2. . . Set a "display meter" element for a minimum value of 0 and a maximum value of 4. Now we get a fairly well-behaved bar graph display.

Next I export the file as AU, and insert this metronome component in an audio track of my DAW, Ableton Live. I click to display the interface for the AU, and no display meter appears. WTF? :-P

The file is available at
http://download.yousendit.com/2E9ADABD1907772A

A tweak would be to allow user selection of the "beats per measure" number, for different time signatures. Alternatively, the display could show just 0,1,0,1,0,1. . . or 1,2,1,2,1,2,1. . . which would be independent of time signature.

But if the display won't display in Live, then for me this whole exercise is for naught.

Thanks for all the ongoing interest in this project.

- Joel
KVRAF
 
3522 posts since 28 Jun, 2004, from Venezia - Italy

Postby dreaddd; Sun Feb 24, 2008 4:18 pm

not sure, but i think there's one plug by Xoxos that should do exactly a visual metronome..
Peace
www (dot) dubadelica (dot) com
Food for woofers since 1996
KVRer
 
6 posts since 30 Jan, 2008, from Seattle

Postby woodandwires; Sun Feb 24, 2008 5:07 pm

Indeed, "blinker" looks like a solution for PCs. Alas, I've got a Mac. Blinker is made with synthedit, which is also only for PCs.

- Joel
KVRist
 
92 posts since 28 Nov, 2007

Postby dscro; Sun Feb 24, 2008 5:10 pm

I thought the beat output only changed once per bar and not on every beat, so that it looked like this 1, 5, 9 . . . etc. But if it's giving you quarter notes already then the modulus operation is the way to go.

I don't know why you're not getting a meter showing once the plug is exported as AU. I never have had any problems getting meters to show in exported plugs. I'm using Logic 7 and 8, though.

I'll try your plug in Logic ASAP and let you know what I see.

Moderators: dscro, makira

Return to SonicBirth