Log In  

I was working on a game where cars run across the screen at various speeds, and I created a doppler-sounding effect to play when the cars were spawned. This didn't sound terribly natural though, since the cars all sounded the same regardless of speed. The only solution I found was to create a handful of effects these effects, and then choose the appropriate one based on speed, meaning all fast cars (i.e. velocity above some value) would have one sound effect, all slow cars another, and then a third one for those in between. Got me thinking though, it would be great if I could write a function that took the velocity as an argument and returned an appropriate sound effect. Is this possible? I'm fairly new at this, so it may be documented, but if it is I just don't understand the documentation. :)

That's a specific example, but it also got me thinking more generically. Is there a way to generate music on the fly? In the simplest case it could mean writing a few patterns in the tracker, and then playing one or more at a time, semi-randomly. They would be written in the same key presumably, but otherwise the only randomness is the order they appear in (and/or the channel they appear on).

At the other end of the complexity spectrum would be to generate the patterns procedurally as well, either by writing into the tracker, or manipulating sound in some other way. I don't really know where to start.

So I thought I'd start a discussion. Anyone experimented with any of the above? Any ideas how to tackle this?

P#50507 2018-03-17 07:00 ( Edited 2018-03-18 07:12)

1 - no
2 - yes, just peek/poke sfx/music memory banks

P#50512 2018-03-17 08:36 ( Edited 2018-03-17 17:29)

You can change sfx while they are playing (with poke) and you will hear it right away. So you can e.g. change pitch of an engine sound. (See the wiki or https://www.lexaloffle.com/bbs/?tid=2341 for the memory addresses and layout which helpful people have figured out :)

If you change patterns while they are playing, it doesn't take effect until next time the pattern plays, from what I remember last time I tried.

So that's one distinction to note.

P#50534 2018-03-17 14:16 ( Edited 2018-03-17 18:21)

Nice, seems like this is what I'm looking for.

Will try it out, thanks!

P#50553 2018-03-18 03:12 ( Edited 2018-03-18 07:12)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-16 18:16:01 | 0.019s | Q:11