Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Pitch / Bend samples in my cargame?  (Read 2132 times)
0 Members and 1 Guest are viewing this topic.
Offline Murdockian

Senior Newbie




Java games rock!


« Posted 2004-04-27 13:18:36 »

Hi there!

I'm deleveloping a cargame (2D seen from above driving around in a classic Amiga/C64-style)  and I'd love some nice engine sounds to accompany my cars as they accelerate... Thus; Bending / Pitching in Java? How does it work? Tutorials / Examples? Hints...?

Thanx in advance!
/Markus
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #1 - Posted 2004-04-27 18:19:02 »

Use my software synth which is in the making  Smiley
The tone generator can play any wave form, so you could create a loop of an engine sound (or use a preset wave form of course), plonk it in a tone generator and then you can simply control the pitch by setting its frequency parameter.

If you like I can send you the current version of the lib with a little test program.

Offline Murdockian

Senior Newbie




Java games rock!


« Reply #2 - Posted 2004-04-28 04:07:37 »

That would be nice - to see how its done;)

I'm one of those "I-need-to-understand-everything"-persons so I'd still like to read about the stuff you mentioned; Tone-generator and how and where and what and does Java offer any standard-features or do I have to make (or utilize yours) my own tone generator?

I once thought of something like using Java Sound Clip and read my wavs as a big byte []. Could I then pitch the sound by removing every 2:nd / 3:rd byte just as if I where scaling an image?

/Markus
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2004-05-02 20:42:31 »

Quote
I once thought of something like using Java Sound Clip and read my wavs as a big byte []. Could I then pitch the sound by removing every 2:nd / 3:rd byte just as if I where scaling an image?


Simply removing samples (in audio or images) might get close to what you want but it is "wrong".  You will get aliasing effects, unless you properly filter.  Do some research on digital signal processing and I'm sure you will find how to do proper filters.  This is not something that Java is suited for.  The best way to do it is using the vector instructions of whatever processor you are running on (MMX/SSE/SSE2 on x86,  Altivec on PPC, etc.), anything else will run MUCH slower than it should.

Offline ap_kelly

Junior Member




Java rocks!


« Reply #4 - Posted 2004-10-14 10:35:20 »

I too am also trying to write a car game, and I have been pondering how to get realistic engine noises as the car accelerates and brakes.

erikd, can you post your lib and tutorial somewhere so I can have a play.

Does anyone else know of a good way to simulate engine noise without having to load in wav files?

Thanks,

Andy.

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #5 - Posted 2004-10-14 20:41:21 »

http://www.movegaga.nl/80s/SoftSyn.zip

Look in the package org.modsyn.test for some examples.
The library is nowhere near finished and it's pretty much unoptimized, but it might still be useful.
I also should remove the multithreadedness of the thing.
Time, time, there's just too little of it  Roll Eyes

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #6 - Posted 2004-10-14 20:50:20 »

If you run TestFrame2, set the frequencies of the 2 very low but not exactly the same, set the PWM low, add some resonance, set the cut-off frequency of the filter quite low. Just fiddle with the sliders a bit and you should be able to get an engine noise without using samples.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (72 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (43 views)
2014-09-07 01:13:42

Longarmx (27 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!