17
1 Acoustic Sampling Of Instruments Dan Starr Capstone Design Project Advisors: Prof. Catravas Prof. Postow

1 Acoustic Sampling Of Instruments Dan Starr Capstone Design Project Advisors: Prof. Catravas Prof. Postow

Embed Size (px)

Citation preview

1

Acoustic Sampling Of

Instruments

Dan StarrCapstone Design ProjectAdvisors: Prof. Catravas

Prof. Postow

2

Presentation Outline

Project Description Primary Assumptions Project Modules:

Event DetectionPitch DetectionLoop CombinationPitch ShiftingPlayback

GUI Demo

3

Project

Notes of any length (looping) Additional notes (C C#, D, D#, E, F, F#)

(Pitch Shifting)

Some Musical Effects (Staccato, Slur, Dynamics)

* Reduce Storage *

Single-note, Acoustic Instrument Audio Sample

Ability to play many more notes

Series of Algorithms

MATLAB

4

AssumptionsAll samples look

approximately likethis:

Good recording equipment

Good instrumentalist

5

Good sample

Bad sample

The world isn’t perfect…

6

Where we are…

Project Description Primary Assumptions Project Modules:

Event DetectionPitch DetectionLoop CombinationPitch ShiftingPlayback

GUI Demo

7

Event Detection

Single-note audio sample

Event Detection

Step 1: Create Outline

Attack, Sustain, Release Sections

8

B

A

C

D

E

B

A

C

D

E

Step 2: Find Key Points Points A, E: easy

Point B: Max of first ½ second of signal

Point D: Point C:

Same method as Point D, but draw line from D B.

9

Pitch Detection Determine pitch (frequency) of sustain section

Purpose: replace sustain (1s) with single period (5ms) Method:

Perform Discrete Fourier Transform Find lowest frequency component

Determine corresponding musical note

Time Domain Frequency Domain

261Hz (C4)

* 52% decrease in required storage *

10

Where we are…

Project Description Primary Assumptions Project Modules:

Event DetectionPitch DetectionLoop CombinationPitch ShiftingPlayback

GUI Demo

We Have Extracted:

Attack

Release

Single Period of Sustain

11

Loop CombinationTake single period and loop it to create a sustain of any length

Splicing

• Simply repeat waveform

• Frequency must be very accurate

Good Bad

True Period: 3.8ms

Reported Period: 3.2ms

12

Loop CombinationCrossfading

• Fade one period out while fading the next period in

Bad Fade

linear

sinusoidal

logarithmictime

+

+

13

Attack, Release Reattachment Problem:

Solution: Merge attack/sustain, sustain/release

14

Where we are…

Project Description Primary Assumptions Project Modules:

Event DetectionPitch DetectionLoop CombinationPitch ShiftingPlayback

GUI Demo

We Have Extracted:

Attack

Release

Single Period of Sustain

And we can play:

A note of any length

15

Simple: resample at different frequencies

Frequencies given in table MATLAB has built in resample function

Pitch ShiftingEqual Temperament System of Musical

Intonation

Note Ratio

Unison 1:1

Minor 2nd 1:1.059

Major 2nd 1:1.122

Minor 3rd 1:1.189

Major 3rd 1:1.260

Perfect 4th 1:1.335

Diminished 5th

1:1.414

Perfect 5th 1:1.498

Minor 6th 1:1.587

Major 6th 1:1.682

Minor 7th 1:1.782

Major 7th 1:1.888

Octave 1:2Typical Sampling Rate: 44.1 KHz

16

Instrument Name: Consult stored names

Note (A,F#,Gb): Pitch shifting results in shorter samples add more

sustain to account for it *Note Length*

Problem: Length to be played is less than length of attack.

Solution: Create new linear release

Playback•Instrument Name

•Note

•Note length

SoundPlayback

17

GUI DEMO