Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 17:Wavetable Synthesis Ken Greenebaum.

Similar presentations


Presentation on theme: "Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 17:Wavetable Synthesis Ken Greenebaum."— Presentation transcript:

1 Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 17:Wavetable Synthesis Ken Greenebaum

2 Copyright 2004 Ken Greenebaum Assignment 5b Who attempted this? Who attempted this? What did you think? What did you think? What were the challenges? What were the challenges? Lets play (demos in \pub) Lets play (demos in \pub)

3 Copyright 2004 Ken Greenebaum Beyond 5b Limitations: Limitations: No polyphony No polyphony (Can’t play chords) (Can’t play chords) How would you specify a polyphonic score? How would you specify a polyphonic score? Any issues on note onset timing? Any issues on note onset timing?

4 Copyright 2004 Ken Greenebaum Already Discussed Wavetable Synthesis David’s synthesizers used a wavetable: David’s synthesizers used a wavetable: Bass drum Bass drum Sine table Sine table Fuzz Guitar Fuzz Guitar Zero-Page random ‘texture’ Zero-Page random ‘texture’ David advanced pointer David advanced pointer At different rates At different rates To achieve different rates To achieve different rates

5 Copyright 2004 Ken Greenebaum Wavetable Synthesis for musical synthesis Each instrument is ‘sampled’ Each instrument is ‘sampled’ Typically only some notes are sampled Typically only some notes are sampled Notes between the samples are pitch shifted Notes between the samples are pitch shifted This creates less than perfect fidelity This creates less than perfect fidelity On real instruments timbre changes On real instruments timbre changes Not just frequency Not just frequency Why not sample each note? Why not sample each note?

6 Copyright 2004 Ken Greenebaum Pitch shifting in General MIDI Results would be superior w/o pitch shifting Results would be superior w/o pitch shifting Pitch shifting still required to ‘bend’ notes Pitch shifting still required to ‘bend’ notes Pitch shifting used to save space Pitch shifting used to save space Typical sound card: Typical sound card: Up to 700 instruments Up to 700 instruments 4MB ROM 4MB ROM Sampling a piano alone Sampling a piano alone 10MB 10MB 7GB of ROM is still expensive… 7GB of ROM is still expensive…

7 Copyright 2004 Ken Greenebaum General MIDI on Game DVD Situation better for DVD based game? Situation better for DVD based game? Need small subset of 700 instruments Need small subset of 700 instruments Have plenty of space on DVD for samples Have plenty of space on DVD for samples Right? Right?

8 Copyright 2004 Ken Greenebaum General MIDI on Game DVD Wrong! Wrong! Even if Even if Only need 1/10 th instruments (70) Only need 1/10 th instruments (70) Requires 700MB (reasonable for a DVD) Requires 700MB (reasonable for a DVD) BUT this would have to be resident in memory BUT this would have to be resident in memory Never know when a note will have to be played… Never know when a note will have to be played…

9 Copyright 2004 Ken Greenebaum Wavetable Synthesis Sound engines like DSound Sound engines like DSound Are really wavetable synthesizers Are really wavetable synthesizers Minus the sequencer Minus the sequencer

10 Copyright 2004 Ken Greenebaum DSound DSound was created to: DSound was created to: Enable games like Quake Enable games like Quake (Triggered sound) (Triggered sound) Ported from DOS to Windows Ported from DOS to Windows Hence named Direct Hence named Direct Direct to hardware Direct to hardware Since game designers of that era only worked directly with hardware Since game designers of that era only worked directly with hardware

11 Copyright 2004 Ken Greenebaum Wavetable Synthesizers They: They: Persist samples Persist samples Can start any number of them Can start any number of them

12 Copyright 2004 Ken Greenebaum Wavetable Synth Primary effects: Primary effects: Pitch shift Pitch shift Amplitude Amplitude Pan Pan Looping Looping

13 Copyright 2004 Ken Greenebaum Wavetable Synth Secondary effects Secondary effects 3D Spatialization 3D Spatialization Reverb Reverb Ambience Ambience

14 Copyright 2004 Ken Greenebaum Technologies We have already covered: We have already covered: Pan Pan Amplitude Amplitude Leaves Leaves Looping Looping Pitch shift Pitch shift

15 Copyright 2004 Ken Greenebaum Looping Samples have loop points Samples have loop points Most often for: Most often for: Attack Attack Sustain Sustain Most difficult (1 st, last samples must align) Most difficult (1 st, last samples must align) Decay Decay

16 Copyright 2004 Ken Greenebaum Fractional Rate Pointer Index wavetable with a floating pt pointer Index wavetable with a floating pt pointer Advance 1.0 for realtime Advance 1.0 for realtime < 1.0 for fractional rate < 1.0 for fractional rate > 1.0 for faster than realtime > 1.0 for faster than realtime

17 Copyright 2004 Ken Greenebaum Fraction Rate Pointer Problem: Problem: What happens when pointer is not an integer value? What happens when pointer is not an integer value?

18 Copyright 2004 Ken Greenebaum Pitch Shift Really re-sampling Really re-sampling Different expense/quality: Different expense/quality: David’s variable rate-pointer David’s variable rate-pointer DSound’s fractional pointer DSound’s fractional pointer With or w/o interpolation With or w/o interpolation True sample rate conversion True sample rate conversion

19 Copyright 2004 Ken Greenebaum Fractional Rate Pointer For intermediate values can: For intermediate values can: Round pointer Round pointer Interpolate between adjacent values Interpolate between adjacent values Using various order interpolation Using various order interpolation However geometric thinking doesn’t really solve this signal processing task However geometric thinking doesn’t really solve this signal processing task

20 Copyright 2004 Ken Greenebaum Problems with Fractional Pointer Consider down sampling a sample: Consider down sampling a sample: 48000 Samples/Second signal 48000 Samples/Second signal Down sampled to 8000 Samples/Second Down sampled to 8000 Samples/Second Easy set pointer to 6.0 Easy set pointer to 6.0 Wahoo an integer value, no interpolation needed Wahoo an integer value, no interpolation needed But… But…

21 Copyright 2004 Ken Greenebaum Problems with Fractional Pointer Original 48000 Sample/Second signal Original 48000 Sample/Second signal Could contain frequencies up to 24kHz Could contain frequencies up to 24kHz Resulting 8000 Sample/Second signal Resulting 8000 Sample/Second signal Can only represent signals up to 4kHz Can only represent signals up to 4kHz Incrementing pointer by 6 Incrementing pointer by 6 Essentially decimation Essentially decimation Selecting every sixth sample Selecting every sixth sample Doesn’t filter out the unrepresentable freqs Doesn’t filter out the unrepresentable freqs Results in terrible aliasing! Results in terrible aliasing!

22 Copyright 2004 Ken Greenebaum Problems with Fractional Pointer Probably could always perform high order interpolation Probably could always perform high order interpolation However better to use signal processing tools and not geometric interpolation! However better to use signal processing tools and not geometric interpolation! Second Semester we will discuss Multirate DSP Second Semester we will discuss Multirate DSP For those curious: For those curious: Nice article in Audio Anecdotes by Tor Ramstad Nice article in Audio Anecdotes by Tor Ramstad

23 Copyright 2004 Ken Greenebaum Assignment 6 Wavetable Synth Due Thursday March 18th Due Thursday March 18th Must support Mixer’s Synth interface Must support Mixer’s Synth interface Should be demo’d in standalone main.c Should be demo’d in standalone main.c PABLIO, 48kHz, MONO PABLIO, 48kHz, MONO WaveTableSynth additional interfaces: WaveTableSynth additional interfaces: LoadSample(char *FileName) LoadSample(char *FileName) Play(double rate, int sustainCount) Play(double rate, int sustainCount)

24 Copyright 2004 Ken Greenebaum Assignment 6 Wavetable Synth Main.c’s command line: Main.c’s command line: Filename.smpl pitch sustaincount Filename.smpl pitch sustaincount Filename: name of sample file Filename: name of sample file Pitch: rate of playback Pitch: rate of playback 1.0 nominal 1.0 nominal 0.5 ½ rate 0.5 ½ rate 2.0 2x rate 2.0 2x rate Sustain count: how many times to play sustain section Sustain count: how many times to play sustain section

25 Copyright 2004 Ken Greenebaum Assignment 6.smpl sample file format ASCII text please!!! ASCII text please!!! Int SampleRate SustainIn SustainOut Int SampleRate SustainIn SustainOut Floating point samples (one per line) Floating point samples (one per line)

26 Copyright 2004 Ken Greenebaum Assignment 6.smpl sample file format Your choice of Your choice of Samples to create Samples to create Length of sample Length of sample Method to create and loop file Method to create and loop file But should consider downloading free audacity editor But should consider downloading free audacity editor Can also use your previous synthesizers! Can also use your previous synthesizers!

27 Copyright 2004 Ken Greenebaum Assignment 6 Wavetable Synth Deliverables: Deliverables: makefile makefile main.c main.c WaveTable.c WaveTable.c 3 Test files: 3 Test files: 1. instrument.smpl: musical instrument like 2. sound.smpl: a non-musical sample 3. voice.smpl: human voice-ish (non-voiced)

28 Copyright 2004 Ken Greenebaum Next Class Noise/subtractive synthesis Noise/subtractive synthesis


Download ppt "Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 17:Wavetable Synthesis Ken Greenebaum."

Similar presentations


Ads by Google