SynthMaker

another algorithmic example using karplus synth by sambean

Archive · 2007 48 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

tuz ·

hello,

you can check out this simple algorithmic music generator that uses the wonderful karplus synth made by sambean. i haven't gotten to the sound part of sm yet :p and decided i should use something other than a sine osc. sambean's creation really sounds great to my ears. i hope he doesn't mind me using it to show this example.

i tried to clean up everything so it's clearer and less messy. if i missed something i apologize. the random trigger is in the heart and soul. 😉

http://home.comcast.net/~t.uz/gypsycube.zip

oddson ·

That's cool 😀 ... is each note value within the range equally likely? You might want to try biased distributions.

Your schematic style is a little hard to read. Greater use of (named) modules would help with that -- and maybe a note or two.😇

... BTW - you saved only 200 bytes on that file by zipping. I swear to you it's rarely worth compressing OSMs. 🙂

tuz ·

oddson wrote: That's cool 😀 ... is each note value within the range equally likely? You might want to try biased distributions.

Your schematic style is a little hard to read. Greater use of (named) modules would help with that -- and maybe a note or two.😇

... BTW - you saved only 200 bytes on that file by zipping. I swear to you it's rarely worth compressing OSMs. 🙂

thanks very much oddson. 🙂

no biases. i just kicked out a few notes out of the range that's all (range is from 60 to 72, i kicked out 62, 63, 66 and 69 by converting them to 61, 64, 65 and 72 respectively i think). this is still very primitive. after all it's only making melodies, no songs as of yet. thinking separators for beginning middle and end with different flavors. and yes, i was thinking about biases but didn't want to deal with it. after all it's a weekday. 🙂

🙁 notes... you're right. i need more notes. and named modules. 🙂

heh. looks like another cleanup is on its way for this weekend. :p

ok ok. no zip.

totally inspired by xoxos. there's no way i'll ever be like him, but sm is so much fun that i can't keep my hands off it.

oddson ·

An easy way to do biased note distribution is to (hand) make an array with possible note values in it and pick from them based on a random integer constrained to the number of items, or more accurately between 0 and n-1 as you will need index values.

The more of any one note there is in the original array the more often it will be played.

oddson ·

Apologies for the oneupmanship... but your creation inspired me. 😀

algoKarplus.osm

I dusted of my old Karplus-Strong based synth and put together an array recorder than extracts note, velocity and duration info and then a randomizer for playback...

You can change the arrays while they play for an interesting building of complexity.

(To anyone who caught my first post on this... it should work now.)

gregh ·

That's a fantastic project from both of you. With a bit of luck when i finish my histogram and statistical distribution project you'll have another method for generating data - interactive manipulation of paramaterised distributions.

I've at least got the histogram working now - although there is still something not quite perfect about the way i take the derivative of the cumulative distribution function.

I'm learning a lot though - and pulling algoKarplus apart is going to be another big help

AngularMomentum ·

Wow, I will use this note randomizer quite a lot for sure...it's just marvellous! 😍

infuzion ·

great stuff guys! Problem is, they make me really hungry; makes me think of Chinese buffets...

exonerate ·

yeah man both your examples sound great with the karplus synth. 🙂

i like your array implementation oddson, that way you can chosse which notes it plays and increase the probabiltes of certain notes playing. and it sounds cool adding notes while it playing 🙂

cheer 😉

AngularMomentum ·

infuzion wrote: great stuff guys! Problem is, they make me really hungry; makes me thing of Chinese buffets...

LOL!

Coincendence maybe, I am eating fried noodles tonight with Char Siu Pork, I worked as a chef for about 6 years and love to cook "big dinners" as much as I like to create "big synths". 😈

AngularMomentum ·

Funny thing, I am just playing oddson's schematic, and there is this bird outside on my balcony looking inside and listening. 😀

aliasant ·

Lol Nice bird!

Oh. he I beat you AM. Worked as a checf for 15 years. 15 to many if you ask me.

=)

Shit. just realised how old this makes me =(

AngularMomentum ·

Heh, we count that as 30 years! There aren't much jobs that are more stressful and demanding then working in a kitchen imho, high temperatures, long hours...I agree that the 6 years I worked as a chef are 6 too many. Then again my wifes "love goes through the stomach" as we say here in the Netherlands, so that experience I gained makes me keep her! 🙂

My favorate is Surinami/Hindustan and Thai style cooking...

About feeling old....totally boring read but anyway...I had this conversation today with a guy that works in the grocery store here, talking about Soccer, and I told him about a game back in 86, where all those Juventus supporters lost their life for a game of soccer, totally confident he had seen it as well...he told me he was 2 years old at the time...made me feel like an old man... 🙁

sambean ·

Rockon Tuz and Oddson, great stuff, they both play better than me... hehehe..

I was a chef too in the not too distant past, didn't last as long as you guys though, only a year and a half of blood, sweat and tears.. Fondest memories though..

AngularMomentum ·

Now we can trade osm's with arrays full of recipes, eh?

sunsynth ·

Heh, and it makes me hungry 2!

This sounds like an invitation Thomas... so next time i'm in Amsterdam i knock on your door 🙂

Walter

P.S: I'm the oldest in this round i think and never be a chef :-(

oddson ·

Another idea is to have the notes selected by a random walk so that the proximity of a note to the last played is a factor in the probability of selection.

-- I was a prep cook for 3 months... I learnt how to wield a chefs knife and not much else. 🙂

AngularMomentum ·

Well, it says location Amsterdam, because I am a man from Amsterdam, but really I am much closer to the German border then you think...wink...

I am living not far from Aachen at the moment...but then again, from Hamburg it won't make much difference between Aachen and Amsterdam I guess...

sunsynth ·

Good 2 know thomas!

You're right - this is really no big difference!

btw: i cook @home but - no big dish 😉

now back 2 work...

P.S: Like the randomizer 2 and your algo!!!

I Love self-producing music-Soft!

tuz ·

it's beautiful oddson. 😍 will take some time for me to figure out though. 🙂 looks like it takes incoming notes, sorts them and plays accordingly. is that right?

btw oddson. did you ever try to d/l your uploads? try d/l'ing algokarplus and see what happens. lol.

hehe. i was only a dishwasher. :p

infuzion ·

Look what I started w/my Chinese buffet comment! 😈 I work at 2 pizza places!

If there was a way to change the notes played, inc micro-tuning, or perhaps filter incoming notes or chord-in-a-key, this would be worth putting into KVR's developer challenge.

oddson ·

tuz wrote: it's beautiful oddson. 😍 will take some time for me to figure out though. 🙂 looks like it takes incoming notes, sorts them and plays accordingly. is that right?

It actually doesn't sort them (except in the sub-module that determines the dimension of the array - that's just part of a trick to get around the lack of an 'Array Size' primtiive with the 'sort' and 'max array' primitives). What it does is randomly picks a note, a velocity and a duration from the list of entries. So the more of one you have the higher the chances of getting picked.

The random walk idea would add to that and mean that notes played in a sequence would have a higher probability of being played back in proximity.

tuz wrote: ...btw oddson. did you ever try to d/l your uploads? try d/l'ing algokarplus and see what happens. lol.

I usually do (and when I forget I usually typo and they don't work). Not sure what's LOL about it? 😕

gregh ·

here's a little variation to the randomisation function. just got the one kludge 🙂

http://stashbox.org/21572/algoKarplus_1.osm

tuz ·

oddson wrote: tuz wrote: it's beautiful oddson. 😍 will take some time for me to figure out though. 🙂 looks like it takes incoming notes, sorts them and plays accordingly. is that right?

It actually doesn't sort them (except in the sub-module that determines the dimension of the array - that's just part of a trick to get around the lack of an 'Array Size' primtiive with the 'sort' and 'max array' primitives). What it does is randomly picks a note, a velocity and a duration from the list of entries. So the more of one you have the higher the chances of getting picked.

The random walk idea would add to that and mean that notes played in a sequence would have a higher probability of being played back in proximity.

tuz wrote: ...btw oddson. did you ever try to d/l your uploads? try d/l'ing algokarplus and see what happens. lol.

I usually do (and when I forget I usually typo and they don't work). Not sure what's LOL about it? 😕

i see. 🙂

the lol is because they d/l as zip files. :p you've been telling me not to zip them and yours come zipped. must be your isp or something. realized mine does the same thing.

tuz ·

greg. i got scared with all the math stuff. i have no idea what's going on.

on another note, it still sounds amazing. 😀

this midi in to array sort is really really useful. i think i could probably use it in mine too; so that i don't have to internally define the notes, but rather input them from the keyboard.

🙂

oddson ·

tuz wrote: the lol is because they d/l as zip files

my files come back as OSMs from my end... strangely though I can't get Greg's stashbox files with any kind of regularity... can someone mail this latest one to me

tuz ·

oddson wrote: tuz wrote: the lol is because they d/l as zip files

my files come back as OSMs from my end... strangely though I can't get Greg's stashbox files with any kind of regularity... can someone mail this latest one to me

sent. 🙂

hmm. why do they show up az zips here? weird. 😕

oddson ·

thanks tuz...

Hey Greg... can you give an explanation of what all that fancy math does?

The biggest impact is that the duration of many of the notes goes to zero so you get a more interesting rhythm.

gregh ·

tuz wrote: greg. i got scared with all the math stuff. i have no idea what's going on.

on another note, it still sounds amazing. 😀

🙂

thanks tuz - i've replaced the in-house random number generator (which has a uniform or flat distribution) with a random number generator with an exponential distribution. lambda is a parameter that sets the spread or steepness of the distribution. So you can bias the size of the numbers that get selected. The kludge is the multiplier of 15000 which is to scale the output, but is just a fiddle that worked. I uncoupled the three randomizers so you can fiddle lambda independently for notes, velocity and duration

oddson ·

tuz wrote: ...this midi in to array sort is really really useful. i think i could probably use it in mine too; so that i don't have to internally define the notes, but rather input them from the keyboard.

with that in mind minmaxnoteinput.osm Since you've used a range of values this will let you select a min and max note value from a midi keyboard.

@gregh - cool... here's as far as I got with a histogram module histogram.osm

It's still buggy and won't work correctly with empty bins... but it's getting there.

gregh ·

Thanks for the histogram oddson, it's a great help - i was still struggling with it on my own. I haven't noticed any bugs and it allows me to test my stats code. I'll post up some distribution modules later on - but for now it's mark some student assignments !

tuz ·

oddson wrote: tuz wrote: ...this midi in to array sort is really really useful. i think i could probably use it in mine too; so that i don't have to internally define the notes, but rather input them from the keyboard.

with that in mind minmaxnoteinput.osm Since you've used a range of values this will let you select a min and max note value from a midi keyboard.

@gregh - cool... here's as far as I got with a histogram module histogram.osm

It's still buggy and won't work correctly with empty bins... but it's getting there.

cool! that minmaxnote is really a great idea. thinking about writing something that accompanies the minmax so that you can eliminate notes from a midi keyboard.

kind of confused though as the above idea will force me for unbiased distribution. trying to come up with a way to give it biases that way. can't think right now. too early.

oddson ·

Here's a new version with the random walk feature.

algoKarplusRW.osm

The interface is quite lame 'cause I didn't give it any thought yet.

Here's what the controls do.

Speed controls how fast the event triggers fire The switch below is on/off for the triggers Omit Rate is what proportion of triggers don't cause a note to fire Reset Array blanks out the arrays Move controls how much possible movement through the arrays each step of the random walk can take. Full on allows for 50% in each direction. Nudge determines how likely zero index movement through the arrays are Nuge +/- allows you to have nudges go both ways (or just positive to give a bit of forward direction to the walk).

It's just a start but I thought I'd share it in this rough state.

Edit - looks like it doesn't work exactly as I thought but you can still get some idea of where I'm heading.

Edit 2 - added a Forward knob. Allows you to dial in some forward bias.

tuz ·

oddson wrote: Here's a new version with the random walk feature.

algoKarplusRW.osm

The interface is quite lame 'cause I didn't give it any thought yet.

Here's what the controls do.

Speed controls how fast the event triggers fire The switch below is on/off for the triggers Omit Rate is what proportion of triggers don't cause a note to fire Reset Array blanks out the arrays Move controls how much possible movement through the arrays each step of the random walk can take. Full on allows for 50% in each direction. Nudge determines how likely zero index movement through the arrays are Nuge +/- allows you to have nudges go both ways (or just positive to give a bit of forward direction to the walk).

It's just a start but I thought I'd share it in this rough state.

Edit - looks like it doesn't work exactly as I thought but you can still get some idea of where I'm heading.

Edit 2 - added a Forward knob. Allows you to dial in some forward bias.

forget the interface. this is friggin awesome!!! 😀

i'm not sure if you're publishing your stuff at websites (eg kvr) but imo i think you really should. even the karplus plus by itself would make a lot of people happy. 🙂 i don't know, just a thought.

another thought... for my version that is. and please let me know what you think and maybe tell me if it's possible at all.

min max starts off the whole thing. then you switch to create your note array. then hit go and it starts playing. ultimately i would like to add sync to host bpm and stuff.

this is where it gets tricky.

the schematics is set in a way that when the user chooses his notes by pressing the keyboard, those notes are picked and another array is created at a sequence length chosen by the user.

the user may press 5 notes, 2 of them being the same, hence raising the probability. from there those 5 notes are distributed at the length of the sequence to an array.

let's say:

min=60 max=72

notes pressed=60 61 60 65 72

sequence length=8

possible looping output=65 60 72 60 65 60 61 61

going to work on this and see how it goes

tuz ·

happy friday!!!! 😀

here is what i was talking about in my previous post. 🙂

http://home.comcast.net/~t.uz/seqlength ... ressed.osm

is this comes zipped, it's not my fault. :p

sorry about the mess. it works though. 🙂

thanks once again oddson for inspiration.

oddson ·

Not zipping any more... but you're right about the mess.

I discovered it's actually easier to build organized OSMs than not... you may find you can't even figure your own stuff out after a month or two if there's no organization into modules.

That said... I will figure it out and comment on it later.

As for inspiration... I owe you too!

Plus... you and Greg have been great additions here and the whole stochastic element you've brought has been great. I know Dan (a.k.a. Tom7777) has done algorithmic stuff for a long time but there hasn't been much discussion on the forums on these kinds of topics for a while.

I'm really enjoying it and i might just go for a bigger project.

gregh ·

oddson wrote: Not zipping any more... but you're right about the mess.

I discovered it's actually easier to build organized OSMs than not... you may find you can't even figure your own stuff out after a month or two if there's no organization into modules.

That said... I will figure it out and comment on it later.

As for inspiration... I owe you too!

Plus... you and Greg have been great additions here and the whole stochastic element you've brought has been great. I know Dan (a.k.a. Tom7777) has done algorithmic stuff for a long time but there hasn't been much discussion on the forums on these kinds of topics for a while.

I'm really enjoying it and i might just go for a bigger project.

i'm enjoying this as well - great intro for me just starting!

the comments method you use on the code is great - much better than i was using, so now i'm using yours 🙂

i've now got triangular, exponential (with a fixed scaling constant 😊 ), and beta distributions. I'll probably do a few others. But until I check them externally - and better than last time with the exponential - I don't want to release them. Might be a day, might be a week.

tuz ·

gregh wrote: oddson wrote: Not zipping any more... but you're right about the mess.

I discovered it's actually easier to build organized OSMs than not... you may find you can't even figure your own stuff out after a month or two if there's no organization into modules.

That said... I will figure it out and comment on it later.

As for inspiration... I owe you too!

Plus... you and Greg have been great additions here and the whole stochastic element you've brought has been great. I know Dan (a.k.a. Tom7777) has done algorithmic stuff for a long time but there hasn't been much discussion on the forums on these kinds of topics for a while.

I'm really enjoying it and i might just go for a bigger project.

i'm enjoying this as well - great intro for me just starting!

the comments method you use on the code is great - much better than i was using, so now i'm using yours 🙂

i've now got triangular, exponential (with a fixed scaling constant 😊 ), and beta distributions. I'll probably do a few others. But until I check them externally - and better than last time with the exponential - I don't want to release them. Might be a day, might be a week.

you guys have been great!!! i've been enjoying every second of the back and forth ideas. i learn something with every exchange. sometimes it takes a while, but i think i get most of it in the end. hopefully it'll keep on being that way.

maybe we could do something together. kind of like we are right now but more of single goal oriented project. 🙂 maybe we could wrap the ideas in one big project together and publish it to showcase synthmaker's capabilities.

or maybe we could just keep on doing this and all of a sudden we'll realize we already have something. 🙂

we all have our different ideas and tastes. i think it's wonderful that we can share them this way. also, i hope that i won't be a strain to you guys because my skills are less evolved than you. i'm just an accountant and most of the time, your math, logic and dsp skills just make my jaw drop.

gregh ·

Hi Tuz - don't feel embarrassed about your skills! I was amazed how quickly you got the image thing going (making a gui or any image stuff is a complete mystery to me).

I'm fine on the maths (but a bit rusty) - but i can't implement for nuts. I'm an academic, but I just quit so am hoping to turn some of this into an income (eventually) - though i know it is not the easiest area to make a dollar.

I think a collaboration is a good idea - but that seems to be happening anyway 🙂

tuz ·

gregh wrote: Hi Tuz - don't feel embarrassed about your skills! I was amazed how quickly you got the image thing going (making a gui or any image stuff is a complete mystery to me).

I'm fine on the maths (but a bit rusty) - but i can't implement for nuts. I'm an academic, but I just quit so am hoping to turn some of this into an income (eventually) - though i know it is not the easiest area to make a dollar.

I think a collaboration is a good idea - but that seems to be happening anyway 🙂

thanks for the encouragement greg. 🙂 i'm really not good at gui stuff. i just play around with photoshop (my wife is a graphic artist) so i know just enough to get me by. can't use her computer much so now i installed gimpshop (try it, it's free).

math is not a complete mystery to me but advanced math is scary because it's been so long since i took all those courses.

yeah i think we definitely have something happening here.

also, greg and oddson. i made a vst (turned gypsycube into a plugin) and posted it at kvr and i don't want you to feel like i was doing it behind your back. now i feel like i shouldn't have, so let me know if it's ok with you. if not, that's perfectly fine and i will pull it down right away. 🙂

http://home.comcast.net/~t.uz/cipsibeta.zip < that's the plugin (nothing different. just added play and stop based on host)

and here's the thread i posted at kvr. http://www.kvraudio.com/forum/viewtopic.php?

hehe. i don't plan to make any money from plugins. not that i don't need it. :p i love freeware and i think it's the best thing that happened in the vst world. in fact that's why i came up with the developer challenge idea over at kvr. 🙂 it's just my personal opinion though. i think you have every right to make money of your stuff.

gregh ·

I love freeware too, and intend to do some stuff free and some stuff payware - and as far as pricing goes i hope i can sell lots for little 🙂

oh, and no probs on the posting at kvr. If I don'twant anything public I'll post either privately or on the registered section and be explicit about that

....and oddson is really the guy who knows what he is doing 😀

Tom7777 ·

Plus... you and Greg have been great additions here and the whole stochastic element you've brought has been great. I know Dan (a.k.a. Tom7777) has done algorithmic stuff for a long time but there hasn't been much discussion on the forums on these kinds of topics for a while.

Just wanted to let you guys know that this is great work by you all, im going to start some new projects at some point, it's great to see that others are interested in algorythmic stuff 😀

AngularMomentum ·

Here is a demo made with karplus plus and it's random generator...ambient stuff, get's very boring after a few minutes, was just jamming away a bit.... 😉

http://www.amvst.com/osm/karplusdemo.mp3

oddson ·

oddson wrote: Here's a new version with the random walk feature.

algoKarplusRW.osm

The interface is quite lame 'cause I didn't give it any thought yet.

Here's what the controls do.

Speed controls how fast the event triggers fire The switch below is on/off for the triggers Omit Rate is what proportion of triggers don't cause a note to fire Reset Array blanks out the arrays Move controls how much possible movement through the arrays each step of the random walk can take. Full on allows for 50% in each direction. Nudge determines how likely zero index movement through the arrays are Nudge +/- allows you to have nudges go both ways (or just positive to give a bit of forward direction to the walk).

This should now do more-or-less what I said it did before. I've fixed a bunch of problems with it and cleaned it up a bit.

EDIT - D'oh... still had the velocity array messed up. Now fixed.

oddson ·

I've split out the bug report stuff into the bug thread as this thing already has one digression.

@Thomas... can you rename that thread something that makes sense to you?

rendering bug?

AngularMomentum ·

Makes enough sense to me the way it is named now...

Have you listened to that piece of "music" made with your schematic?

oddson ·

Yes... it's better than you seem to think, no scare-quotes required on 'music'.

The Karplus isn't all that prominent but it is a nice example of how random elements can be incorporated.

AngularMomentum ·

Yeah, it isn't indeed that prominent, might have to record that again with better presence...as I can't render the track I am not bothered though for now, but I hope if you ever think about seriously releasing (this is also for Tux) that you will include this demo...I will clean it up a bit off course, make it slightly shorter etcetera...

The sample is from the Arrival by the way...a B movie I did enjoy, with Charlie Sheen in it...that's the voice talking.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.