Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Lightshow #327345
06/05/10 23:17
06/05/10 23:17
Joined: Aug 2008
Posts: 32
Y
Yannick Offline OP
Newbie
Yannick  Offline OP
Newbie
Y

Joined: Aug 2008
Posts: 32
Hi! I have some music in my game. Each song have a constant bpm (beats pro minute). I added some models with alpha textures in my level (thats my spotlights).

Now my problem:

If I play my music, the spotlights (models) should be rotate exactly to the beat(speed) of the current song, like a lightshow or a music-visualization.

Its a time problem, because the frametime in the engine is variable and I need a constant time for my beat.

I thought, that an equalizer is very helpful for this. I find "Fmod wrapper", but I cant download it.

Can someone help me?


Regards

Re: Lightshow [Re: Yannick] #327349
06/05/10 23:32
06/05/10 23:32
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You can adjust the timing very close with time_step. Don't use time_frame for this. Also total_ticks could be helpful for your problem.


Always learn from history, to be sure you make the same mistakes again...
Re: Lightshow [Re: Uhrwerk] #327439
06/06/10 11:58
06/06/10 11:58
Joined: Aug 2008
Posts: 32
Y
Yannick Offline OP
Newbie
Yannick  Offline OP
Newbie
Y

Joined: Aug 2008
Posts: 32
Yes, I test it with time_step in the next time. ;-) But I dont understand, why is the total_ticks helpful for my problem? Can u give me an example code ?

Regards

Re: Lightshow [Re: Yannick] #327457
06/06/10 13:43
06/06/10 13:43
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
total_ticks counts the number of ticks, ie.e 16st of seconds, passed since game start. So if you have a track with 120 bpm this makes 2 beats per second, i.e. you have a beat every eight ticks. You can now switch your lights by watching if total_ticks modulo 16 is greater than 8 or lower. Switch it off for lower values and on for values greater than 8. This way you get a light, that is off for the first beat and on for every second beat.


Always learn from history, to be sure you make the same mistakes again...
Re: Lightshow [Re: Uhrwerk] #327467
06/06/10 14:52
06/06/10 14:52
Joined: Aug 2008
Posts: 32
Y
Yannick Offline OP
Newbie
Yannick  Offline OP
Newbie
Y

Joined: Aug 2008
Posts: 32
many thanks


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1