electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Improving the kijjaz Guitar
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 2 [37 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 3:40 am    Post subject: Improving the kijjaz Guitar
Subject description: Your suggestions please
Reply with quote  Mark this post and the followings unread

Hey, it's me again. I've been using kijjaz's guitar and drum models in my programs and they work just fine, but I feel that the guitar model has reached a sort of plateau. It's based on the mandolin, with a number of mandolin instruments summed together and sent into a SinOsc limiter. Here is the guitar model that I'm using right now, recoded completely from kijjaz's original example:

Code:

// guitar based on kijjaz's model
class guitar {
    // define guitar strings
    num_guitar_strings => int num_strings;
    Mandolin mandy[num_strings];
    //
    // distortion
    Gain gd_in => Gain divide => Gain gd_out;
    gd_in => FullRect fwr => Gain add => divide;
    Step step => add;
    4 => divide.op;  // make it a divider
    0.025 => step.next;
    //
    // hook up guitar and pedals
    // summ strings into pedal
    for (int i; i <num_strings> gd_in;
    }
    gd_out => Gain output;
   
    fun void strum (float freq, float pluck) {
        for (int i; i <num_strings> mandy[i].freq;
            pluck => mandy[i].pluck;
        }
    }
   
    fun void set_guitar (int numStrings, float strength, float stringDamping, float bodySize, float stringDetune) {
        numStrings => num_strings;
        for (int i; i <num_strings> mandy[i].gain;
            stringDamping => mandy[i].stringDamping;
            bodySize => mandy[i].bodySize;
            stringDetune => mandy[i].stringDetune;
        }
    }
}


Note that I have modified the distortion to be x/(n+|x|) type, as discussed in the earlier distortion thread.

What I would like to do is model the guitar more realistically including 6 strings, or 4 strings for a bass guitar model. This would include playing notes and chords. I have the option of using the Mandolin, StifKarp, or Sitar instruments in ChucK, but I'd rather do it with string synthesis.

Would anyone care to enlighten me as to a string synthesis technique that might be reasonably efficient in ChucK? Kijjaz, Kassen, you both are familiar with this sort of thing, what do you suggest? Anyone else? Thanks.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 4:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh, OK, I did a search and found the wiki pages on Karplus-Strong string synthsis and group delay, here:

http://en.wikipedia.org/wiki/Karplus-Strong_string_synthesis

and here:

http://en.wikipedia.org/wiki/Group_delay

You send a burst of noise into a feedback loop consisting of a delay line and a filter. The burst of noise should be one period long and the delay line plus the group delay of the fiilter should add up to one period.

So what the guitar model, called a Digitar for Digital Guitar by Karplus and Strong needs is six of these strings. Then we can have the software set the frequency of each string to make a chord, or just do one string for a note.

Other guitar effects such as bending could be simulated by varying the delay over the duration of the note.

Also note that the filter must attenuate the feedback signal, so I suppose that the sustain of the note is determined by the amount of attenuation.

Looks like this will be a bit of an effort but worth the time. Digitar!

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 5:25 am    Post subject: Reply with quote  Mark this post and the followings unread

I coded it up, and guess what? It works!

The algorithm seems to be very sensitive to the filter characteristics, though. Anyone care to have a listen and give me some "feedback"?


Digitar1.ck
 Description:
Digitar!

Download
 Filename:  Digitar1.ck
 Filesize:  1.33 KB
 Downloaded:  551 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 6:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Hey, guess what? Now it plays chords!

The model actually strums up and down with a short delay between each string pluck to simulate the motion of a strumming pick. Listen for eight E chords followed by eight A chords, followed by eight D chords.

Whoot! This is fun.


Digitar3.ck
 Description:
Digitar!

Download
 Filename:  Digitar3.ck
 Filesize:  2.42 KB
 Downloaded:  584 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 7:43 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor: The model is nice and straight forward.
But there are some sound in it that sustains too much with open string's note,
so I tried to adjust that a little and see how it'd sound.
I also tried to add some other features
but now maybe too much sustains of 2nd harmonic is there,
but it sounds okay.
sounds more like guitar harmonics.


Inventor - digitar1_940 - kijjaz remix 01.ck
 Description:
digitar1+940 kijjaz remix 01

Download
 Filename:  Inventor - digitar1_940 - kijjaz remix 01.ck
 Filesize:  1.97 KB
 Downloaded:  562 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 7:51 am    Post subject: Reply with quote  Mark this post and the followings unread

and this one has a closer timbre to the acoustic guitar
but still not there yet hahahaha.


Inventor - digitar1_940 - kijjaz remix 02.ck
 Description:
digitar1_940 - kijjaz remix 02

Download
 Filename:  Inventor - digitar1_940 - kijjaz remix 02.ck
 Filesize:  2.18 KB
 Downloaded:  566 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 8:00 am    Post subject: Reply with quote  Mark this post and the followings unread

Yeah, kijjaz, yeah!

I rolled your changes into the latest version, to which I added heavy distortion. It sounds almost *exactly* like my Stratocaster! Now we have an awesome guitar model to use in the next rewrite of the generator!

You are the man, kijjaz!


Digitar5.ck
 Description:
Digitar with kijjaz's Improvements

Download
 Filename:  Digitar5.ck
 Filesize:  3.48 KB
 Downloaded:  603 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 8:28 am    Post subject: Reply with quote  Mark this post and the followings unread

That is an amazing distortion sound for this guitar!! -_-

I'm trying to get a simpler sound from a simpler model:
the original StifKarp = Karplus-Strong algorithm with simple low-pass filter.

But i'll try to add more things to make it sounds more natural
especially the detuning effect in the string.


kijjaz - Simple Guitar Design 0.1.0.ck
 Description:
kijjaz - Simple Guitar Design 0.1.0

Download
 Filename:  kijjaz - Simple Guitar Design 0.1.0.ck
 Filesize:  919 Bytes
 Downloaded:  529 Time(s)


kijjaz - Simple Guitar Design 0.1.0.ck
 Description:
Simple Guitar Design 0.1.0

Download
 Filename:  kijjaz - Simple Guitar Design 0.1.0.ck
 Filesize:  919 Bytes
 Downloaded:  522 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 9:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Including a pick-sound model


kijjaz - Simple Guitar Design 0.1.1.ck
 Description:
Simple Guitar Design 0.1.1

Download
 Filename:  kijjaz - Simple Guitar Design 0.1.1.ck
 Filesize:  1.06 KB
 Downloaded:  528 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 9:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Testing a Sympathetic String model.

This can be very good for simulating the reverberation in the open strings also.

Now it sounds quite acoustic.


kijjaz - Simple Guitar Design 0.1.2.ck
 Description:
Simple Guitar Design 0.1.2

Download
 Filename:  kijjaz - Simple Guitar Design 0.1.2.ck
 Filesize:  1.94 KB
 Downloaded:  533 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 9:19 am    Post subject: Reply with quote  Mark this post and the followings unread

Now this sounds like a nylon-string guitar or a mandolin with sympathetic strings.


kijjaz - Simple Guitar Design 0.1.2-1.ck
 Description:
Simple Guitar Design 0.1.2-1

Download
 Filename:  kijjaz - Simple Guitar Design 0.1.2-1.ck
 Filesize:  2.11 KB
 Downloaded:  485 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 9:49 am    Post subject: Reply with quote  Mark this post and the followings unread

kijjaz, you are making guitar models faster than I can even test them! Ah, but we have both been busy.

Here is the Karplus-Strong guitar with kijjaz's modification and a monome-like keyboard interface to a Boolean Sequencer. It begins silent with a blank logic table printed on the console monitor, then when you press the array of 40 alpha-numeric+symbol keys, the program modifies the logic table accordingly and begins to play.

Function keys F1 through F4 select from four banks of logic equation subtables. Replace shred button clears everything and starts over.

It's over 250 lines of code now and beginning to show some decent functionality. What fun!


Digitar7.ck
 Description:
Digitar with Boolean Sequencer and Monome-like Keyboard Interface

Download
 Filename:  Digitar7.ck
 Filesize:  7.2 KB
 Downloaded:  437 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Tue Mar 10, 2009 10:24 am    Post subject: Reply with quote  Mark this post and the followings unread

ahhh i can't get the keyboard to work with ChucK -_-"
gonna fix this soon.

by the way, i've just find out a way to greatly fix the tuning. The high notes were usually sound flatter than lower notes.

Now the engine has 2 delays:
d1 has delay time = second/frequency - samp
d2 has delay time = 2::samp

then the feedback are mixed from d1 and d1 => d2

this happens to be able to fix a lot of problem with tuning.
but not sure if it's 100%


kijjaz - Simple Guitar Design 0.1.3.ck
 Description:
Simple Guitar Design 0.1.3

Download
 Filename:  kijjaz - Simple Guitar Design 0.1.3.ck
 Filesize:  2.22 KB
 Downloaded:  399 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 10:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Well, in the Wikipedia entry for Karplus-Strong they mention that the frequency is equal to the delay *plus* the group delay of the filter. That's why I included the Wikipedia entry for group delay in the second post as well.

So to fix the tuning problem, I think we need to figure out the group delay of the filter and incorporate that into the delay line setting.

Also if I read correctly, the noise burst duration should be equal to 1/frequency, which it is not in the current model. That makes sense because we want to fill the full delay with noise, not just some of it.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Mar 10, 2009 1:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
Well, in the Wikipedia entry for Karplus-Strong they mention that the frequency is equal to the delay *plus* the group delay of the filter. That's why I included the Wikipedia entry for group delay in the second post as well.


Don't forget about the sample of extra delay inherent in a feedback loop. Originally the filter used simply averaged between the current and the last (z-1) sample, later evolutions of KS of course use more elaborate filters.

Quote:
So to fix the tuning problem, I think we need to figure out the group delay of the filter and incorporate that into the delay line setting.


Shouldn't the important factor be the phase effect of the filter at the frequency intended? A 4 pole filter (or 2 2pole ones, to make things easy with LPF which I think is a 2 pole filter) should be phase-neutral at the set gain.

Quote:
Also if I read correctly, the noise burst duration should be equal to 1/frequency, which it is not in the current model. That makes sense because we want to fill the full delay with noise, not just some of it.


As I see things the burst of noise relates to the way the string is plucked/struck/bowed/whatever. Texturing the noise and enveloping it will all have interesting expressive effects. I used to experiment with resonators fed by drum-machine hits quite extensively. Different high-hats and cymbals would sound a bit like bowing while toms would be more akin to a blow to the body of a electric bass-guitar (a interesting playing technique at high gain!), those were certainly way longer than second/f.

Also remember, BTW, that you can halve the frequency by inverting the feedback gain and that it can be useful to remove DC offset (either inside of the loop or after the instrument).

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 4:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for all the info, Kassen. It's a little over my head, but I'll do my best to apply it!
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 7:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, I took a walk and got some afternoon sleep, so I'm up for another night of coding. Smile

Here is the progress so far, the latest version of Digitar. It has adjustable distortion and distortion wet/dry mix, so you can remove the distortion if you like. It also plays either notes or chords so you can make it shred if you like, plus I added a bunch of chords.

When you start it up, it's silent because the logic matrix is empty. Just use the alpha-numeric keys plus some symbol keys in a 10x4 matrix to toggle some logic bits and you will start to hear notes.

Press F1 thru F4 to select which of the four banks of logic table entries the keys map. Press tilde (without the shift) to make the +/- keys adjust distortion up and down. Press tab to make the +/- keys adjust distortion wet/dry mix. Press capslock to toggle between notes and chords.

That's it for now! Enjoy!


Digitar11.ck
 Description:
Digitar with control enhancements :)

Download
 Filename:  Digitar11.ck
 Filesize:  11.21 KB
 Downloaded:  426 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Mar 10, 2009 8:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
Thanks for all the info, Kassen. It's a little over my head, but I'll do my best to apply it!


Shout if you get stuck, I didn't intend to write "impressive clever" stuff, I wanted to share some notes on working practically with KS. If something there looks incomprehensible I'll try to re-phrase it.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 10, 2009 9:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
Inventor wrote:
Thanks for all the info, Kassen. It's a little over my head, but I'll do my best to apply it!


Shout if you get stuck, I didn't intend to write "impressive clever" stuff, I wanted to share some notes on working practically with KS. If something there looks incomprehensible I'll try to re-phrase it.


Well, one question: why would a four-pole filter be phase neutral at the set gain? As I understand it a simple LPF model with default Q of 1 has zero phase at DC, increasing phase as frequency increases, and 90 degrees of phase at high frequencies for each pole.

In this case we're setting the cutoff to three times the string frequency, so that puts us in the region where the phase is well under 45 degrees.

Also a four pole filter, even if it had phase of 360 degrees at the string frequency, would have a one cycle delay time. I think this is what is meant by the group delay of the filter, which is why the Wikipedia page on Karplus-Strong said that the feedback loop should have delay equal to the delay line delay plus the filter group delay.

So, in summary, I think we need to figure out the group delay of a 2-pole low-pass filter at 1/3 cutoff frequency and subtract that from the period of the string frequency to set the delay line.

Does that make any sense?

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
telstarmagikistferrari



Joined: Jun 16, 2008
Posts: 280
Location: Indianapolis, Indiana
Audio files: 43

PostPosted: Tue Mar 10, 2009 10:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

This program is super interesting, especially the interface.
I've read several reviews for software (always NI Kontakt engine) for emulating strumming, etc. I love that similar things are being done in the ChucK community, however small.

Using a regular keyboard in place of a multi-thousand-dollar monome appeals to no end, all aesthetic differences aside. Smile Really cool stuff, Inventor/(kijjaz/Kassen)!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Mar 11, 2009 5:30 am    Post subject: Reply with quote  Mark this post and the followings unread

Thank you telstar!

Here is the most recent source code and an audio demonstration. I added some features, including barre chords, reverb, microphone input, and recording.


Digitar15.ck
 Description:
The latest Digitar source code

Download
 Filename:  Digitar15.ck
 Filesize:  15.01 KB
 Downloaded:  398 Time(s)


Digitar.mp3
 Description:
Demonstration audio file

Download
 Filename:  Digitar.mp3
 Filesize:  3.39 MB
 Downloaded:  1099 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Mar 11, 2009 10:21 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:

Well, one question: why would a four-pole filter be phase neutral at the set gain? As I understand it a simple LPF model with default Q of 1 has zero phase at DC, increasing phase as frequency increases, and 90 degrees of phase at high frequencies for each pole.


I think it should have a 90° phase offset at the cutoff frequency per pole. Hence 4 pole filters will resonate; if you add feedback it lines up exactly at the cutoff frequency creating a resonant peak there.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Wed Mar 11, 2009 11:18 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
Inventor wrote:

Well, one question: why would a four-pole filter be phase neutral at the set gain? As I understand it a simple LPF model with default Q of 1 has zero phase at DC, increasing phase as frequency increases, and 90 degrees of phase at high frequencies for each pole.


I think it should have a 90° phase offset at the cutoff frequency per pole. Hence 4 pole filters will resonate; if you add feedback it lines up exactly at the cutoff frequency creating a resonant peak there.


Well I'm not sure be I doubt that a 4-pole low-pass filter with feedback will resonate because the gain at the cutoff frequency is -3dB, so the loop gain is below unity. Isn't there a resonant peak below the cutoff frequency for Q higher than 1, as in a Wah pedal? Not sure. But how would that affect the delay calculations for Karplus-Strong anyway?

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Wed Mar 11, 2009 11:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
But how would that affect the delay calculations for Karplus-Strong anyway?


I'm not 100% sure ... but let me try anyway ...

When you'd have a phase shift of lets say 180 deg at for a filter that is in your loop at the resonance frequency that 180 deg shift would amount to half a period of that particular frequency, and thus it corresponds with 1/2f seconds of delay in the signal and that would be the delay to compensate for. Now you probably wont re-tune your filter for different lengths of the delay line (different ouput frequencies), so you'll also have to figure out the filter delay for all other frequencies (based on the actual phase shift at those frequencies).

Now when you are having a filter with constant group delay you'd see that that all those times would evaluate to the same value, and you'd have to subtract that fixed value from the calculated delay time for the delay line (based upon the wanted frequency). So that would be sort of easy to calculate (based upon a known phase shift at a known frequency for the filter chosen).

Now what filters would exhibit constant group delay is another question ... Bessel filters are said to approximate it ... but I really know nothing here.

There would be another possible approach ... namely making a tuning table that you manually fix for some frequencies and then perform a linear interpolation on for the in-between frequency values.

Anyway, anyone, please correct me when I'm wrong.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Thu Mar 12, 2009 11:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello ChucK people,

This guitar thread caught my attention because I have an interest in Karplus-Strong models.

First, let me warn that I am _not_ a ChucK programmer, in fact, I am lower than a noob. I've looked at the source, but I'm very lost.

My question, however, is really about K-S.

I've implemented K-S in a few different digital synthesizers using an FPGA. One is an 8 voice polysynth ( PolyDaWG/8 ) and the other is a 56 string "harp" I call Xarp-56. I also experimented with the Perry Cooke slide flute model a bit.

My question is regarding the string model and the reflection filter. My implementation uses a simple single pole IIR filter. I see there is a bit of discussion here regarding more than one pole for the reflection filter.

I thought about using a 2 or more pole filter, such as a state variable filter in lowpass mode and assumed that this would cause harmonics at the filter's resonance (Fc) to die out more slowly than the fundamental assuming Fc is above the fundamental of the string's natural vibrational frequency and a Q of greater than unity and some general attentuation to keep the gain < unity at all frequencies. Is this a correct assumption? Seems it would be interesting to be able to select the harmonic to enhance this way.

I'm curious as to what instrument types this technique models.

What I'm not seeing in the ChucK source for this project is the structure of the reflection filter - is this part of a library?

With FPGA design, I have to create such filters without the benefit of a library other than a "library" of modules I've created myself or obtained from others. I've gotten code for things like UART and DAC drivers from friends. The bulk of the code in my designs was code I wrote.

Anyone who might be interested in my FPGA MIDI synth designs can look at the links in my sig...

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima

Last edited by JovianPyx on Thu Mar 12, 2009 11:36 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 2 [37 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use