Archive for Audio

Blok 3 – 2016

Hier wat links over Unity en audio.

Hoe maak ik een metronoom?

Met AudioSettings.dspTime kun je de tijd op audiorate opvragen. Let op: dit is de tijd die is verstreken sinds je computer is opgestart, dus werk altijd met relatieve tijd.

https://docs.unity3d.com/ScriptReference/AudioSettings-dspTime.html
(Voorbeelden voor JS en C#).

Hoe speel ik audio af zonder latency?

Met dspTime kun je het moment bepalen waarop de audio afgespeeld zou moeten worden. Met audio.PlayScheduled zet je het even klaar en wordt het op de juiste tijd getriggerd.
https://docs.unity3d.com/ScriptReference/AudioSource.PlayScheduled.html

Hier kun je een project downloaden waarin je dit meteen kunt testen.
http://sid.hku.nl/downloads/?dir=lesmateriaal%2Fsid-blok3%2Ffiles%2F2016

Het wapengeluid onderbreekt. Dat is lelijk.

Kijk naar het AutoFire script en kijk eens naar:

function OnStartFire () 

Hier zie je het euvel: het is volgens mij een loop die aan en uit gezet wordt als je de muisknop indrukt cq loslaat.

PlayOneShot is hetzelfde als PlayClipAtPoint alleen geef je bij de laatste een 3d-positie mee (dus dat is wel handig). Unity maakt het object aan, en verwijdert het als het klaar is met afspelen.

Handige Unity Functies

FindObject(s)OfType

Met deze functies kun je alle instances van een bepaald script selecteren en dan een functie laten uitvoeren. Les op de s: alle objecten of 1 object.
https://docs.unity3d.com/ScriptReference/Object.FindObjectOfType.html
https://docs.unity3d.com/ScriptReference/Object.FindObjectsOfType.html

Andere gameobjecten benaderen

Zo kun je andere gameobjecten linken en iets doorgeven:
[LINK]

PlayClipAtPoint

Speelt een clip in de wereld af, en ruimt het object weer op als het klaar is met afspelen. Handig…

[LINK]

Code is:

AudioSource.PlayClipAtPoint(clip, new Vector3 (5, 1, 2));

Maar je kunt natuurlijk ook de positie van het ‘parent’-object gebruiken (bv. de speler). Je kunt ook nog het volume instellen.

AudioSource.PlayClipAtPoint(clip, transform.position);
AudioSource.PlayClipAtPoint(clip, transform.position, volume);

 

Ik ben Sid. Hoe maak ik een synth voor livesynthese?

Met de Native Audio Plugin SDK, zie https://docs.unity3d.com/Manual/AudioMixerNativeAudioPlugin.html

Hoe maak ik Editor Extensies (Ruben)?

Zie https://docs.unity3d.com/Manual/ExtendingTheEditor.html

De FMOD integration is vernieuwd?

Sinds versie Ja, de oude code is bv.

FMOD_StudioSystem.instance.PlayOneShot(endOfTurbo, transform.position);

Vervang die door:

FMODUnity.RuntimeManager.PlayOneShot(endOfTurbo, transform.position);

of door het event direct aan te roepen:

MODUnity.RuntimeManager.PlayOneShot(“event:/endOfTurbo”, transform.position);

Als je geen OneShot afspeelt maar een studiosystem:

SlitScore = FMODUnity.RuntimeManager.CreateInstance(“{ba0fe66d-901b-415b-b672-e360a8b6cddc}”);

Het komt dus neer op een simpele find replace van de code!

Zie ook de migration guide (http://www.fmod.org/documentation/#content/generated/engine_new_unity/migration.html) maar let op: die beschrijft alleen C# en Angry Bots is in JS. Het editorscript dat belooft je code automatisch te updaten werkt alleen bij C#. JavaScript moet je zelf – handmatig – doen, maar Unity geeft met de errors precies aan waar de problemen zitten.

Biofeedback

Here you find some links concerning the artistic usage of biofeedback input.

Heartlive and Unity integration via the Mic Control asset:

(Download this Unity project)

  • Connect the Heartlive
  • Go to MicController
  • Go to MicControl.js
  • Set the input device: find the input device that corresponds with the Heartlive.
  • Do not be fooled: your mic input
  • Allow the Heartlive to calibrate, sometimes it takes a while to start showing a real heartbeat.

Windows software:

Windows-software downloaden via:
downloaden via internet via: www.heartlive.nl/downloads

Music Moves: Why Does Music Make You Move? Free online course

music-makes-you-move

Here’s a pointer to a free online course offered by the University of Oslo. Learn about the psychology of music and movement, and how researchers study music-related movements.

Music is movement. A bold statement, but one that we will explore together in this free online course. Together we will study music through different types of body movement. This includes everything from the sound-producing keyboard actions of a pianist to the energetic dance moves in a club.

You will learn about the theoretical foundations for what we call embodied music cognition and why body movement is crucial for how we experience the emotional moods in music. We will also explore different research methods used at universities and conservatories. These include advanced motion capture systems and sound analysis methods.

You will be guided by a group of music researchers from the University of Oslo, with musical examples from four professional musicians. The course is rich in high-quality text, images, video, audio and interactive elements.

Join us to learn more about terms such as entrainment and musical metaphors, and why it is difficult to sit still when you experience a good groove.

https://www.futurelearn.com/courses/music-moves/

VR audio techniques

creature sound placement

Great talk on VR Audio!

3D audio is critical for creating a believable virtual world, and sound design for VR is very different from traditional games or movies. This talk will cover VR audio techniques including building immersive ambiences, attenuation curves, mixing and player focus. You’ll hear some of the sound design tricks used in the Oculus demos, and learn more about how to work with the Audio SDK to create authentic and compelling experiences.

[via Mark, thanks!]

Game Audio Industry Survey 2015

Just a quick pointer to the Game Audio Industry Survey!

The game development web site, Gamasutra, recently published the results of their annual game developer salary survey. This year, the results were somewhat puzzling, with “audio” salaries coming in higher than every other discipline except “business and management.”

Part of the reason for this unexpected result is that audio, more than most other game disciplines, has a very high percentage of non-salaried freelancers, which are unaccounted for in the Gamautra survey. Gamasutra also commented on the “smaller pool of respondents,” (33 “audio professionals” completed the survey) causing the results to be “more easily skewed.”

With that in mind, Brian Schmidt et al created a survey that attempted to more accurately capture the issues of contracts, terms and compensation in game audio.

Read more

Getting Started with FMOD Unity Integration (Blok3)

Download

Download FMOD Studio and Studio Integration. Install Studio and import the package in Unity.

There are FMOD studio Projects (examples) in the FMOD Studio application folder.

Integration

FMOD studio integration manual (the manual)

Horse Awesome Game’ FMOD and Unity (the simple example created during the lesson, contains both Unity and FMOD Studio). This is JavaScript code, if your game programmer works in C# it is best to use C# code.

For C# examples, see the Example Scripts in the FMOD folder in the integration package. Refer to the manual, section Contents / Example Scripts for a description. The example scripts are named FMODAsset, FMOD_Listener, FMOD_StudioSystem and FMOD_StudioEventEmitter. With these sample scripts, you’re ready to go.

FMOD

Again, use the SAME versions of FMOD Studio and FMOD Integration. Make sure your game programmer does the same. If not, you might get crazy amounts of errors in Unity. You might ask why I’m repeating myself over and over on this, but I’ve seen this happening over and over again.
If there are crazy amounts of errors, ask you programmer to double check the version.

During the lesson I showed:

  1. Create an Event
  2. Import Sounds into
  3. Create a Multi Sound
  4. Assign the event to a bank before building
  5. Building
  6. Export GUIDs

Remember:

  • Play percentage (right click sounds in multi sound)
  • Random value via add modulation (right click volume or pitch)
  • Seek Speed

Great tutorials to get started are all over YouTube. This playlist is rather complete:

Unity

After importing the package you’ll get an FMOD tab in Unity (menu at the top of the screen).

Import banks om het FMOD project te importeren en selecteer de folder Build in je FMOD-project.

Play music with a parameter (JS)

For C#, see FMOD_StudioSystem.cs in the Unity folder.

 

// Place at the top of a script

var Music : FMOD.Studio.EventInstance;

var Intensity : FMOD.Studio.ParameterInstance;

// Place in Awake and change the GUID-code (in GUIDs txt in your build folder).

Music = FMOD_StudioSystem.instance.GetEvent(“{ba0fe66d-901b-415b-b672-e360a8b6cddc}”);

Music.getParameter(“Intensity”, Intensity);

{

Debug.LogError(“Awe parameter not found on music event”);

return;

}

// start music

Music.start();

// Pass the parameter – somewhere in a function, e.g. Update() or OnCollisionExit()

Intensity.setValue(0.0);

Intensity.setValue(0.28);

Intensity.setValue(1.0);

Play in C#

using UnityEngine;
using System.Collections;

public class RobotSound : MonoBehaviour {

//looping sound with a parameter
FMOD.Studio.EventInstance walkingSound;
FMOD.Studio.ParameterInstance speed;

//oneShot + “initiation”
string deathExplode = “event:/enemies/explodeSmall”;

//initialise looping sound
void Start()
{
walkingSound = FMOD_StudioSystem.instance.GetEvent(“event:/enemies/movingSmall”);
walkingSound.getParameter(“parameterNameinFMOD”, out speed);
}

//Start and stop looping sound
void startWalking()
{
walkingSound.start();
}
void stopWalking()
{
walkingSound.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
//OR
walkingSound.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
}

//oneShots start
void playExposion()
{
FMOD_StudioSystem.instance.PlayOneShot(deathExplode, transform.position);
}

//cleanup EventInstance, PlayOneShot() does not need this
//stop audio before cleanup!
void onDeath_or_Delete()
{
walkingSound.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
walkingSound.release();
}
}

Questions?

If there’s anything wrong, check/search the FMOD/Unity forum:
http://www.fmod.org/forum/viewforum.php?f=30

If there’s something really wrong and buggy, you could ask the developers at the FMOD in Unity questions section:
http://www.fmod.org/questions/categories/unity
You might have to wait for several days, especially over the weekend, so don’t rely on this when you have a deadline!

You could also email me. Just do it if you dare. 😀

Pitfalls

FMOD Studio has bugs. A lot of them. Fortunately, these are constantly being fixed, which is a good thing. That is why it’s tempting to update Studio and Unity Integration. Beware that new versions could introduce new issues with other code and libraries. FMOD projects are not necessarily backwards compatible, so you might make a copy first before upgrading your project.

Make backups. Make Backups. Make Backups! Make Backups! Just zip your FMOD project folder every now and then. I’ve completely destroyed an FMOD Studio project by opening it on a PC first and then on a Mac. FMOD support was willing to assist me on recovering the project but I was happy to restore a backup which opened fine.

“Being too busy to worry about backup is like being too busy driving a car to put on a seatbelt.” — T.E. Ronneberg

The Game Pulse – Timing Game Events and Music Events [PDF]

Here’s a pointer to a paper in which we examine how to design nonlinear music systems that allow for music events to coincide and correspond with dynamically changing game events. We address the challenges of connecting nonlinear music systems to gameplay and distinguish three approaches for timing time music events and game events: Trail, Sync and Lead. We explore these three approaches in the design case study Gluddle versus The Supervision, a game created by the authors. Our preliminary findings illustrate the benefits of combining Trail, Sync and Lead, positively influencing the game experience, but also the need for extra attention to gameplay balance and technical implementation.

Download The Game Pulse – Timing Game Events and Music Events

By Richard van Tol and Sander Huiberts – Proceedings Innovation In Music 2013. Innovation In Music 2013. Edited by R. Hepworth-Sawyer, J.Hodgson, R. Toulson & J.L. Paterson. ISBN 978-0-9561516-8-1

Diggin’ in the Carts – Japanese Video Game Music History

diggin-in-the-carts

Just after receiving the message that BEEP started filming at GameSoundCon (apparently, this really is the time for documenting Game Music History), Yme sent me a message about Diggin’ In The Carts. Diggin’ In The Carts is a new series from Red Bull Music Academy about the untold story behind the most influential music to come out of Japan. Check back each Thursday, from September 4th to October 9th, for new episodes, mixes, and bonus interview footage. Sweet!

[Go to the Diggin’ in the Carts website]

Beep: A Documentary History of Video Game Sound

Karen Collins is running a KickStarter for a game sound documentary: Beep: A Documentary History of Video Game Sound.

Pledge or read more on KickStarter!

Read more

Recent posts about sound and music you should definitely read

Enjoy the Music

Here are some inspiring posts about sound and music.

How sound affects the taste of our food
High-frequency sounds enhance the sweetness in food, while low frequencies bring out the bitterness. So could sound replace sugar? And what kind of music should restaurants play? [Read more]

Read more