Old 07-23-2008, 09:01 AM   #1
HobbyCore
Human being with feelings
 
HobbyCore's Avatar
 
Join Date: Jun 2008
Posts: 126
Default Visual metronome?

Quite simple...

A black box that flashes red or yellow (user definable? for each beat? subdivide?) on the beat. Bonus points if it can be resized or full screened.


It'd be extremely useful for laying down initial drum tracks or bass in the studio when the musician is weary of wearing headphones or has difficulty controlling their dynamics and inflection with headphones on.

(os x!!)
HobbyCore is offline   Reply With Quote
Old 07-23-2008, 02:50 PM   #2
Youn
Human being with feelings
 
Youn's Avatar
 
Join Date: Jun 2006
Posts: 1,167
Default

Here's a simple JS plugin with beat division, blink fade time and basic color adjustment:

Code:
desc:Metronome Flasher

slider1:1<1,4,1{1,1/2,1/4,1/8}>Beat Division
slider2:250<100,1000,0.1>Fade (ms)
slider3:0<0,100,0.01>Color

@slider

slider1 == 0 ? speed = 1     :
slider1 == 1 ? speed = 0.5   :
slider1 == 2 ? speed = 0.25  :
slider1 == 3 ? speed = 0.125 ;

fadeLength = (slider2 / 1000) * srate;

fadeOutRate = 1 / fadeLength;

hue = slider3 / 100;
saturation = 1;
lightness = 1;

q = lightness < 0.5 ? lightness * ( 1 + saturation) : lighting + saturation - lightness * saturation;
p = 2 * lightness - q;

// calculate R value /////////////////////////////
t = hue + 1/3;
t < 0 ? t = t + 1;
t > 1 ? t = t - 1;

t < 1/6 ? r = p + (q - p) * 6 * t :
t < 1/2 ? r = q :
t < 2/3 ? r = p + (q - p) * (2/3 - t) * 6 :
r = p;

r = r / 2;

// calculate G value /////////////////////////////
t = hue;
t < 0 ? t = t + 1;
t > 1 ? t = t - 1;

t < 1/6 ? g = p + (q - p) * 6 * t :
t < 1/2 ? g = q :
t < 2/3 ? g = p + (q - p) * (2/3 - t) * 6 :
g = p;

g = g / 2;


// calculate B value /////////////////////////////
t = hue - 1/3;
t < 0 ? t = t + 1;
t > 1 ? t = t - 1;

t < 1/6 ? b = p + (q - p) * 6 * t :
t < 1/2 ? b = q :
t < 2/3 ? b = p + (q - p) * (2/3 - t) * 6 :
b = p;

b = b / 2;





@block
pTempo != tempo ? (
	fadeStep = ((tempo / 60) / speed) / 2;
	fadeStep = (fadeStep * srate) / 3;
	fadeLength = min(fadeLength, fadeStep);
	pTempo = tempo;

);


@sample

nBeat = (play_state & 1) ? floor(beat_position / speed) : -1;

cBeat != nBeat ?
(
	
	fadeInc = fadeLength;
	fl_r = r;
	fl_g = g;	
	fl_b = b;	
	cBeat = nBeat;
);

fadeInc > 0 ? (
	fl_r = fl_r - (fadeOutRate * r);
	fl_g = fl_g - (fadeOutRate * g);
	fl_b = fl_b - (fadeOutRate * b);
	fadeInc -= 1;
);



@gfx 400 150
gfx_a=1; // alpha 1.0

gfx_r = fl_r;
gfx_g = fl_g;
gfx_b = fl_b;

gfx_x = 0;
gfx_y = 0;
gfx_rectto(gfx_w, gfx_h);
Youn is offline   Reply With Quote
Old 07-23-2008, 04:44 PM   #3
Baer
Human being with feelings
 
Baer's Avatar
 
Join Date: Sep 2006
Location: San Francisco, CA
Posts: 335
Default

Youn, that's great. Thanks. HobbyCore, thanks for the original post. I talked with our drummer about the value of something like this last year -- he's a guy who uses a click all the time (recording, rehersal, and performance). He didn't think much of the idea, maybe because it cuts into his role as the timekeeper. But I think it can be quite useful.
Baer is offline   Reply With Quote
Old 07-23-2008, 05:57 PM   #4
HobbyCore
Human being with feelings
 
HobbyCore's Avatar
 
Join Date: Jun 2008
Posts: 126
Default

Quote:
Originally Posted by Youn View Post
Here's a simple JS plugin with beat division, blink fade time and basic color adjustment:

Code:
desc:Metronome Flasher

slider1:1<1,4,1{1,1/2,1/4,1/8}>Beat Division
slider2:250<100,1000,0.1>Fade (ms)
slider3:0<0,100,0.01>Color

@slider

slider1 == 0 ? speed = 1     :
slider1 == 1 ? speed = 0.5   :
slider1 == 2 ? speed = 0.25  :
slider1 == 3 ? speed = 0.125 ;

fadeLength = (slider2 / 1000) * srate;

fadeOutRate = 1 / fadeLength;

hue = slider3 / 100;
saturation = 1;
lightness = 1;

q = lightness < 0.5 ? lightness * ( 1 + saturation) : lighting + saturation - lightness * saturation;
p = 2 * lightness - q;

// calculate R value /////////////////////////////
t = hue + 1/3;
t < 0 ? t = t + 1;
t > 1 ? t = t - 1;

t < 1/6 ? r = p + (q - p) * 6 * t :
t < 1/2 ? r = q :
t < 2/3 ? r = p + (q - p) * (2/3 - t) * 6 :
r = p;

r = r / 2;

// calculate G value /////////////////////////////
t = hue;
t < 0 ? t = t + 1;
t > 1 ? t = t - 1;

t < 1/6 ? g = p + (q - p) * 6 * t :
t < 1/2 ? g = q :
t < 2/3 ? g = p + (q - p) * (2/3 - t) * 6 :
g = p;

g = g / 2;


// calculate B value /////////////////////////////
t = hue - 1/3;
t < 0 ? t = t + 1;
t > 1 ? t = t - 1;

t < 1/6 ? b = p + (q - p) * 6 * t :
t < 1/2 ? b = q :
t < 2/3 ? b = p + (q - p) * (2/3 - t) * 6 :
b = p;

b = b / 2;





@block
pTempo != tempo ? (
	fadeStep = ((tempo / 60) / speed) / 2;
	fadeStep = (fadeStep * srate) / 3;
	fadeLength = min(fadeLength, fadeStep);
	pTempo = tempo;

);


@sample

nBeat = (play_state & 1) ? floor(beat_position / speed) : -1;

cBeat != nBeat ?
(
	
	fadeInc = fadeLength;
	fl_r = r;
	fl_g = g;	
	fl_b = b;	
	cBeat = nBeat;
);

fadeInc > 0 ? (
	fl_r = fl_r - (fadeOutRate * r);
	fl_g = fl_g - (fadeOutRate * g);
	fl_b = fl_b - (fadeOutRate * b);
	fadeInc -= 1;
);



@gfx 400 150
gfx_a=1; // alpha 1.0

gfx_r = fl_r;
gfx_g = fl_g;
gfx_b = fl_b;

gfx_x = 0;
gfx_y = 0;
gfx_rectto(gfx_w, gfx_h);
How do I make use of this?

Thank you for it despite my ignorance.
HobbyCore is offline   Reply With Quote
Old 07-23-2008, 07:03 PM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,821
Default

Youn, that's awesome, but I think there's a technical limitation that's out of your control. The plugin code can't push a screen redraw to the window exactly when it wants it. Instead the @gfx code is called at something like 24 or 30 Hz, which gives up to about 8% timing error when the flasher is going at 120 bpm.

Even outside of the limitations of JS I think this would be a bit involved to pull off exactly right. Another problem (also no fault of Youn's) is that it's hard to follow a flashing metronome ... try it sometime!
schwa is offline   Reply With Quote
Old 07-23-2008, 08:17 PM   #6
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

Quote:
Originally Posted by schwa View Post
Youn, that's awesome, but I think there's a technical limitation that's out of your control. The plugin code can't push a screen redraw to the window exactly when it wants it. Instead the @gfx code is called at something like 24 or 30 Hz, which gives up to about 8% timing error when the flasher is going at 120 bpm.

Even outside of the limitations of JS I think this would be a bit involved to pull off exactly right. Another problem (also no fault of Youn's) is that it's hard to follow a flashing metronome ... try it sometime!
maybe something like "follow the bouncing ball" ???
Jae.Thomas is offline   Reply With Quote
Old 07-24-2008, 04:03 AM   #7
HobbyCore
Human being with feelings
 
HobbyCore's Avatar
 
Join Date: Jun 2008
Posts: 126
Default

Quote:
Originally Posted by schwa View Post
Another problem (also no fault of Youn's) is that it's hard to follow a flashing metronome ... try it sometime!
Completely disagree. I find it very easy to follow a flashing metronome given the flash is of enough contrast and lasts for 1/4 of the beat.
HobbyCore is offline   Reply With Quote
Old 07-24-2008, 05:59 AM   #8
moodswinger
Human being with feelings
 
moodswinger's Avatar
 
Join Date: Feb 2008
Location: Hells Eight Acres
Posts: 568
Default

HC-
I don't know if you've seen this,

http://www.dehaupt.com/SynthEdit/DH_Metronome.htm

I'm gonna guess yes, 'cuz I just found it thru a link on these forums (quickly looked for the thread again) the other day. But if not, maybe this will tide you over. Haven't used it myself but like I said someone here pointed to it.
Cheers,
MoodSwinger
__________________
And once upon a time, so pure and crystalline,
the sounds would change by what the MOOD defined.
....
if there's a sound you play, that doesn't fit today,
why not just play the bastard anyway.

Be Schitzophonic.
moodswinger is offline   Reply With Quote
Old 07-24-2008, 07:55 AM   #9
Youn
Human being with feelings
 
Youn's Avatar
 
Join Date: Jun 2006
Posts: 1,167
Default

Here's one that animates a line like a spinning clock. I think, compared to flashes and the traditional pendulum-type metronomes, the beat can much more easily be anticipated...

Code:
desc:Metronome Cycler

@block

t = ($pi * 2) * (beat_position - floor(beat_position));

@gfx 400 150
gfx_a = 1;

gfx_r = 1;
gfx_g = 1;
gfx_b = 1;

a = gfx_w / 2;
b = gfx_h / 2;
r = gfx_h / 2;

x = a + r * cos(t);
y = b + r * sin(t);

gfx_x = a;
gfx_y = gfx_h;
gfx_lineto(gfx_x, gfx_h-(gfx_h/6), 1);

gfx_x = a;
gfx_y = b;
gfx_lineto(x,y,1);
HobbyCore: To use these plugins, copy the code above into a appropriately named text file within the "Effects" folder in reaper. Then "Scan for new plugins" and it should find the file you just created!
Youn is offline   Reply With Quote
Old 07-24-2008, 08:03 AM   #10
Youn
Human being with feelings
 
Youn's Avatar
 
Join Date: Jun 2006
Posts: 1,167
Default

Quote:
Originally Posted by schwa View Post
Youn, that's awesome, but I think there's a technical limitation that's out of your control.
Yes, I'm really not sure how in-sync these things are. They seem shifted by a certain amount. Does this have to do with PDC by any chance?

In the clock-style metronome above, it seems to be very much on beat during play back. Perhaps that's just on my machine? When stopped and moving the cursor around it's like 1/4 beat behind.
Youn is offline   Reply With Quote
Old 07-24-2008, 08:12 AM   #11
HobbyCore
Human being with feelings
 
HobbyCore's Avatar
 
Join Date: Jun 2008
Posts: 126
Default

Quote:
Originally Posted by moodswinger View Post
HC-
I don't know if you've seen this,

http://www.dehaupt.com/SynthEdit/DH_Metronome.htm

I'm gonna guess yes, 'cuz I just found it thru a link on these forums (quickly looked for the thread again) the other day. But if not, maybe this will tide you over. Haven't used it myself but like I said someone here pointed to it.
Cheers,
MoodSwinger
I have seen it because someone suggested it...

But I'm on os x! Even in windows I really dislike using synthedit plugins. Thank you for the re-suggestion though.
HobbyCore is offline   Reply With Quote
Old 07-24-2008, 08:13 AM   #12
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,821
Default

This is great. The problem with a flash is that it needs to be redrawn exactly at the right time by the system to look right. But a moving object that your brain can anticipate gives you all the visual information you need to see exactly where the beat is, even if the screen doesn't happen to get redrawn exactly when the line is at the beat.
schwa is offline   Reply With Quote
Old 07-24-2008, 08:13 AM   #13
Youn
Human being with feelings
 
Youn's Avatar
 
Join Date: Jun 2006
Posts: 1,167
Default

Here we can tweak the speed and timing

Code:
desc:Metronome Cycler

slider1:1<0,4,0.01>Beat Multiplier
slider2:0<0,1,0.01>Timing Offset

@block
t = (beat_position+slider2) * slider1;
t = ($pi * 2) * (t - floor(t));

@gfx 400 150
gfx_a = 1;

gfx_r = 1;
gfx_g = 1;
gfx_b = 1;

a = gfx_w / 2;
b = gfx_h / 2;
r = gfx_h / 2;

x = a + r * cos(t);
y = b + r * sin(t);

gfx_x = a;
gfx_y = gfx_h;
gfx_lineto(gfx_x, gfx_h-(gfx_h/6), 1);

gfx_x = a;
gfx_y = b;
gfx_lineto(x,y,1);
I included the "offset" so we can line it up to the beat... not sure how else to get around it...
Youn is offline   Reply With Quote
Old 07-24-2008, 09:38 AM   #14
Youn
Human being with feelings
 
Youn's Avatar
 
Join Date: Jun 2006
Posts: 1,167
Default

OK, here's my latest offering, I just added some flare to it and a sorta burst on the beat, like this screenshot shows. Anyways, hope it works:


Code:
desc:Metronome Cycler

slider1:1<0,4,0.01>Beat Multiplier
slider2:0<0,1,0.001>Timing Offset

@block
t = (beat_position+0.5+slider2) * slider1;
t = ($pi * 2) * (t - floor(t));

@gfx 400 150

gfx_clear= -1;
gfx_mode = 0;
gfx_x=gfx_y=0;
gfx_a=0.999;
gfx_blit(-1,1.01,0.11);
gfx_blurto(gfx_w,gfx_h);


gfx_a = 1;

gfx_r = 1;
gfx_g = 1;
gfx_b = 1;

a = gfx_w / 2;
b = gfx_h / 2;
r = gfx_h / 2;

x = a + r * cos(t);
y = b + r * sin(t);

gfx_x = a;
gfx_y = gfx_h;
gfx_lineto(gfx_x, gfx_h-(gfx_h/30), 1);

gfx_x = a;
gfx_y = 0;
gfx_lineto(gfx_x, gfx_h/30, 1);

gfx_x = 0;
gfx_y = b;
//gfx_lineto(gfx_w, gfx_y, 1);


gfx_x = a;
gfx_y = b;
gfx_lineto(x,y,1);
Youn is offline   Reply With Quote
Old 07-24-2008, 10:05 AM   #15
moodswinger
Human being with feelings
 
moodswinger's Avatar
 
Join Date: Feb 2008
Location: Hells Eight Acres
Posts: 568
Default

HC-
Yeah sorry 'bout that I thought it might've been, given I just saw it and when you stated "os x", bam!! I remember you making that same point last time, sorry.

Youn-
Those are sweet!!
Rock on, Bro!!

Cheers,
MoodSwinger
__________________
And once upon a time, so pure and crystalline,
the sounds would change by what the MOOD defined.
....
if there's a sound you play, that doesn't fit today,
why not just play the bastard anyway.

Be Schitzophonic.

Last edited by moodswinger; 07-24-2008 at 10:08 AM.
moodswinger is offline   Reply With Quote
Old 07-25-2008, 11:41 AM   #16
HobbyCore
Human being with feelings
 
HobbyCore's Avatar
 
Join Date: Jun 2008
Posts: 126
Default

Hmmm...

It appears rather choppy on my screen. It's difficult to see where the beat is.
HobbyCore is offline   Reply With Quote
Old 07-28-2008, 02:43 AM   #17
darjama
Human being with feelings
 
Join Date: Nov 2006
Location: the Bay
Posts: 705
Default

try it at half speed, it will still connect on the downbeat with the tick at the bottom of the screen.
darjama is offline   Reply With Quote
Old 12-24-2008, 10:44 AM   #18
Evan
Human being with feelings
 
Join Date: Oct 2006
Location: Greece
Posts: 3,554
Default

+1 for a visual addition to the metronome. I prefer something visual that shows movement, like a pendulum, or a circle/clock like some have suggested. The audio and visual metronome parts should be selectable independently (e.g. audio only, visual only, or both).

You could perhaps model some hardware metronomes...

https://www.youtube.com/watch?v=73iO5F0daW0
https://www.youtube.com/watch?v=YK-k7FKOmgg

Last edited by Evan; 12-24-2008 at 10:49 AM.
Evan is offline   Reply With Quote
Old 12-25-2008, 03:45 AM   #19
synth
Human being with feelings
 
synth's Avatar
 
Join Date: Feb 2006
Location: Synthopia
Posts: 1,729
Default

Here are some YouTube videos of a simple-but-effective beat visualization.

I want something like this:

https://www.youtube.com/watch?v=lKOBoYGp_4w

https://www.youtube.com/watch?v=iby3lt-kHPM

You can see the four red bars above the tempo (BPM) indicator. Easy to follow and works like a charm.

Another cool feature will be to add small pictures to the tracks and media items (as seen in the second video).

If you're wondering what the heck this is - it's a DAW (?!) for the Sony PlayStation 1 game console (believe it or not).Very impressive.

I don't really like this kind of music (rave/trance,ugh!),but the videos are very fun(ny) to watch
__________________
Synth's consolidated FR thread: Loaded with some of the *hottest* features in DAW-land:

http://forum.cockos.com/showthread.php?t=22279

Last edited by synth; 12-30-2008 at 08:24 AM.
synth is offline   Reply With Quote
Old 12-25-2008, 02:11 PM   #20
synth
Human being with feelings
 
synth's Avatar
 
Join Date: Feb 2006
Location: Synthopia
Posts: 1,729
Default

Bump! Check the previous post. Added links to the videos.
__________________
Synth's consolidated FR thread: Loaded with some of the *hottest* features in DAW-land:

http://forum.cockos.com/showthread.php?t=22279

Last edited by synth; 12-25-2008 at 02:13 PM.
synth is offline   Reply With Quote
Old 12-30-2008, 08:15 AM   #21
synth
Human being with feelings
 
synth's Avatar
 
Join Date: Feb 2006
Location: Synthopia
Posts: 1,729
Default

Bump again.

It would be really nice to have something like this in v3
__________________
Synth's consolidated FR thread: Loaded with some of the *hottest* features in DAW-land:

http://forum.cockos.com/showthread.php?t=22279

Last edited by synth; 12-30-2008 at 08:19 AM.
synth is offline   Reply With Quote
Old 11-15-2017, 03:27 AM   #22
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Found this useful.
Anything better?
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Old 11-15-2017, 05:36 AM   #23
crimsonmerry
Human being with feelings
 
crimsonmerry's Avatar
 
Join Date: May 2013
Location: Jakarta, Indonesia
Posts: 190
Default

Quote:
Originally Posted by G-Sun View Post
Found this useful.
Anything better?
Have you tried the default "visual click"?
crimsonmerry is offline   Reply With Quote
Old 11-15-2017, 08:07 AM   #24
G-Sun
Human being with feelings
 
G-Sun's Avatar
 
Join Date: May 2010
Location: Norway
Posts: 7,318
Default

Quote:
Originally Posted by crimsonmerry View Post
Have you tried the default "visual click"?
Thanks for the tip!
__________________
Reaper x64, win 11
Composer, text-writer, producer
Bandcamp
G-Sun is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.