Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web:: Email:: info{at} Advanced Granular Synthesis for Next-Generation Games Game Developer's Conference 2007 San.

Similar presentations

Presentation on theme: "Web:: Email:: info{at} Advanced Granular Synthesis for Next-Generation Games Game Developer's Conference 2007 San."— Presentation transcript:


2 Web:: : info{at} Advanced Granular Synthesis for Next-Generation Games Game Developer's Conference 2007 San Francisco Leonard J. Paul Vancouver Film School Game Audio Instructor info {at} x4035

3 Web:: : info{at} Overview 1) How to utilise granular for speech, sound effects, music and engines 2) Prototyping granular synthesis using Pure Data and Open Sound Control 3) How to add granular synthesis to your sound driver

4 Web:: : info{at} Using granular for speech sound effects music and engines 1)

5 Web:: : info{at} 1) Selection order (fwd/rev or freeze) 2) Pitch shift 3) Amplitude range 4) Spatialization / panning 5) Grain duration 6) Grain density (grains/sec, # of grain voices) 7) Envelope (ASR shape or windowing function) 8) DSP effect (reverb, filtering...) 9) Feedback amount (for granular delay lines) Granular Parameters

6 Web:: : info{at} Game Parameters ● Granular parameters driven by game state ● (ex. RPM -> pitch) ● Physics allow for continuous control over playback of sample ● (ex. ragdoll -> foley) ● Input parameters need to be carefully tuned to drive synthesis ● (ex. instrument played by novice)

7 Web:: : info{at} Game Audio Data Diagram Game (Physics, GFX, AI etc..) Game Audio Code Granular Driver Code DAC  Commercia l Sound Tool In-house Sound Tool Audio Data

8 Web:: : info{at} Speech ● Time warping speech for variation ● Change formants of voice ● Realtime granular effects to change character of voice

9 Web:: : info{at} Sound Effects ● Crossfade morph via grains ● Spacialization in 5.1/7.1 ● Contact physics for sliding/scraping ● Add variation to existing sounds

10 Web:: : info{at} Engines ● Add as a layer for variation ● Pre-segmentation and playback via RPM/load band: Load RPM Samples Low RPM & low load grains

11 Web:: : info{at} Music and Ambiences ● Stretch a sound for a granular drone ● Tempo-sync grains for interesting gating effects ● Merge ambiences by selecting grains from multiple files ● Making an ambience sound more musical and abstract

12 Web:: : info{at} Prototyping Granular Synthesis using Pure Data and OSC 2)

13 Web:: : info{at} Coding PD Objects ● FlexT is a cross-platform method of generating custom C++ PD objects: ● Easily possible to port part of the Synthesis Toolkit (STK) to PD using Code Blocks or any other DSP code

14 Web:: : info{at} Flext (gain~ object code) class gain: public flext_dsp { FLEXT_HEADER(gain,flext_dsp) float factor; gain(): factor(0) { AddInSignal("In"); // add signal inlet AddInFloat("Gain"); AddOutSignal("Out"); // add signal outlet FLEXT_ADDMETHOD(1,m_gain); } virtual void m_signal(int n,t_sample *const *insigs,t_sample *const *outsigs) { const t_sample *in = insigs[0]; t_sample *out = outsigs[0]; while(n--) *(out++) = *(in++)*factor; } void m_gain(float db) { factor = pow(10.f,db*0.05f); } FLEXT_CALLBACK_F(m_gain); };

15 Web:: : info{at} OSC Layer for Prototyping ● Add an Open Sound Control (OSC) layer to your game to communicate with a rapid prototyping audio environment such as PD ● Example of using OSC with a Half-life 2 Source Mod ● Possible to compile PD to a language such as Java (pd2j2me)

16 Web:: : info{at} OSC Code for Sending Msg #include "osc/OscOutboundPacketStream.h" #include "ip/UdpSocket.h" #define ADDRESS " " // localhost but can be any address #define PORT 7000 #define OUTPUT_BUFFER_SIZE 1024 int main(int argc, char* argv[]) { UdpTransmitSocket transmitSocket( IpEndpointName( ADDRESS, PORT ) ); char buffer[OUTPUT_BUFFER_SIZE]; osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE ); // create buffer p << osc::BeginMessage( "/test" ) << "hi world" << osc::EndMessage; // message transmitSocket.Send( p.Data(), p.Size() ); // send message }

17 Web:: : info{at} Adding OSC to Half-life 2 ● Download the OSCpack library from: ● Download Visual C Express, Half- Life 2 and create a new mod ● Add the OSC files to the mod source (some tweaking needed) and modify SoundEmitter.cpp etc. ● This is a similar process to adding OSC to your own sound driver

18 Web:: : info{at} Adding Granular Synthesis to your Sound Driver 3)

19 Web:: : info{at} Granular Sound Driver ● PD C++ code can be ported to the next- gen consoles as the consoles are primarily software based ● Synthesis should be creatively used in conjunction with samples for sound design ● Advantage is that real-time control over synthesis parameters is from game parameters

20 Web:: : info{at} Granular Code Examples Ross Bencina – Granular Delay Line ● Uses Borland C++ Builder Synthesis Toolkit (STK) – Granulate ● Can use flext to port to PD SyncGrain~ for PD (from Csound) ● Ported using flext

21 Web:: : info{at} Related Research ● Concatenative Sound Synthesis Sound "Mosaic" Analysis & Resynthesis Uses grains from one sample to approximate grains of a second sample

22 Web:: : info{at} Related Research ● Natural Grain Resynthesis Make grains that preserve transients

23 Web:: : info{at} Related Research ● Pure Data Compiler (pd2j2me) Compile PD code to Java public void met0Bang() { double a; a = counter.bang(); a = a * 3; a = a / 4; }

24 Web:: : info{at} Example ● Example of gameplay utilizing granular synthesis

25 Web:: : info{at} Questions?

Download ppt "Web:: Email:: info{at} Advanced Granular Synthesis for Next-Generation Games Game Developer's Conference 2007 San."

Similar presentations

Ads by Google