Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
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  
  Forest audio ambience  (Read 18083 times)
0 Members and 1 Guest are viewing this topic.
Offline philfrei
« Posted 2016-11-09 04:08:10 »

forestambience.jar



@ags1 will recognize this!

I thought I'd go ahead and post this "in progress" audio jar. Much to do still but I think it gives a good demo of what is achievable using Java to create ambient sound for a game. This jar is just 1MB, and on my PC registers around 1% CPU when active.

I set this up for two soundscapes: one for day and one for night. There are various effects that contribute. Hit "Play Day" or "Play Night" to hear the mixes I hard-coded. Change the sliders and hit "Save" and the mix can be recalled (during the session only, I didn't do save to file yet for this).

Nothing is being looped in the normal sense. All the sounds have random elements so the background sound should never repeat exactly (astronomical odds).

A couple of the sounds are synthesized. Most come from fragments of SF/X gleaned from freesound.org. I'm running them via classes that schedule varied playback in various fashions. The wind, for example, uses a "continuous slicing" technique combined with a low frequency random wave for the volume. Some of the fragments are played back at semi-random time intervals with slightly different pitches/volumes/pans. The woodpecker has been broken into start/middle/end and the middle is repeated a variable number of times. There's lots of little tricks like that.

The simple GUI sliders correspond to api inputs, one per each SFX, with ranges from 0..1.

On the TODO list: ability to code one's own "behavior" for the SF/X "creatures", in particular, to set up a parameter for timing/likelihood. Also, figure out some better timing behavior algorithms! When left on for a longer period, some of the SFX start to wear out their welcome, as well as could do a better job of suggesting a real living creature is making them.

I was working on a low-to-moderate intensity wind/rain combo cue to add to this, and had an idea for a low-frequency noise wave that seemed kind of neat: random number-generated line fragments with multiple box filter passes to round the corners. I'm experimenting with that right now, sped up to audible rates rather than low-freq, as a cheap way to make gunshots/explosions/engines/etc. The box filtering seems to lack any Q but there are still things that can be done, and box filters are computationally really cheap.

To go with the rain, I also have a pair of thunder SF/X. I was in the middle of writing code to allow generating variable-length thunderclaps by mixing slices from the two cues. I think it is going to sound pretty cool but the original cues are somewhat "distant" in quality, so no super-close dramatic claps will be available from this source.

Anyway, the idea is more to suggest what is doable with no budget, and what could be possible with a decent budget for effects and skilled sound design.

A couple audio wavs that J0 recorded for me (posted below):
forest day wav
forest night wav

Further down the PeacefulBrook jar is mentioned -- here are two recordings I was able to make (thank you J0 for the help!) of two "endless" components -- each is an original recording of about 4 seconds played via a "slicer" tool, thus always changing rather than looping:
endless brook ogg (recorded nearby Cerrito Creek--could definitely use a less noisy initial recording)
endless campfire ogg (from a freesound.org cue, I'm pretty sure it was #170247, with some processing)

music and music apps: http://adonax.com
Offline Archive
« Reply #1 - Posted 2016-11-09 04:09:59 »

this is really cool, the frog and the crickets playing at the same time sounds weird

Offline philfrei
« Reply #2 - Posted 2016-11-09 05:05:41 »

Thanks!
It's a simple matter to turn one or the other up or down.
At the local creek it is possible to hear both. (El Cerrito CA, where I recorded the frog and the creek noise used in another demo).
But I can see probably that in most places it might be one or the other.

music and music apps: http://adonax.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline J0
« Reply #3 - Posted 2016-11-09 21:37:59 »

This is impressive! I'd add a water stream somewhere Smiley

Offline philfrei
« Reply #4 - Posted 2016-11-09 23:54:24 »

This is impressive! I'd add a water stream somewhere Smiley
Smiley
I did a brook earlier! The following jar also has an endless campfire and procedural windchime (as well as an earlier iteration of the frogs and crickets).
http://hexara.com/peacefulbrook.jar
The file is a bit larger (around 2.5 MB) because I used wav files with zip compression instead of ogg. I should redo this. The size would be something like 4x's smaller.

If I had a game to put them in, a new jar with a single api would be set up, of course.

music and music apps: http://adonax.com
Offline Riven
Administrator

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2016-11-10 19:04:27 »

Why don't you share some of the generated audio as files.

For games we have screenshots, to lower the effort of getting a feel for the project - same could be done here (i'm on my phone, couldn't run a jar to save my life...)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline thedanisaur

JGO Knight


Medals: 59



« Reply #6 - Posted 2016-11-10 19:24:58 »

This is fantastic! however, the crickets are really annoying they overlap/get out of sync creating a wavy effect...

Every village needs an idiot Cool
Offline philfrei
« Reply #7 - Posted 2016-11-10 20:27:33 »

Quote
Why don't you share some of the generated audio as files.

Has anyone set up Audacity to capture the output from a Java file?

If I knew how to set that up, that would be the easiest way to go. I'll have to poke around and figure out how Microsoft is routing things. Yeah, I'm claiming to be a "sound guy" but I kind of clumsy/ignorant with OS routing and stuff like that. I've put most of my energy into coding within Java context, not OS configuration.  Tongue
[Stupid: the unit I bought for i/o only has low impedance inputs and my main mixer doesn't have these as outs, so I can't run the sound out and back in without swapping the mixer being used. And the miniplug stereo mike ins aren't working for me as an alternate path.]

Alternatively, I could add some code I wrote elsewhere to capture and export, but it will take a little while to implement.

I'll add this to the queue, since there is positive interest and a direct request!

[I just got my "ClipSectionChainer" working, a first test where it is taking fragments (via pointers into) from three different clips and chaining them together into a single play. Am using it to append/crossfade two thunder recordings and a thunder-fading away ending, making a nice long multistaged roll. Want to test more radical sectionings to see if I can vary the thunder enough so that the underlying recordings are not obvious. Looking forward to putting up the "rain" jar soon, too.]

music and music apps: http://adonax.com
Offline philfrei
« Reply #8 - Posted 2016-11-10 20:41:28 »

This is fantastic! however, the crickets are really annoying they overlap/get out of sync creating a wavy effect...

I've had other comments on the crickets, as well, wishing to tweak them.

I spent some time on a hillside a while back, listening to the crickets and it seemed to me they weren't particularly paying attention to each other. When a lot of them get going, I think there IS a lot of overlap and sync changing and phasing effects. We do have to avoid comb-filtering! With really large populations (memories of visiting relatives nearby to Baton Rouge as a kid) the sound can be very intense.

But even if one achieves veracity, that doesn't mean that this is what will "reads best as a cue in a game or as an SF/X in a film.

The controller I wrote for the individual crickets is called a "SoundBlinker". It is set to take a number of sources and occasionally stop and restart them, the odds and length of times being determined by parameters to a random number generator.

It seemed to me that having a cricket occasional pause or skip a 'crick' would be a good thing. But doing this can also call attention to the cue. Getting the right balance of activity seems tricky, and probably varies with the environment and desired dramatic tone.

tldr: There is a tool to change settings which may make it more to your liking.

music and music apps: http://adonax.com
Offline thedanisaur

JGO Knight


Medals: 59



« Reply #9 - Posted 2016-11-10 21:10:35 »

I've setup reaper to record windows sounds in the past, I remember it being pretty easy. Not sure about audacity though.

About the crickets, I didn't mean to come off as harsh as I'm sure it is difficult! Also, I don't tend to pay that much attention to them so I'm sure you're right.

Every village needs an idiot Cool
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #10 - Posted 2016-11-11 07:56:16 »

I've setup reaper to record windows sounds in the past, I remember it being pretty easy. Not sure about audacity though.

About the crickets, I didn't mean to come off as harsh as I'm sure it is difficult! Also, I don't tend to pay that much attention to them so I'm sure you're right.

No worries. I hope I didn't sound like I was getting really defensive.

And I didn't mean to make it sound like it is all that difficult, at least from the point of view of being able to tweak things. There are probably some super-geeky SF/X ninjas that really know their insects and would be able to tell us just how to do it and have it be this or that species or genus and at such and such an altitude and temperature. But if one has a clearly defined model, it shouldn't be too hard to match it or fake it.

Reaper looks interesting. I already have Sonar but it is on another PC that has kind of been mothballed (no keyboard or monitor or internet connection.) I recall having to send a line out and back in for that too (and watching out for feedback). Not sure what I did with the connectors for it.

If someone wants to make a recording and post it on this thread, that would be appreciated!

[For the "wind/rain/thunder", I now have the GUI set up, and the ClipSectionPlayer tool debugged, and have been experimenting with chaining slices of thunder, playing them back at different speeds. I think it is going to work. Am working on the auto-generator for the thunder, setting it up so that each clap is unique.]

music and music apps: http://adonax.com
Offline J0
« Reply #11 - Posted 2016-11-11 09:50:15 »

You can use Audacity to record windows sounds, and it's quite easy too Smiley If you want me to record a sample from your jars please let me know, I'd be happy to help you this afternoon or during the weekend.

Offline philfrei
« Reply #12 - Posted 2016-11-11 18:03:19 »

Quote
You can use Audacity to record windows sounds, and it's quite easy too Smiley If you want me to record a sample from your jars please let me know, I'd be happy to help you this afternoon or during the weekend.

That would be great! After you post, I can put the links provided into the first post and credit you.

An explanation of how to set up Audacity to do this could also go in one of our tutorial or resource sections.

music and music apps: http://adonax.com
Offline J0
« Reply #13 - Posted 2016-11-11 19:58:02 »

And I'm done Smiley To record sounds using Audacity, the only thing you need to do (assuming your jar is the only process actually outputting sound on your computer when you do so) is to select Windows WASAPI as the 'Audio Host' (right under the Pause and Play buttons), then hit Record.. At least this is what works for me!

Here are the 3 recordings I made (~30 seconds each; sorry if they're not loud enough, too):
Forest Ambience - 'day' preset
Forest ambience - 'night' preset (I don't think I got a single fox howling, too bad..)
Peaceful Brook

These files are currently on my DropBox; I don't mind if you directly use these links, but I might at some point delete them (quite unlikely though). Wink

Oh, also, don't worry about giving me credit for these hahah, I don't deserve any; all I did was record your jars for you!

J0 Smiley

Offline philfrei
« Reply #14 - Posted 2016-11-11 22:03:55 »

Thanks, J0! I will try your instructions. It is my own fault I set the default volumes on the gui's too conservatively. If I can I will redo and post audio--meanwhile will use your links.

music and music apps: http://adonax.com
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (463 views)
2019-09-04 15:33:17

hadezbladez (5322 views)
2018-11-16 13:46:03

hadezbladez (2249 views)
2018-11-16 13:41:33

hadezbladez (5597 views)
2018-11-16 13:35:35

hadezbladez (1164 views)
2018-11-16 13:32:03

EgonOlsen (4600 views)
2018-06-10 19:43:48

EgonOlsen (5474 views)
2018-06-10 19:43:44

EgonOlsen (3138 views)
2018-06-10 19:43:20

DesertCoockie (4033 views)
2018-05-13 18:23:11

nelsongames (4782 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04: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!