Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Creating a graphical Metronome

Author
Message
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 27th Oct 2016 00:25
I am currently working on a graphic metronome. I have created a non graphic one pretty easily. Unfortunately, Making the graphic one is A LOT harder lol. I am struggling with how to have the pendulum swing match the beep. I am using 60 degree swing on the pendulum when the pendulum reaches 30 degrees positive or negative it plays the beep. I am moving the pendulum using the SetSpriteAngle and a simple y=y+2.5 The user can input the Beats Per Minute wanted. I am using the sleep command and dividing 60 by the requested Beats Per Minute and then dividing the answer by 24( I am moving the pendulum using y=y+2.5 so I divided 60degrees by 2.5 and got 24) then multiplied by 1000 to convert to milliseconds to use in a sleep command for the delay. I have uploaded the main.agc to help decipher this message. Thanks for any help

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Oct 2016 08:14
You could use tween commands to get the exact timing you need. the also have ease in and ease out options so you can get a more realistic swing.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 27th Oct 2016 11:55
Oh thank you! I havent programmed in 30 years so its been an uphill battle
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 27th Oct 2016 18:11
I cant find a lot of information on the tween commands or ease in and ease out. I cant find it in the tutorial guide. Anyway you could elaborate on them??

Thanks
Shane
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Oct 2016 09:35 Edited at: 28th Oct 2016 09:35
I wrote a tutorial that includes the Tween commands to shake the screen. Hopefully the demo will shed enough light on how to set up and use tweens...

https://www.thegamecreators.com/pages/newsletters/newsletter_issue_150.html#5
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 28th Oct 2016 20:59
Thank you so Much I really appreciate all the help!!

Shane
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 29th Oct 2016 15:03
Thank you Sir!!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 2nd Nov 2016 16:18
That's a good app idea you have there! I don't know if it is a big deal for you, but the beep is likely to get quantised with the refresh rate of the screen if using default sync. To get it really accurate, you might want to look into syncrate settings. (a 60hz quantisation wouldn't bother me personally, but I know people who it would).

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 3rd Nov 2016 02:47
Thank you CJB! Yeah I am running into that very problem with the refresh rate. I cant get reliable repeatable with the beep. If the Beats Per Minute are set to 108 I sometimes I get 107 sometimes 106. If you set the Beats Per Minute to 131 I cant get it past 128 beats no mater what I do! UGH

Thanks Again,
Shane
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Nov 2016 09:07 Edited at: 3rd Nov 2016 12:06
I think the most accurate way would be to set the Sync rate to 0, and also measure from the start of the program, not between beeps. If you measure between beeps, you magnify any inaccuracies.
I just created a quick test, I can get it accurate to within 0.2% (0.0009 of a second), although most of the time it is accurate to within 0.05% (0.0002 of a second).
Medialess, so no beep:



Edit: Slightly easier to visualise

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Nov 2016 13:10
Use + or - to increase/decrease BPM
...Must...stop...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 6th Nov 2016 15:50
Thank you so Much for Taking the time to write these examples!!!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Nov 2016 16:10
You are amongst people who live to solve problems
As soon as I read "I can't get reliable repeatable with the beep" I was drawn to the challenge.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Shaner
7
Years of Service
User Offline
Joined: 26th Oct 2016
Location: The Wild Wild West Of Arizona,USA
Posted: 11th Nov 2016 00:51
Well I'm glad there are folks like you!!!

Login to post a reply

Server time is: 2024-04-20 13:51:05
Your offset time is: 2024-04-20 13:51:05