plucked string, wave-guide synthesis

Mar 26, 2009 at 11:54pm

plucked string, wave-guide synthesis

trying to complete a project for a sound portfolio, having trouble figuring out how to create excitation tables in max/msp. and forgotten, there’s an attachment of the block diagrams for the 2 different patches i’m trying to achieve

here’s the patch made most recently, most likely an embarrassing attempt, it’s the secon’d part which isn’t working.

any help would be well appreciated, thankyou

{
“patcher” : {
“fileversion” : 1,
“rect” : [ 55.0, 44.0, 1011.0, 736.0 ],
“bglocked” : 0,
“defrect” : [ 55.0, 44.0, 1011.0, 736.0 ],
“openrect” : [ 0.0, 0.0, 0.0, 0.0 ],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [ 15.0, 15.0 ],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“metadata” : [ ],
“boxes” : [ {
"box" : {
"maxclass" : "newobj",
"text" : "line~",
"id" : "obj-21",
"fontname" : "Arial",
"patching_rect" : [ 490.0, 220.0, 36.0, 20.0 ],
“numinlets” : 2,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "signal", "bang" ]
}

}
, {
“box” : {
“maxclass” : “button”,
“id” : “obj-20″,
“patching_rect” : [ 430.0, 30.0, 47.0, 47.0 ],
“numinlets” : 1,
“numoutlets” : 1,
“outlettype” : [ "bang" ]
}

}
, {
“box” : {
“maxclass” : “function”,
“id” : “obj-19″,
“patching_rect” : [ 430.0, 101.0, 200.0, 100.0 ],
“numinlets” : 1,
“numoutlets” : 4,
“outlettype” : [ "float", "", "", "bang" ]
}

}
, {
“box” : {
“maxclass” : “flonum”,
“maximum” : 1.0,
“id” : “obj-17″,
“fontname” : “Arial”,
“patching_rect” : [ 510.0, 374.0, 50.0, 20.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "float", "bang" ],
“minimum” : 0.0
}

}
, {
“box” : {
“maxclass” : “flonum”,
“maximum” : 1.0,
“id” : “obj-16″,
“fontname” : “Arial”,
“patching_rect” : [ 342.0, 478.0, 50.0, 20.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "float", "bang" ],
“minimum” : 0.0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “triangle~ 100″,
“id” : “obj-15″,
“fontname” : “Arial”,
“patching_rect” : [ 421.0, 267.0, 80.0, 20.0 ],
“numinlets” : 2,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "signal" ]
}

}
, {
“box” : {
“maxclass” : “gain~”,
“id” : “obj-14″,
“patching_rect” : [ 419.0, 469.0, 39.0, 84.0 ],
“numinlets” : 2,
“numoutlets” : 2,
“outlettype” : [ "signal", "int" ]
}

}
, {
“box” : {
“maxclass” : “scope~”,
“id” : “obj-12″,
“patching_rect” : [ 504.0, 498.0, 130.0, 130.0 ],
“numinlets” : 2,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “number”,
“id” : “obj-11″,
“fontname” : “Arial”,
“patching_rect” : [ 192.0, 390.0, 50.0, 20.0 ],
“numinlets” : 1,
“numoutlets” : 2,
“fontsize” : 12.0,
“outlettype” : [ "int", "bang" ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “*~ 0.3″,
“id” : “obj-10″,
“fontname” : “Arial”,
“patching_rect” : [ 319.0, 507.0, 42.0, 20.0 ],
“numinlets” : 2,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "signal" ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “lores~ 3000″,
“id” : “obj-9″,
“fontname” : “Arial”,
“patching_rect” : [ 318.0, 450.0, 74.0, 20.0 ],
“numinlets” : 3,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "signal" ]
}

}
, {
“box” : {
“maxclass” : “ezdac~”,
“id” : “obj-8″,
“patching_rect” : [ 407.0, 571.0, 45.0, 45.0 ],
“numinlets” : 2,
“numoutlets” : 0
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “tapout~ 5″,
“id” : “obj-7″,
“fontname” : “Arial”,
“patching_rect” : [ 419.0, 422.0, 61.0, 20.0 ],
“numinlets” : 1,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "signal" ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “tapin~ 300″,
“id” : “obj-6″,
“fontname” : “Arial”,
“patching_rect” : [ 419.0, 390.0, 67.0, 20.0 ],
“numinlets” : 1,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "tapconnect" ]
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “+~”,
“id” : “obj-4″,
“fontname” : “Arial”,
“patching_rect” : [ 419.0, 353.0, 32.5, 20.0 ],
“numinlets” : 2,
“numoutlets” : 1,
“fontsize” : 12.0,
“outlettype” : [ "signal" ]
}

}
],
“lines” : [ {
"patchline" : {
"source" : [ "obj-19", 1 ],
“destination” : [ "obj-21", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-20", 0 ],
“destination” : [ "obj-19", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-17", 0 ],
“destination” : [ "obj-7", 0 ],
“hidden” : 0,
“midpoints” : [ 519.5, 414.0, 428.5, 414.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-16", 0 ],
“destination” : [ "obj-10", 1 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-14", 0 ],
“destination” : [ "obj-8", 1 ],
“hidden” : 0,
“midpoints” : [ 428.5, 567.0, 442.5, 567.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-14", 0 ],
“destination” : [ "obj-8", 0 ],
“hidden” : 0,
“midpoints” : [ 428.5, 555.0, 428.0, 555.0, 428.0, 567.0, 416.5, 567.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-7", 0 ],
“destination” : [ "obj-14", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-4", 0 ],
“destination” : [ "obj-6", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-6", 0 ],
“destination” : [ "obj-7", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-7", 0 ],
“destination” : [ "obj-9", 0 ],
“hidden” : 0,
“midpoints” : [ 428.5, 444.0, 402.0, 444.0, 402.0, 444.0, 327.5, 444.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-7", 0 ],
“destination” : [ "obj-12", 0 ],
“hidden” : 0,
“midpoints” : [ 428.5, 456.0, 513.5, 456.0 ]
}

}
, {
“patchline” : {
“source” : [ "obj-9", 0 ],
“destination” : [ "obj-10", 0 ],
“hidden” : 0,
“midpoints” : [ ]
}

}
, {
“patchline” : {
“source” : [ "obj-10", 0 ],
“destination” : [ "obj-4", 1 ],
“hidden” : 0,
“midpoints” : [ 328.5, 536.0, 277.0, 536.0, 277.0, 337.0, 442.0, 337.0 ]
}

}
]
}

}

#43040
Mar 27, 2009 at 5:44am

jimbojones wrote on Thu, 26 March 2009 16:54trying to complete a project for a sound portfolio, having trouble figuring out how to create excitation tables in max/msp. and forgotten, there’s an attachment of the block diagrams for the 2 different patches i’m trying to achieve

Here’s a version I made a couple of weeks ago. Hope it helps.

– Pasted Max Patch, click to expand. –
#154215
Mar 27, 2009 at 12:15pm

yeah that has helped, just looking at it now, it’s just the initial excitation part i’m confused with, how does that work exactly?

#154216
Mar 27, 2009 at 3:53pm

Below a method based on biquad, as I used to learn it on school. Actually, the sample rate by frequency division inside the find_delay_time should be a float calculation.

_
johan

– Pasted Max Patch, click to expand. –
#154217
Mar 27, 2009 at 10:37pm

mzed wrote on Fri, 27 March 2009 00:44

Here’s a version I made a couple of weeks ago. Hope it helps.

– Pasted Max Patch, click to expand. –

Very cool. I adjusted it so you can send low numbers after the [mtof], down to 1., which makes things resonate for a very long time. Really interesting effect, especially if you adjust the [onepole] too.

#154218
Mar 28, 2009 at 3:13am

Ah, this is when all the Karplus-Strong models come out of the woodwork.

This is one I made a couple of weeks ago too.

My one uses [biquad~] like jkvr’s (and steals the [filtergraph~] controls from the help file), and allows you see how the sound burst affects the tone. You can get some interesting results with different filter methods, such as bandstop. Don’t use a positive Q or gain > 1 though.

mzed’s version uses [delay~] which, while it still works, will give you poor pitch accuracy in higher frequencies.

http://x37v.com/x37v/writing/karplus-strong-synthesis/

– Pasted Max Patch, click to expand. –
#154219
Mar 28, 2009 at 8:15am

Quote:mzed’s version uses [delay~] which, while it still works, will give you poor pitch accuracy in higher frequencies

That would imply that tapout is able to set a delay time in fractions of samples. To my understanding, one needs a filter to do that.

_
johan

– Pasted Max Patch, click to expand. –
#154220
Mar 28, 2009 at 8:56pm

thanks for all the patches they’re helping well.

one more thing a few years ago when i was learning this i’m sure we made a patch using the function generator to plot in the shape of the excitation wave to resonate, or it was the wave oscillating (changing the frequency using an argument in the function generator) it’s a shame i never kept these patches. how do you achieve this?

thanks again

#154221
Mar 28, 2009 at 9:15pm

check out the Max-made ‘Kapling’ app while you’re researching:
http://www.cycling74.com/forums/index.php?t=msg&goto=165622

Perhaps you could contact him/her offline and ask them for secrets of the trade.

#154222
Mar 28, 2009 at 11:45pm

thats a pretty cool little app cheers.

research isn’t for music rather a portfolio of sounds (which we have to make from scratch) as part of my course.

a few years ago i’m sure using max 4 at my last uni we were using the function generator to make the shape of the wave to be oscillated (sprry for lack of technical words, hope you know what i’m trying to say), thats the particular thing i’m trying to remember how to do. shame all my old patches were on the server at that uni.

does anyone know how to do that? if i remember right it wasn’t anything too complicated which is why it’s quite frustrating to forget it

thanks again, it’s all been helpful

#154223
Mar 29, 2009 at 1:02am
jimbojones wrote on Sat, 28 March 2009 18:45
thats a pretty cool little app cheers.

a few years ago i’m sure using max 4 at my last uni we were using the function generator to make the shape of the wave to be oscillated (sorry for lack of technical words, hope you know what i’m trying to say), thats the particular thing i’m trying to remember how to do. shame all my old patches were on the server at that uni.

Lots of ways to create your waveform, you can draw directly into a waveform~ object (which creates the samples in the buffer~), you could use the breakpoint function object (but it’s straight lines only), multislider, etc. Then you can use [pattr] on the multislider for interpolation, lots of possibilities there. The [expr] functions in the example patch earlier are also cool ways to generate sets of points, so you can have some fun tweaking them too (change coefficients, exponents, etc).

If you can get the lists working from a jit.bfg, this is also a great way to generate cool functions. So get the dimensions right (say, 16 X 16 to make a total of 256 samples), use jit.spill to create the list, then a peek~ into a buffer for storage and playback. you may need to use jit.normalize or a jit.op to make the values signal-ready (range from -1. to 1. as a standard starting point).

Also you can just try plain old cycle~ objects hooked up together, with *~ for modulation, as well as hooking a cycle~ to another cycle~ (but in the right inlet), which gives you lots of wackiness at high volumes and various frequencies. These will create rougher-sounding waveforms which might be fun.

Here’s a project I did recently, it’s somewhat related—lets you create, edit, and play back sine-based waves, with control over a bunch of parameters like coeffs and exponents, and three “layers” of L/R/Mix going on at once. It’s here:

http://www.third-space-mind.com/max/max_classproject_2.htm

Have fun!

#154224
Mar 29, 2009 at 2:00am
jvkr wrote on Sat, 28 March 2009 19:15
Quote:
mzed’s version uses [delay~] which, while it still works, will give you poor pitch accuracy in higher frequencies

That would imply that tapout is able to set a delay time in fractions of samples. To my understanding, one needs a filter to do that.

[tapout~] will do subsample interpolation if you send delay time as a sig~ (as far as I can tell – try changing the value after the decimal point in the ‘delay time is samples’ part of my patch for micro-tuning the tone after plucking). Your version with the [delay~] is great – but I hear no difference when I switch the [selector~] as they both seem in tune.

#154225
Mar 29, 2009 at 6:57am

jimbojones wrote on Sat, 28 March 2009 17:45
…we were using the function generator to make the shape of the wave to be oscillated (sprry for lack of technical words, hope you know what i’m trying to say), thats the particular thing i’m trying to remember how to do. shame all my old patches were on the server at that uni.

does anyone know how to do that?…

…similar idea to this within the examples folder:
Max/examples/utilities/buffer-writer.maxpat

multislider is superb as seejayjames pointed out, here’s a patch i posted on another thread so it probably has a lot more explanation than you need and all you have to do is apply it to an oscillator as opposed to an LFO(you may want to increase the dimensions of the multislider for better waveform resolution):

– Pasted Max Patch, click to expand. –
#154226
Mar 29, 2009 at 7:21am
Quote:
[tapout~] will do subsample interpolation if you send delay time as a sig~ (as far as I can tell – try changing the value after the decimal point in the ‘delay time is samples’ part of my patch for micro-tuning the tone after plucking).

Those values after the decimal point are ms fractions, but still whole samples. If tapout~ can have delay times set in fractions of samples is something the developer can tell, but anyhow would imply filtering. That’s what the second biquad~ is doing in that patch, although the two could be combined in one. By averaging this sample and the previous sample (a0 = 0.5, a1 = 0.5) the signal will be shifted half a sample.

Quote:
Your version with the [delay~] is great – but I hear no difference when I switch the [selector~] as they both seem in tune.

Because of the rounding to whole samples, which is rounding down, all pitches will be slightly too high. If you switch immediately after plucking, you can hear the pitch go down. Maybe better to hear with a reference oscillator (whose pitches are also incorrect). With the e-flat the difference is quite big.

_
johan

#154227
Mar 29, 2009 at 9:35am
Quote:
If tapout~ can have delay times set in fractions of samples is something the developer can tell, but anyhow would imply filtering.

tapout~ does subsample interpolation (if the delay time is provided by a signal). so yes, it can have fractional sample delay times and you can clearly hear the filtering involved.

try 441 Hz (@ sr 44.1 kHz) this is 100 samples period, and compare to 440 Hz, which has something like 100.227 samples period.
the resulting spectra sound quite different.

btw. using an allpass filter to do the subsample interpolation would more or less eliminate the high freq damping. this was not done in tapout~ (nor in comb~ or teeth~, which are in fact worse).
to try this you could use rtcmix~ or csound~ etc. with the appropriate opcodes.
my go on this allpass interpolation thing (max external) can be found here:
http://www.esbasel.ch/Downloads/MaxMSP-Objects.htm

nb: to get correct tuning don’t forget to shorten the delay length by one sample, as shown in the example by x37v.

vb

#154228
Mar 29, 2009 at 12:02pm

Quote:try 441 Hz (@ sr 44.1 kHz) this is 100 samples period, and compare to 440 Hz, which has something like 100.227 samples period. the resulting spectra sound quite different.

Confirmed. That is why in x37v’s example using the band notch, each key clearly sounds different. Based on that notion, I made a few additions.

_
johan

– Pasted Max Patch, click to expand. –
#154229
Mar 29, 2009 at 4:29pm

trying to open some of the patches posted on here and getting some errors,

johan, yours was:

clipboard JSON conversation
parsing null: line=594, char=42, text=’…”fontname”:”Arial”, “patching_rect”: [1001.0,266.0, nt'

rabid raja it said :

clipboard JSON conversation
',' or '}' character expected after value for key 'outlettype': line=80, char=40, text='...al", "id" : "obj-48", "outlettype" : [ "float", "bang" ]m’

absolutely no idea what these mean but unfortunately it won’t open the patches?

#154230
Mar 29, 2009 at 7:25pm

Quote:trying to open some of the patches posted on here and getting some errors

Is it because you omitted the ———–end_max5_patcher———– part of the patch? That leads to this kind of errors.

_
johan

This post seems to contain a broken pasted patch. This can happen if you don’t copy the entire “———-begin_max5_patcher———-” or “———–end_max5_patcher———–” for each and every patch you paste; perhaps you missed a preceding or trailing “-” when you copied the patch? Please notify the Cycling 74 web team if you think it is a bug.

#154231

You must be logged in to reply to this topic.