2017-07-01 19:47:00

I'm frustrated with the FPS right now so I'm working on a ghost rider/avoidance style car evading game with HRTF with jumping over cars and stuff. Gonna be an easy game but hey, the webaudio API should make this sound pretty cool. smile
I think those really big projects aren't for me. I'd rather create a ton of small, fun games than one really big one that I have to constantly attend to. Especially since I'm running into issues counting walls between the player and a sound source to muffle them... For some reason...

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2017-07-01 22:04:09

Recently came across [HumbleNet], a free cross-platform network library for browsers that may prove useful.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2017-07-01 22:47:19

what engine/library are you using Ghorthalon?
I would prefer lots of little games that younger kids could play so I can introduce them to the keyboard and web browser through fun games.

2017-07-01 23:26:20

I don't really use much. I only use Sono because it makes webaudio a lot simpler to work with, but other than that only JQuery, even though that's almost unnecessary.
I'm getting further with the lane splitter clone thing, I'm going to open source it if anyone wants to take a look when I'm done. smile

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2017-07-02 20:33:25

wow, sono is way better than Howler and is exactly what I need. I was looking for something that combined tone.js and howler.js together. I need to be able to generate sounds and control their panning.
Do you know how to generate sounds like trumpet sounds with the controls sono gives? In my apps people really don't like the pure square and sign waves I use.

Also, for the sono/panner, how do you set the heading position of the listener? I see:
    panner.setListenerPosition(x, y, z);
    panner.setListenerOrientation(x, y, z);
but I didn't know your orientation could be set by x, y and z. I thought it was something like 90 degrees or 180 degrees.

2017-11-26 20:29:14

Sorry I keep necroing this topic. But this is still something I keep coming back to. Now I'm actually getting a reasonable distance with it. And I got to learn some mad webpack skills while I was at it.

@frastlin: My understanding is, from using things like Three.JS, that the orientation refers to what the listener's point of view is, i.e, where are they looking?

If you want them to look left, say, you'd probably do: setListenerOrientation(-1, 0, 0)

But then if they move, that might have to be tracked.

So what you might wind up with, is:

const playerX = 0, playerY = 0, playerZ = 0;

// as the player's perspective moves, track that in these variables and adjust the listenerPosition accordingly

// look left

sono.panner.setListenerOrientation(playerX - 1, playerY, playerZ)

This is all in theory, I'm working on a testbed to fully test this out. As well as a little engine for 3D sound that I hope to use.

Interesting that you said that about howler.js vs sono, what did you find the differences were?

2017-11-26 22:43:50

I've been actually using web audio daw:
https://github.com/rserota/wad

It is the whole web audio API in a very easy to use package. I don't remember sono, but howler only plays external sounds, you can't generate sounds. WAD allows you to generate very complex sounds and play external sounds at the same time. The hard part is building sounds to generate... You can also kind of ignore the Firefox not working, I only use it in Firefox and it works great.
I have not yet used the 3D panning yet, just the left and right panning. I don't see where to set the listener though.

2017-11-28 02:00:49 (edited by truecraig 2017-11-28 02:01:57)

Ah okay, what put you off sono, do you remember?

Looking at WebAudioDAW, it doesn't look like it has an orientation, only that you set the panning based on the orientation you're given. I hope I'm not doing it a disservice, but it looks like that's the case. So you'd move the sounds's location accordingly. I... think. Looks more complex than sono, but it seems like it has more features. Audiophiles would love this stuff.

I've practically grocked sono now, with the ONE vital exception of setting the orientation. I've got an example where I move the P.O.V around, another where I move a sound source around, and I'm now most of the way to building a quick and dirty endless runner game using sono and 3D audio. I must admit I do quite like sono.

I just haven't quite understood the moving the orientation. I've currently got a truck idling in front of my POV 10 units away. I do what I suspect should spin my orientation around... but it doesn't. It influences the sound in interesting ways... but it doesn't seem to move where the sound comes from, it still sounds like it's in front. I wonder if it's all still tied into Three.JS.

Wondering whether to share my code as jists... but I'd have to leave the sounds out. I'm currently low on sounds as I lost a whole bunch of mine due to hard drive failure and me being very silly and not backing up, so I'm... appropriating sounds elsewhere for now to play with this idea smile

2017-11-28 02:57:12

Sono doesn't allow for advanced control of oscillators which is needed if you don't want to have the user download a ton of sounds. The problem is that making a sound is not a walk in the park.
I'm going to open an issue on web audio daw to ask about setting the position of the listener. I do have a script that sets positioning quite well with just stereo, but I would rather use the 3D panning.

2017-11-30 22:51:56

Oh, so instead of playing sounds, you generate all your sounds using an ocelator? Is that worth it? I'd imagine it's quite limiting and you'd wind up with lots of bleepy and bloopy noises, but I never did that sort of side of audio editing, so I don't really understand it. Maybe I should leave ocelators well alone.

Yeah, I think that would make sense. It's probably a lot easier than you having to rotate your positions around the player always being based at 0x3 (x=0, y=0, z=0). Otherwise you're going to get really mathsy.

I understand the Sono 3D audio a... little better. I managed to get a truck sort of rotating around a stationary POV. Except... well... the right and left both ended up the same place. You need the Z of your orientation at -1 to get even that. I recently saw that sounds themselves can have an orientation too. I don't understand the purpose or the complexities here. I must be missing something. Any advice appreciated.

I'm finding with both of these libraries, that neither really has tons of traction. Proves that web audio is really a new thing Even the Three.JS docs and such like isn't massively well defined. Maybe that's a good thing for innovation in the space. But bad when you're just getting started

2017-12-01 11:32:59

Yes, with oscillators you just generate the sounds in the web browser on the spot. Here are some examples:
http://webaudio.prototyping.bbc.co.uk/gunfire/
gunshots

https://www.leshylabs.com/apps/sfMaker/
old Nintendo sounds

The theory is that you can generate any sound by adding together oscillators in different combinations. This is how screen reader synthesizers were created before we had companies like Ivona putting real voices into synths.
The problem is that making a single sound is incredibly difficult and there are little to no resources on how to generate sounds with oscillators. Practically speaking, unless you use raw oscillators a lot (like me), the promise of procedurally generated sound is still far off. But the ability for everyone to listen to a sound effect generated by their web browser makes this a field that will see some innovation very soon, just because generating sounds is so much faster than loading them.

2017-12-01 11:35:15

BTW, you access the listener object by accessing the audio context. In WAD it is Wad.context.listener. I haven't spent much time with it, so don't know too much about what all the params mean.

2017-12-13 21:39:15

@frastlin: Interesting. But then... if it's complicated and I can imagine the code to output it properly isn't small, does pulling down the code that makes the sound soon reach the size of the file itself anyway Or is there still a massive saving? Strings would still take up space, and it all has to come down sometime. But then I've not seen what ocelator code looks like. And you can always minify it.

Interesting to know, thanks! So you can move that around, right?

My first proper game rather than just monkeying around is done. I do need to find new running sounds for long term but apart from that it's there. Thought I'd share it here as it was kind of a product of our discussion and your suggestion to use Sono.

https://craigbrett17.github.io/audiogam … unner.html

It's just a little endless runner game and is really just for fun. It taught me a lot getting here, so it's helped me even if nobody really likes it. Don't know how widely to share or not.

2017-12-13 23:14:47

hahaha!!! I love it, it is like ciclepath. The background music is a little loud IMO, but it is great!

There is no way that a generated sound would be half as big as a wav file. The nice thing about them though is that you can change them really easy. For example, one goat could sound one way, and you could have another goat, with most of the coding, but one line change the goat to sound much deeper and with the vibrato farther apart. It is best for quick sounds like gun shots and footsteps though.

2017-12-14 02:50:49

Thanks for the feedback! I knocked the music volume down. I also did a lot of background work around minification and cache busting, you mentioned about sizes for files which prompted me to put the time into minification.

Ah when you say it that way it makes sense. And with wavs, 2 similar sounds would need all the size of each, whilst 2 similar sounding ocelator sounds would only need the difference between the first and second. So quite a bunch of space saving there. I might keep that as an option for quick sounds. Thanks. Useful to know.

2017-12-16 19:47:35

@frastlin, I was going to point you to an issue on the Sono project that asked for exactly what you're after. Then I realized you posted it smile

Looks like the maintainer is waiting for you on that one, if you were interested in seeing it in Sono.

I noticed it as I'm making a question issue asking about the rotation and listener orientation stuff. I've got a sort of example going... but it's not good yet

2017-12-16 21:54:31

I found Wad right after I posted that issue. I don't think it would be too difficult to write a wrapper for something like Sono to create oscillators, but I haven't spent the time reading through the web audio docs to figure out how it works. Wad was enough for me at the moment tongue.