Download

Piano Audio Design/Functionality

First things first: I’m a beginner when it comes to sound design and I use the UE with Blueprints only.

Right now I’m designing an App for VR in which you can play a piano by hitting Static Mesh Actors with your Hand Mesh. The Piano Keys then fire a Hit event playing a Sound Wav file.

At the moment I get these from an Array and start them by “Play Sound at Location”. This seems like a very basic version of what you can do in UE in regards of sound design and already leads to slight distortion in sound when playing multiple sounds at once. There is also a function for Major and Minor chords, playing additional sounds from the same array. It is already not working as intended (my guess is, as stated, multiple sounds playing at once again. If I play regarding sounds single-handedly, they work fine.).

I would appreciate tips regarding this peculiar problem. I know this is not a specific problem, but rather a helpful strategies thread.
From what little experience I’ve gathered while developing with UE4 the best way to get your head around a problem is tackle it, fail at it, work out a better way and then, three years later, noticing how easy and direct the problem could have been solved.
To be honest I want to skip this trial and error in this case by getting some help from the hive mind, since I never worked on sound design before and in this project it is one of the major parts. I don’t expect a full tutorial on sound design. A gentle push in the right direction is all I need <3

Hey Jonny.

Are all of your sounds being pulled from a single cue? Multiple sounds playing at once shouldn’t be an issue at all - they’re talking about 12 voices on Android mobile here and that’s 2 years ago. If you’re calling multiple sounds from one cue that can cause clipping in my experience.

My suggestion is:

  • Ensure all of your wav files are in the right format - 16 bit, 44.1 khz
  • Ensure each wav file is in there separately
  • Create a cue for each wav - you should then have a unique cue for each piano note
  • If chords are played using one touch input (rather than 3 or 4 to represent fingers) then combine the wavs for the chords you want in another cue

That should work but if not just holler :slight_smile:

Sorry for taking so long,
different projects pushed their way into my work life.
Thanks for your reply :slight_smile:

I understand that multiple sounds at once should not be problematic, for some reason they are. Could it be the general quality of my wav files? They are 16 bit, 44.1khz format. If I play them outside of the project, one sound at a time, I encounter no problems. When testing inside the editor (and in standalone) I encounter artifacts, mostly crackling noises. They only appear when I hit one piano key (only the same key) in rapid succession (about twice in one second). I believe it has something to do with starting the same cue again, while it is still active, but my guess is completely blind.

For now I have all the piano keys as a blueprint with an audio component and an overlap box, and all the sounds in a sound cue each.
The audio component is the corresponding sound cue and plays through a do-once gate whenever I overlap the box.
Upon ending the overlap the sound component does a fade out and the do-once gate for playing the sound component is being resetted.

I have done this without the fade out, with delay after the fade out and with a complete stop. If the delay is long enough, the artifacts disappear, but I obviously cannot play the key “fast”. Wihout any fade out or with a stop node I get the crackling artifacts. The sudden stop+restart seems to be a problem and I don’t know if this is a usual problem, that can be avoided.

No worries :slight_smile: There’s a lot of stuff going on right now anyways - hope you’re keeping well.

I’m assuming you’re familiar with Attack Decay Sustain Release?

Rather than fabricating a Release by using the fadeout (which will still be calling the cue when you press the key again) try splitting the sound up so that the release is a separate cue that can be called when the key is released.

You could also take a look at the sound cues in the UE4 Shooter Game - the one with the hovercars. It’s got a rifle in it that uses a single-shot sound, a looping sound, and a ‘Shot End’ cue that basically puts the tail onto the looping parts.

You could try using what’s called a round robin: synths use this so that they aren’t loading the same sound each time, and so the listener can’t tell so easily that they’re hearing a synthesised sound. If you create three or four or more versions of each note and assign each one their own cue you could cycle through them in a Blueprint. That means you’re not calling the same cue each time but you’ll get the same note.

If your Player pressed the same key they’d loop through the round robin.

Another thing to consider is concurrency. You can use this in UE4 to limit how many times a sound cue can be called. All electric keyboards have this feature to help manage the sound and reduce the risk of artefacts. If you bring up the console while you’re playing the game and use the Stat Audio command you’ll be able to check how many cues are playing at once. If there’s a lot of demand on one cue that might be the issue :slight_smile:

Thanks a lot, I hope you are doing well, too.

These are a lot of things to look into, so thank you very much :slight_smile:

I hope this solves my problem, it seems like it should.
If not I will annoy you again :stuck_out_tongue: Or present you with something finished.

Until then, stay safe.

Haha I’m looking forward to it :wink:

Take care :slight_smile: