Delicious Max/MSP Tutorial 1: Karplus-Strong
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- www.otherbirds....
First ever tutorial! Can you contain your excitement? Because I am hemorrhaging excitement right about now. Quick how-to put together an implementation of the Karplus-Strong synthesis algorithm, getting you some good guitar sounds for basically zero effort.
So clear and concise. Thank you for this. So much better than every other channel I’ve seen
AMAZING havent even finished the video but been looking for tutorials and everyone just makes it so boring with technicality. This is a good way to get strarted. This truly is DELICIOUS.
Just wanna say, after ten years of owning max and somehow never connecting with it, that this video bust my max cherry. Now im running. Thanx soooo muccccchhh even tho this shit is OLD, thanxxxx.
This comment makes me feel old
ew
one pole low pass filter means it will atenuate 6db per octave of your cutoff frequency, great tutorial it mades me remember my times in college!
i love you. what i mean by that is that i completely appreciate your willingness to take the time to do these videos. i am in my max trial phase and this is exactly the kind of thing i need to discern whether i will be able to handle max or if i should leave it to others to make the tools i use. eyeopening stuff and the first glimmer into the potential future of my programing self. maybe i CAN make monome patches!!!
Whew. Thanks for clearing that up.
Oh, and if you're into monome patches, check out videos from stretta, the crown prince of the monome.
You do great work for people, truly appreciate your tutorials.
Make sure you click the 'maxsustain 10' message box to send that message to the adsr~ object.
love that you've made these! i've been looking for tutorials like this for a hot minute - thanks!
Max is super interesting. I looked at it years ago. I love exploring concepts like this
You're so right. It's hard to step further then the basics. It's such a big Maxworld.
But this tutorial shows a good example, great.
Looking forward to the next one!!
Simply the greatest tutorial i've watched so far. Thanks so much !
Hi Sam, I figured out how to get it tuned to a440 hz and get the intervals tuned.
instead of 1000 / freq, use samplefreq / freq.
(samplefreq is in this case your nyquist freq or samplerate / 2)
love your work
Joost
@yuvalishes That might help. The real problem is that the length of the delay line is changing discontinuously when you change notes. So you can do one of three things: Make sure you envelope the output to zero when changing notes, change frequency continuously (like a glissando), or wrap the whole thing into a poly object so you can get polyphony. That way you can let the old note "ring out" while starting a new one.
Looking forward to some badass color tracking festivities.
As was said the delay line length determines the frequency but the low pass filter introduces phase delays which add on to the delay line length. This puts the instrument out of tune. This can accounted for as long as you know the phase delays. The Csound example referenced by Michael Mcloughlin uses a first order feedforward averaging filter which introduces a half sample delay, the All-pass filter is then added to add another half sample delay to make the overall delay time more manageable.
So fast! Awesome. I thought karplus was to take a noise buffer and average n_0 with n_1 recursive... this seems to get something going very well. Awesome!
@tonykanemusic Oh, well, bear in mind that the power you're talking about (something that Max definitely, definitely has) can be a double edged sword. Max definitely has the ability to handle even temperament. It also has the ability to let someone like me screw it up. If this patch sounds borked to you that probably reflects more on me than it does on Max.
@elARTEdelPOOP An explanation: the t is short for trigger, an object that takes one input and sends it to multiple outputs in order from right to left. Here, I want to set the pitch, then start playing the note. So the right outlet goes to pitch and the left triggers the envelope. The reason one argument is b and the other f is that I want the format of the right outlet to be a float and the left a bang. See the help file for more (you can option-click any object to see its help file).
wow this is pretty simple yet I'm getting some nice sounds out of this. Many thanks
yer tutes are great!.....simple, intermediate....expert...whatever. i like the way you present them.
@rishabhrajan Yes, you're exactly right. So the issue here is that tapin~ and tapout~ can't delay sound by less that one signal vector in size. In case you don't know what I mean, Max passes around sound not as individual samples but in chunks called signal vectors. Usually this doesn't matter but in special cases like this one you can run into trouble. If you increase your sample rate or decrease your vector size you should be able to get higher notes.
Fun simple addition: add in a clip~ before the gain~ for a distorted electric guitar sound.
a great tutorial! thanks, really clear, really to the point.
This is really well done. Thanks! Very clear and instructive.
The lowpass filter is to blame, it changes the frequency of the string every so slightly in a non-linear fashion. There are solutions to it by using a linear phase filter.
Someone below said to click the max sustain message. It works.
This is a wicked tutorIal, thank you very much, Sam. I especially love the rand~ object for the tone.
I am completely new, even to the concept of Max/MSP. Its been one month now, and I have come pretty close to giving it all up; but for the quality of both the instruction and of the resultant tone that have driven me to continue the foray. and I'm now wondering if its possible to encapsulate most of the data structures into an abstraction/sub-patch. I have followed one of the Cycling '74 instructor's clips for the poly~ and would love to incorporate the KS algorithm
Kind regards,
Mikey.
@petertenhove Cheers, man, hopefully I'll be able to find time to do it. Let me know if there's anything in particular you'd like to see covered.
After the notein object, Use a ggate to discard any pitch data when the velocity is 0 (which is a note-off message). So then you just get note on messages going through
Woah, awesome sound! A lot warmer than distortion with clip~
Wow, that was a great job! Thanks!
@yuvalishes So to borrow a phrase from a fancy college, I leave the challenge of fixing that click "as an exercise to the reader" :]
If you'd like a hint, the click is happening because something is changing discontinuously. Here's another hint: do you still hear the click if you play the same note rapidly?
Nice and clear - thanks!
Make sure you type !/ 1000. with the full-stop/period mark after it - otherwise it will round the frequencies to whole numbers and you won't get even temperament.
Thanks for the demo !
Very nice...clear description. I wonder if you have considered starting a tutorial with the finished patch playing some music. What it does before how it does it.
@ronnie9253 Hey, thanks. Let me know if there's something specific you'd like to see covered.
Also be aware the filter influences pitch because of phase changes.
@miuziqa Something like that. You might have to do use a midiparse message since the data coming from live is raw midi rather than node on, note off data in M4L, I think. I'm not 100% sure.
Really nice explanation!
You can protect resource and license a MAX MSP app with QuickLicense or AppProtect.
So cool!
This is delicious indeed!
great vid. Im looking to do an interactive soundscape,where one continuos sound plays for the duration and other sounds fade in/out depending on the probability they are set to, by the user.....
great tutorial simple and powerfull
@dude837 Good point teacher. :) I assume making an amplitude envelope for each note would help.
I'm working on a color tracking musical piece. I uploaded some tests to my channel but I will post the progress I've made ( some thanks to you) soon. cheers.
I'm pretty sure that this implementation of the karplus strong method has tuning issues. I've seen code (the Csound implentation) where this problem is fixed by adding an allpass filter to the output.
Thank you , really helpful for me
Great vid!
Just in case you are still reading these comments, the link to the patches for every video in the series point to somewhere McAfee AV reckons it's bogus and contains a long list of virus'.
@tonykanemusic Do you ask because it doesn't sound quite right? I don't know what's up but to me it almost sounds like it's in a just intonation as opposed to an even temperament. I'm not sure why, though...
thank you!! great tutorial
This tutorial is cool 😎 and good.
Great tutorial, so essentially a low pass filter after the soure/noise and before the delay changes the timbre?
I do exactly the same, but when i press the ''1'' there is this white noise sound and won't stop. What am i doing wrong?!
I saw this in school but i didnt remember thanks!!!
Does anyone know where to get the Bass tutorials h mentions at the beginning?
I am so confused, I've done everything correct but my envelope is not at all affecting the noise oscillator. I am multiplying the two together and all of my routing is correct. what do i do?
@dude837
What about making cool drum sounds using synthesis. As off seeing direct results I started with this. And me having no musical background it's just fiddling.
how do I do a slider for flonum? that will go by floating-point numbers
@XLTrickster Hmm.... I'm not sure exactly the effect you're talking about. Do you think you could send me an example?
@agbengip Thanks, man, good to know. If you think you could point me to a good explanation of filter theory in general, that would be awesome. Signal processing is just one of those things I just can't make stick.
It's a message not an object, that's why!
great tutorials duuuude!
Can I ask you for more advices? I want to learn Max as much as possible, to be able to create my own plugins(instruments, audio effects etc), besides these amazing tutorials, does it happen that you know any books, or other videos or articles on learning Max? But they should be about music and sound design synthesis and stuff like that:) I would love a response from you!
Thank you very much!
Great tutorial dude. You should be teaching this at a fancy college :).
One question about this patch though. It seems to be very clicky when used in fast passages of notes. Any way to avoid that?
better than my professor. I walk out of class and watch these and somehow am head of the class
Nice demo. If you want to see how it all began, search for "David A Jaffe Silicon Valley Breakdown"
hello bro just watched your video and it gives me an insight as to how to use max. how do i use it in producing a song. any tip would really help right now. thanks
great job, please put subtitles, we would be thankful
What's the object below the {!/ 1000.} ? Thanks for the videos, keep it up.
Thx dude, good tuto!
Merci bien, mon petit cochon.
lol
j' ai l' accent même quand j' écris? :)
Cedric Franchetti Nah, but for whatever reason when youtube sends me the comment notification, it's translated by _your_ location. So I got " Nouvelle activité concernant votre vidéo" dans mon inbox.
I get up to the point where i'm meant to get the click after setting up the gain, however i get no sound, any ideas where im going wrong ?
Hey, help me out please. i am not able to open the karplus maxput you've put in the link. It is sayin 'error parsing file.... some possible initial '{' .... '
@ProphetVS Thanks for the info! Do you have a background in DSP? Can you recommend a good introduction for someone like me? I'd appreciate the hell out of it.
Is there some way to get the keyboard working with this? I mean I got a "midiin" object to recieve midi signals from my actual keyboard, but for some reason what appears to be note off messages causes the sound to spaz out.. I'm not sure exactly how to tell it to ignore note off messages or something? This is a really, really irritating program to learn! Every time you think you've got something working something else breaks!
Any idea why this doesn't work in Max6 but when i open it in Max5 it does?
Thank you!!!
hi, I cound't find a object name maxsustain...im using max 8, is that any possible they change the name now?
its a message not an object. if you press "m", you get the grey box where you can type maxsustain.
Hey Man thanks a lot, very nice tutorials, I did everything the same except for the adsr that i substituted with a function object connected to a curve ecc. the function object is receiving a bang straight from the kslider and all that allows me to play with the envelope of the noise to get richer sounds!!! so far so good but i noticed that after the third f note on the kslider it does not change the pitch of the sound and even if i play higher notes it keeps the same pitch of the f note... Do you know what i can do for that? I hope I explained it clearly. Thanks in advance!
This is great, but what do you do if you want to terminate the recursive loop after a certain amount of time (such as when the tone becomes inaudible)? I've tried sending a zero message to the dampening multiplier, but it doesn't stop the loop.
hey so I have everything in the first section set up exactly (the first 3 minutes) but it is not making a clicking sound when I press on the '1'. Any other settings that need to be configured in a certain way? I am using version 6.1
ryan miller You need to click on both message boxes first and turn up your gain slider
what did he say at 0:13? whose tutorials?
i'm looking for something for beginners
could someone help me out?
Baz Tutorial. It's a whole series of Max/Msp tutorials.
thank you!
HI, i'm quite beginner to Max MSP as I even don't know how this boxes work. do you have any video for my level?
Just created this patch while watching the video. Awesome video, and my patch works exactly the same way. I used a notein object with a QuNexus instead of a kslider, and it works just the same except for one thing. When I lift up the key, it strikes the note again. How do I fix this?
What beginners tutorial are you reffering to in the beginning? Buzz tutorial? I can't find it. Link if you know please!
Thanks for the great tutorial Sam. Could you kindly tell me why you have to divide '1000'? I'd like to understand where that number comes from in terms of theory.
dude837 Very nice tutorial man :)
I cant get inputs and outputs in the maxsustain 10 cell, i hit N and wrote it exactly how you did it, but im not being able to patch it, please help!
Hey man,
Yeah, that's a tiny annoyance of the Max interface to blame there, I think. That's actually a message box with the contents "maxsustain 10", not an object box called "maxsustain" with the argument 10. So you want to hit "m" to make the new message box, not "n" to make an object box. Does that work? You can also try downloading the patcher itself, if that helps. There's a download link in the description.
-S
dude837 thanks for this, I had the same issue :)
why the frequency goes down when u push the higher pitch?
Great Tutorial but i have issues on making the sound to stop,
Hello, thank you for making this video. I don't know about Max/MSP; but I'm learning about Karplus-Strong.
Are signals being summed at certain points here? e.g. Are the two inputs into the gain being summed and the sum is what goes into the gain? What else is being summed?
Could you explain how to do this? I'm not entirely new to Max, but I need a refresher on a lot of this.
I very nice tutorial :-) Thank you for that :-)
figured it out, didn't send my max sustain message
This looks great, all these tutorials! I really want to watch these. The only thing I am wondering is whether it is all still valid due to the older Max version used? Or are the changes done by Max always backward compatible?
I just followed this in max 7 which i believe is currently the latest and it worked great, so go for it :)
Hi! How could it be achieved a good tuning throughout all the note range?
Hi @dude837, you mention good beginners tutorials by 'Bad'? Can't find it, could you spell/link it? Thanks in advance!
"Baz" ya those are good!
For some reason, I can't make the sound go higher. :(
Yeah, you can only go so high because you can't delay for time shorter than one signal vector. If you build your own Karplus Strong using gen~, however--that's another story. Actually, I think Max has such an example built in, if you've bought gen.
I mean that I can't make any sound, that's what I mean, when I'm trying to make that single click sound.
Koshka Cat
nvm, I just made the sound exist
My !/ 1000. object appears to be forcing rounding to whole numbers. Any ideas?
Sky Shaver I figured it out, float num (f) instead of num (i)
@@skyshaver6622 Dude, you saved my life! Thanks a lot!
Hey there just checking out your videos and looks like a great channel. Im using max 5 and it doesn't recognise the maxsustain 10 object. What do you recommend?
solved it! i created a object instead of message. decided to go straight to your channel before doing the beginner stuff haha
is it needs some soundfiles? I cannot hear sound.
양희승 no its not. maybe the reason your sound didnt come out :
1. u didnt press the message box
2. your gain
tanh~ as well
+dude837 @dude837 noob question but how would I modify this to use in a max for live patch? Not at my computer rn but I know you use a different output instead of dac~ but I want to know how to play notes through this with midi clips, tried a few different things from but like I said I'm just starting to learn max but I've mainly used premade max patches in ableton until now. Where (and what objects) would I route in the midi in from ableton? Even when I used the max for live default output object instead of the dac~ and copied this exact patch from the video, I got no sound out of the ableton track, even though when I hooked up a meter object to it in max it said there was sound coming through.
Tldr; how do I change this to make it work as a max for live device?
+dude837 I got some sound using midiin routed to midiparse in place of kslider into mtof, and everything else the same except for plugout instead of dac~, but the sound was just white noise..
Yeah the thing that you need is some other way to window the noise. Rather than using maxsustain, you'd use the velocity of the incoming MIDI notes to control the adsr~. You'll also need to use either an object like ddg.mono to make the device monophonic, or a poly~ object to make it polyphonic. As you say, it's not trivial, but I promise getting it to work would be an *amazing* learning experience.
if you use sigmund~ or fiddle~ object you can replace the keyboard by one of those object which can receive adc~ signal from your voice or any other sounds coming from acoustics input
hey I don't know if you still need help but I use max for live also and here is a way to make this work, copy paste this code into your max patch
----------begin_max5_patcher----------
1128.3ocyXstiahCE92oR8cfkethxZyc5qR0pQNAOLtavfvlzTUsyy9dvbIj
THwIKimAoY.N14v47ct6e84Oswda4Qpv15qVeyZyleAT1nn0RYy.gM1Eji61
SDpMZyo+nb62sc5WSROJUzqsj0r7bZ83RUD4tWX77mpo6jceDbTrqObED3X4
iSbifqvHGqfTWjikGxEY82C+bg7m6oJVOxwxF4dpT9yJZG6rsOscdSAiCqpj
Rz.UVlhCfD+Eee6I6siUpMiUT+2O+o16vMm+2XgPGrvOJPo+Iwf9i6vEruiU
HVKr3L8EOm95sf9hVc88urvdwtWUYCQsZkeBZTm8idLa9y6KIxkL7dy.Ddoq
tgGjAfUWUgwJ0K.rliFVjVJbEolTPkz5mnbx1tUQKGA3XYukvym.HOWVWPTh
Qj1NKdQKfQdqtyxe9pExMM8poIBCbQvENDPsPO0yQX.M8dLWFAKmS1eW9LAF
KYwe.QOf94pi2zjzDAAlJ7wb4MKjkOqALbVVDu0sxwrAGdFCAZ3Ujc+iNXP.
FBhRSiRgPD+GCCXbYa5i1a2CZfMVphBVFCRGJn5.HH+wXiTO2vGxov4zeS.m
yobWXEZArJ4MAqXbM.Ju3S.U.5w8btCX.mZr.nRNspbO8UnZKBocMFrBGRPl
p7BNxX.hjTw3upKRDz1jBb4iebmC3KtqjyU7+N7QBMIj.7+Unrq1vRxo13hv
uEdIyBIlqtS09l7VL4p.B1WU1MBFdKJR4b7nUd5wBmGJ1As50e1yNPcyISiS
NPp4Pa3Ks7MfmvzSMsh6FzocD2SZ4bM4i0Gt5qH00KmSqDJlFrUUSETtjHYk
7IRnxj0Y2P+tHMOvWVyF3zRtoKkbObzifbfl8DQBCEusQRO8jn2nLXUZg88M
TnIvd5iKLEwfYuxuhs4r8JdorVp6lGPbzbKV.nS6heItE6lcCDkSVz7Ky3LI
q0Su2RLB7msqFXWiAPA8an2k9zCq63X55T6mp50N1SQI1yLkJSV8bfETgfjS
moEJxQQiPB9G2nzfGNY1iwJdkOFq4vCyMXJISTCEIsPVXWKr1GqWXx3vYwAq
T4gg9xW.mBmq06EvofUGm3kLAU+nHHq6.V81bdFy1JgldMcrDRTx+syEVoWs
KbAFIJap2MHYCGzp0DMJiJjL9XIjuMZeltoWXYYT9Ym0UFSzVZL6FmYo1xU6
4.da4x27BVvGT7RGwBROCoHLpXgO+St.bkZd7JRG.C+NXH0KfLx7BlVd9sSF
dCAqfkUUx3RwP8He2vgY6S5Nti.n9rmexXuKKQOX3Yf9T9bh9D4ckwCrVdPW
hZlvPoUtfK8yLUxfaKXuCwbHsDLrwELrVUAuT7MffkrR4BdeBJMe4FrVwjXy
mU+RazGl5fZ442N4mg6nQe45CXD46fiut8k93hU+XPjppCzZQOm6jHXlvuWV
29drS26Ld26cSqaWSOvF9IceLaRMLQnDFGrotaztiQ8iwaWTlQq4MrggwTx.
7u+y6feLK
-----------end_max5_patcher-----------
Matthew Mitchell just saw this, thank you! I've downloaded other karpluss m4l instruments but they don't sound nearly as good as this tutorial's tone to me, thanks for the reply also Sam!