Physical modeling of an acoustic guitar.
category: code [glöplog]
I recently did for Chaos Construction 2011 demo:
http://tuapse-mikle.narod.ru/SpainGuitar.zip
This is not a midi, no samples, no generators with filters - each string guitar is represented as a chain of goods associated springs, damping is introduced. Visual prototype to check:
http://tuapse-mikle.narod.ru/VisualString.zip
Here, for clarity, the rate decreased in 1000.
Now I work on the sound of metal strings:
http://tuapse-mikle.narod.ru/Guitar.zip
I want to implement a plug-in for public use that would generate such samples.
http://tuapse-mikle.narod.ru/SpainGuitar.zip
This is not a midi, no samples, no generators with filters - each string guitar is represented as a chain of goods associated springs, damping is introduced. Visual prototype to check:
http://tuapse-mikle.narod.ru/VisualString.zip
Here, for clarity, the rate decreased in 1000.
Now I work on the sound of metal strings:
http://tuapse-mikle.narod.ru/Guitar.zip
I want to implement a plug-in for public use that would generate such samples.
Wow, that sounds really nice. I don't know about physical modelling, any chance to make it realtime?
Very cool!
The metal strings version needs distortion ;)
The metal strings version needs distortion ;)
Sample generation time is much shorter than the time of his sound, despite the fact that a program written in Visual Basic 6, so that realtime is possible.
Distortion must be post-effects, as the sum of the signals processed distortion does not sound like the sum of signal distortion treated separately.
Distortion must be post-effects, as the sum of the signals processed distortion does not sound like the sum of signal distortion treated separately.
so what's this? a computer simulation of guitar strings?
sounds a bit wah-wah sometimes, and slightly digitalis at some points, but besides that very nice. Inspiring! I should look more into physicaal modelling myself.
Sounds like standard Karplus/Strong to me.
Can't do karplus/strong without filtering of some kind ... at least if the "no generators with filters"-part is to be taken for what it says ;)
@Punqtured: Well, I made a Karplus-Strong based tracker ~20 years ago (w/o knowing the name of that algorithm) and this is not just KS. :D
@Mikle: The SpainGuitar one did not really convince me (would probably have worked better with 70ies funk!) but the metal one was quite good. now SHOW US YOUR powerchords (with overdrive, s’il vous plaît!)
@Mikle: The SpainGuitar one did not really convince me (would probably have worked better with 70ies funk!) but the metal one was quite good. now SHOW US YOUR powerchords (with overdrive, s’il vous plaît!)
i really like the idea of pm, but making it sound interesting is really hard.
to make it useful as an artistic tool it needs sth special, rather unphysical.
accurate and fast string simulation i know is ftm-string:
to make it useful as an artistic tool it needs sth special, rather unphysical.
accurate and fast string simulation i know is ftm-string:
Spain Guitar - a simulation of an entire guitar with nylon strings. There is a mutual influence of the strings through the nut, it is possible to drown out the string, make a flageolet. There are a couple of resonances and reverberation case.
Guitar - it is only the sound of a steel string.
On Karplus, in my opinion, it does not seem. Maybe I did not see those demos with Karplus.
Guitar - it is only the sound of a steel string.
On Karplus, in my opinion, it does not seem. Maybe I did not see those demos with Karplus.
xyz:
"accurate and fast string simulation i know is ftm-string:"
Size is important, I make a plugin for demoscene.
P.S.
Pardon my English - it's translator Google.
"accurate and fast string simulation i know is ftm-string:"
Size is important, I make a plugin for demoscene.
P.S.
Pardon my English - it's translator Google.
xTr1m, we used it for 195/95/256.
Here is some of the physically based instruments we designed back in 2005 (although we only used a couple of them in the end). www.iquilezles.org/trastero/sound.zip. Emjoy!!
Here is some of the physically based instruments we designed back in 2005 (although we only used a couple of them in the end). www.iquilezles.org/trastero/sound.zip. Emjoy!!
It is cool as an experiment, however it sounds just unconvincing. Check this implementation of much simpler Karplus-Strong algorithm with guitar body simulation through LP resonant filter, I think it sounds much more convincing.
I think the reasons of unrealistic sound in your synth is lack of guitar body simulation, and not very realistic music data, with too perfect timings.
I think the reasons of unrealistic sound in your synth is lack of guitar body simulation, and not very realistic music data, with too perfect timings.
Spain guitar doesn't sound guitar at all, but metal one could be convincing with right kind of playing data.
Biggest part of the guitar sound is playing style. Even best physical modeled guitar will sound like harpsichord if played like piano and non-guitar sounds remind of guitar if you play them like guitar (single note pitch bends while other strings are sustaining, play guitar chords instead of triads, simulate strumming by having small delay between notes and so on).
Biggest part of the guitar sound is playing style. Even best physical modeled guitar will sound like harpsichord if played like piano and non-guitar sounds remind of guitar if you play them like guitar (single note pitch bends while other strings are sustaining, play guitar chords instead of triads, simulate strumming by having small delay between notes and so on).
In Can I have my pills now I used lots of KS strings, with and without post-processing for the clavinet-like sound and the "space guitar".
I demand sourcecode to rip from! Nice sounding stuff sounds nice.
I fully agree that realism is not realistic enough initial data, the musical score.
trc_wm:
Sound nice, but not real.
iq:
I liked the harmonica and bowed instruments
las:
Here the source demos Spain Guitar and editor score:
http://tuapse-mikle.narod.ru/SpainGuitarSrc.zip
But this is Visual Basic 6 and complete lack of comments :).
trc_wm:
Sound nice, but not real.
iq:
I liked the harmonica and bowed instruments
las:
Here the source demos Spain Guitar and editor score:
http://tuapse-mikle.narod.ru/SpainGuitarSrc.zip
But this is Visual Basic 6 and complete lack of comments :).
@Mikle can you post samples; I'm not on windows.
how does it work, when developing? FFT analysis of a recorded sound, trying to find a function that mimics amplitude for the frequency over time? like: sin(a)*sin(a1)+sin(b)*sin(b1)+sin(c)+sin(d) ? or what kind of math is involved?
@y Shiru : thanks, I was looking for that exct same link :) Rather convincing indeed.
@trc_wm
Here demo with mp3:
http://ftp.scene.org/file.php?file=%2Fparties%2F2011%2Fchaosconstructions11%2Fcombined_32k_exe_music%2Fspainguitar_2.zip&fileinfo
@trc_wm
Look at sources:
s(i) - speed
p(i) - position
LFrc - force devided by mass
Here demo with mp3:
http://ftp.scene.org/file.php?file=%2Fparties%2F2011%2Fchaosconstructions11%2Fcombined_32k_exe_music%2Fspainguitar_2.zip&fileinfo
@trc_wm
Look at sources:
Code:
For i = 1 To St(SS).stLen - 1
St(SS).s(i) = St(SS).s(i) + ((St(SS).p(i - 1) + St(SS).p(i + 1)) * 0.5 - St(SS).p(i)) * St(SS).LFrc
Next i
For i = 1 To St(SS).stLen - 1
St(SS).s(i) = St(SS).s(i) * St(SS).k1 + (St(SS).s(i - 1) + St(SS).s(i + 1)) * St(SS).k2
Next i
For i = 1 To St(SS).stLen - 1
St(SS).p(i) = St(SS).p(i) + St(SS).s(i)
Next i
s(i) - speed
p(i) - position
LFrc - force devided by mass
iq: Where can I learn how to synthesize such sounds? I got curious and would like to read something :)
uncovering static's synth is physical modelling btw.
(we also used karplus strong our mid 2000s 64ks)
(we also used karplus strong our mid 2000s 64ks)
jaw: something like that was what i did for the timpani sounds in uncovering static. i didnt do the spectrum analysis myself, i found a frequency/time/amplitude plot in the internet and rebuilt i think the 8 most dominant freqs with sine oscs and fiddled the envelope settings until it sounded good enough.
the rest of the instruments like the snare, bowed string, brass/woodwind, piano are all based on feedback delays, using various types of filters before during and after the loop to control and shape the spectrum. also controlled randomness for certain parameters helps a lot to make the sounds a lot more natural.
there are other ways of doing PM of course, but waveguides (delay based approach) is imho the most easy and compact way to do and gets you pretty far already.
and sauli is totally right. the best modelled instrument will sound like crap if it is not played right. i noticed that especialy for the bowed strings we used. they didnt change at all from first incarnation to actual intro usage but sounded completely different and way better in the end after reed had given it a proper score to play instead of me hitting randon notes on the keyboard during testing :)
the rest of the instruments like the snare, bowed string, brass/woodwind, piano are all based on feedback delays, using various types of filters before during and after the loop to control and shape the spectrum. also controlled randomness for certain parameters helps a lot to make the sounds a lot more natural.
there are other ways of doing PM of course, but waveguides (delay based approach) is imho the most easy and compact way to do and gets you pretty far already.
and sauli is totally right. the best modelled instrument will sound like crap if it is not played right. i noticed that especialy for the bowed strings we used. they didnt change at all from first incarnation to actual intro usage but sounded completely different and way better in the end after reed had given it a proper score to play instead of me hitting randon notes on the keyboard during testing :)