PPT - Computer Science

Download Report

Transcript PPT - Computer Science

CS 591 S1 – Computational Audio -- Spring, 2017
Wayne Snyder
Computer Science Department
Boston University
Lecture 9 (Tuesday)
Conclusions on Karplus-Strong
Conclusions on Music Synthesis
Questions on Midterm
Demo of Software Synthesizer (Ebrahim)
Midterm One on Thursday 3/2!
Computer Science
Physical Modeling Synthesis: KarplusStrong
Computer Science
Karplus-Strong String Synthesis
This process is modeled by a Ring Buffer Queue (remember those, CS 112 folks??). The
algorithm is actually very simple: to create a signal of length M samples, fill the queue with
random values, and then rotate the queue, but inserting the average of two values times a
decay factor:
(Actually this diagram
is reversed left-to-right
compared with the
Python code.)
2
Physical Modeling Synthesis: KarplusStrong
Computer Science
Now of course, you can try different variations, varying the frequency and the decay; here is
low and slow:
KarplusStrong(1000,44100*5,0.99)
44100/1000 = 44.1 Hz
3
Physical Modeling Synthesis: KarplusStrong
Computer Science
Now of course, you can try different variations, varying the frequency and the decay; here is
high and short:
KarplusStrong(20,10000,0.9)
44100/20 = 2205 Hz
4
Physical Modeling Synthesis: KarplusStrong
Computer Science
Or, you can start tweeking the various components of the algorithm:
Load it with non-random values to start, maybe a square wave or a sample;
Use a different smoothing algorithm, e.g., weighted average, average of 3, or average of two
values separated by k samples, etc. etc.
Here I have loaded the queue with a
square wave
Here I have taken the average of
at 220.5 Hz:
4 samples:
Here I have taken the average of
two samples, skipping 2:
Here I have loaded the queue with the
first 200 samples of the
SteelString.wav file:
Original
:
Here is a weighted average (0.75a + 0.25b)
5
Physical Modeling Synthesis: KarplusStrong
Computer Science
Some other variations that have been explored include probabilistically inverting the value
inserted into the queue (reminiscent of Ring Modulation, perhaps):
For p = ½ this simulates a drum sound:
For other values of p, we can mix the string and drum sounds:
Physical Modeling Synthesis: KarplusStrong
Computer Science
Or we can load the queue with an appropriate non-random signal:
here is a square wave at 220 Hz:
And one at 44.1 Hz:
Here is the clarinet sound at 220 Hz:
And a Bell sound at 1000 Hz:
Or we can change the length of the queue to simulate glissando and other pitch-specific
effects:
The possibilities seem endless… Any ideas?
Granular Synthesis
Computer Science
There are many other approaches that have been taken to sound synthesis, and we will not
have time to cover all of them. One of the most interesting is called Granular Synthesis, and
consists in taking very short samples, say 0.2 seconds or shorter, and combining these in
groups of clouds of sound; as we have seen with previous methods, when individual units
are combined at higher than 20 Hz, the result is a new timbre instead of a recognizable
sequence of sounds….
Putting it all together: Music Synthesis
Computer Science
We have focussed on creating realistic (and not so realistic) timbres of sound, and creating
individual notes such as might be created by a musician. In the end, these sounds must be
combined into an extended piece of music or as a soundtrack to a film, video games, etc.
Fundamentally, we must create a process by which a score, which records which notes are
played when, is played by some entity, either human or machine.
Putting it all together: Music Synthesis
Computer Science
The result we may call Music Synthesis as opposed to simply Sound Synthesis. Here is a
(very simple) example of such a process:
Putting it all together: Music Synthesis
Computer Science
Here is another that I use quite frequently, embedded into an editor for guitar tablature
notation, called Guitar Pro:
Putting it all together: Music Synthesis
Computer Science
A very popular framework for Music Synthesis is called Midi, which allows for the
specification of a sound file in terms of individual notes, and for the connection of physical
devices, such as keyboards, with synthetic sounds:
Putting it all together: Music Synthesis
Computer Science
[Software Synth Demo by Ebrahim]