Single volumes controls for single beat on drum-machine
Hello, i'm trying to make a simple drum-machine on max msp (i'm leaning this software...) but i have a little problem that i don't understand how to resolve it.
I post a screenshot of my patch so you can understand what i do.
I made the drum machine only with quarter division (4/4, beat) for semplifyng the patch.
The trigger on rappresent the sound that will play (for example the kick ==> watching trigger: X trigger-off X trigger-off produce kick nosound kick nosound).
Well, but i want control the volume of a single beat (like ultrabeat on logic for example) but i'm not able to connect the sfplay~ with the multislider object (i use this object but i'm not sure that is the better for do this volumes controls).
Can you help me please? Thanks a lot
ps. sorry for my bad english...
This is the pictures of my patch:
I am not sure I am understanding you correctly but sfplay~ should go into the gain~ not the multislider. multislider is in the max domain, sfplay~ and gain~ are in the audio domain...
Yes, in fact i don't understand how i can control the volume of the beats (volume of single beat - volume beat 1, volume beat 2, volume beat 3, volume beat 4) with a multislider (or exist another better object to do this?)
Something like this will work if you repace the [number~] boxes with your audio in and out objects. It's just a question of unpacking the list from [multislider] and sending each number to some sort of signal multiplier. In this case I've used [*~] instead of [gain~].
lh
thereishopeforus@hotmail.com wrote on Wed, 22 April 2009 14:45Something like this will work if you repace the [number~] boxes with your audio in and out objects. It's just a question of unpacking the list from [multislider] and sending each number to some sort of signal multiplier. In this case I've used [*~] instead of [gain~].
lh
Thanks.
Sorry, but a little bit for my not perfect english and a little bit for mi not big experience with MaxMSP i don't understand very well what you write.
I wrong to use an object? Which? The gain or the unpack is incorrect?
ps. i check now the link of picture in my first stop and the link don't work, i re-post the image oh my Maxpatch here
you can use [gain~] or [*~], it doesn't matter. One is a UI object the other isn't. In the end they do the same job in a slightly different way. [gain~] has a build-in slew time, so your values are always going to ramp to the new value over 20 msec (by default), which might be useful to you.
Also, if you set your [multislider] correctly you don't need the [scale] objects.
Here is a patch that does what you want.
You can make it fancier but this should get you started.
Ok thanks.
But i don't undestand how i can connect the [sfplay~] with the multislider.
How the single sliders (on multislider) can command the volume of the singles beats?
I think that for control the singles volumes i have to made this connection... is the correct connection or is it wrong?
Nick Inhofe wrote on Wed, 22 April 2009 21:15Here is a patch that does what you want.
You can make it fancier but this should get you started.
Sorry but, "here"... where?
copy from (and including)
----------begin_max5_patcher----------
to the end of
-----------end_max5_patcher-----------
go to max, file -> new from clipboard
Oh thanks so match, i don't know this function (new => copy from clipboard) on MaxMSP! thanks!
I see your patch, there's many object that i don't know, tomorrow i study it!
With [*~] object i resolve the problem of single volumes... but i think your patch is better than mine!
A problem for my drum machine is resolve =)
the problem is the for 4 band eq!
Hello, i have a problem.
I made singles volumes for each beat but when i play my drum-machine the sounds (kick, snare...) clips or play distorted.
I think that this problem is caused by rapid changs of multislider values, this values goes to [*~] that is not able to change very quicly his parametres...
I try to insert the [line~] after multislider and before [*~] but i have the same problem, the sounds clip!
I post you an image about a sounds (kick) thas clip when drum machine in playing.
I find this video on youtube: http://www.youtube.com/watch?v=Odw2D7a3lA4
here there is a step-sequencer made with max msp.
It has the single volumes controls and if you listen it when the man changes the volumes you can hear that the sound not clip but is a "clean sound"...
how he can made this? what is the solution's problems of sound clip (that i have in my patch, look images in my previously post)
i hope to explain myself for you with this not perfect english
have again a look at the line~ help file, if you want line~ to prevent clicks, you need to send it a list, not a single value...
Btw. better than showing pictures, is pasting the patch itself:
Select all, copy compressed, and the paste it into your post...
I try to made a change but i'm not sure that is correct... i use a message for [line~]
This is the sub-patch of single volumes
if I am reading you right, I think you want something more like this...
your message to line~ was wrong. [0 $1] means that line will go to 0 (and only 0) over the incoming amount in msec. what I think you need is [$1 20], which means go to the incoming "volume" over 20 msec.
With you changes the volumes drow in 20mseconds?
it's too much time for a drum machine... i'm searching on the web a solution for this problem of sounds clipping but i don't found a realistic solution...
I just chose a random number. you need to experiment and see what works for you... just put a 5 in the message box instead of the 20 in see if that works for you. you won't break anything, just go for it!!
shama wrote on Thu, 30 April 2009 15:54With you changes the volumes drow in 20mseconds?
it's too much time for a drum machine... i'm searching on the web a solution for this problem of sounds clipping but i don't found a realistic solution...
also with values over 127 in the gain~, or over 1.0 in the *~, can produce distortion/clipping. 127 in the gain~ faders is "unity" or 0 dB. Going over that will get you more for weaker sounds, but on stronger ones you'll start to clip things. Maybe attach some dB meters to check your levels.
The multislider is perfectly OK for levels, it just sends out numbers, which you then put to use in gain~ or the *~. It's great for changing a number of things all at once. Try hooking a preset up to it too
yes. Put a number~ box or a meter~ on the connection to the DAC~ to see if you are going above 1.0. If you are, you can scale it down before the dac~ with gain~ or another *~.
Also, check your order of operations. Its possible that the sound starts playing and then the volume change comes in, which could create a click.
It is also probably best to use different sets of multislider ->*~ for sounds that occur at different time intervals. For instance, if you have something that is a half note long occurring twice every measure, and its running through the *~ which is changing every eighth note, then the sound if going to have a lot of abrupt volume changes over its duration.
Also, generally speaking, a line~ of 2ms or greater is going to reduce the click quite a lot. 10ms or greater is... well, a long attack for a percussive sound. It of course depends on what you're going for.
seejayjames wrote on Fri, 01 May 2009 01:07
also with values over 127 in the gain~, or over 1.0 in the *~, can produce distortion/clipping. 127 in the gain~ faders is "unity" or 0 dB. Going over that will get you more for weaker sounds, but on stronger ones you'll start to clip things. Maybe attach some dB meters to check your levels.
The multislider is perfectly OK for levels, it just sends out numbers, which you then put to use in gain~ or the *~. It's great for changing a number of things all at once. Try hooking a preset up to it too
I set the multislider from inspector with a specific range 0. 0.9, with this range the sound should not clip...
I put a [meter~] and connect a [float] to see the value in my patch (after multislider, the patch is in previously post) after the [*~] and the values not go over 0.6-0.7....
The problem is on multislider, because the changes volumes is very quickly, and when MaxMSP reproduce a sound (kick or snare...) and I in multislider set the volumes on 0.8, immediately after on the next step (beats...) the sounds not play (the volumes is set by multisleder on 0.0).
This quickly jump of values, from 0.8 to 0.0 create a clipping... and this is not good to listen!
But if i use a slow ramp time in [line~] objects, for example 20msec, the kick sound is not realistic... i ask to me how the drum-machine that i see on the web created with Max (look a video on youtube in previously post) can manage singles volumes without clip, they have a perfect sound!
Here is my again, except with sfplay~. I've loaded several samples into sfplay~ and did quick 1/0 velocity changes without any distortion.
My last bit of advice would be to simplify your patch as much as possible to identify the problem. This patch works, so figure out whats different about your order of operations etc. If you are experiencing distortion with this patch, let me know.
I post my patch complete, not only the sub patch.
Please copy this and try with a kick sample for examples, try to go 1/0 values of volumes and listen that the samples clip...
I made the changes like your patch but the sound is not the same... i don't understand where is my problem... in the gate object?
Edit: i try your patch with a different BPM... with 130-140bpm also your sounds clip... with 60 your and my patch don't clip... with hight bpm clip...
I think the problem is on play's sound time.
The patch play sound only for beats time duration.
Example with 120bpm: 60.000msec / 120bpm = 500msec for quarter-note
500msec / 4 = 125msec for 1/16note
So, the kick sound is played only for first 125msec (even if it is longer than 125msec) and after 125msec the sound is "cut", not played. This creates clipping, i think.
In order not to clipping the sound should play for his fully lenght (in msec) although the metronome is on the 2/16 of the bar.
And if on the 2/16 is select another kick play in addition to 1/16 (kick on 1/16 and 2/16) then here (on 2/16) the kick is played from beginning.
I hope that I explain myself...
Hello, none can help me to resolve thi clip sound problem?
Hey Shama,
You are correct about why you get the clipping sound. Sfplay can only play one sound at a time. If you ask it to play the sample again, before it's done playing the last sample then it has to cut off the last sample to start the new one. You could embed your sfplay~ object in a poly~ object to fix that. This way when a new attack is sent from your sequencer if the previous kickdrum sound is still playing, the poly~ object will automagically instantiate another voice and play the 2 samples at the same time. Poly~ can be tricky to use, especially if you're new to Max/MSP. Aside from the help and reference files, and the MSP tutorial #21 check out Darwin Grosse's awesome series of synth building tutorials:
The stuff about making it polyphonic applies to synths or samplers (drum machines). His tutorial is what finally made poly~ make sense to me anyway.
Best of luck!
Lewis
Lewis wrote on Tue, 05 May 2009 18:40Hey Shama,
You are correct about why you get the clipping sound. Sfplay can only play one sound at a time. If you ask it to play the sample again, before it's done playing the last sample then it has to cut off the last sample to start the new one. You could embed your sfplay~ object in a poly~ object to fix that. This way when a new attack is sent from your sequencer if the previous kickdrum sound is still playing, the poly~ object will automagically instantiate another voice and play the 2 samples at the same time. Poly~ can be tricky to use, especially if you're new to Max/MSP. Aside from the help and reference files, and the MSP tutorial #21 check out Darwin Grosse's awesome series of synth building tutorials:
The stuff about making it polyphonic applies to synths or samplers (drum machines). His tutorial is what finally made poly~ make sense to me anyway.
Best of luck!
Lewis
Thanks, i read the tutorial but i don't understand very well how i can use [poly~] for my drummachine...
I create an externat maxpat file, i put here a [in~], a [sfplay~] and a [out~] but i'm not sure that is correct! I don't understand how to comunicate drummachine with [poly~] with this external file...
I try to use sfplay~ in a poly~ but i can play only one file at time, not two.
I post my patch. What is wrong? Help me please..
general.maxpatch (patch with poly~)
test.maxpatch (patch with sfplay~)
There are lots of things missing in your poly~ subpatcher as well as in the parent patch. thispoly~ inside the subpatcher and a note or midinote message in the parent patch for instance. Rather than fix it I just threw together the simplest polyphonic sfplay patch I could make. I've not commented the whole thing but hopefully by reading the help files and reference files for all of the objects I've used and by studying my patches as well as the tutorials I mentioned before it will make some sense. Keep in mind that the messages "sfplay" and "rel" are things I've defined in the poly~ subpatch while the messages "note" and "target" are natively understood by the poly~ object.
First save this as sfplaypoly.maxpat
And save this as whateveryouwant.maxpat
Many thanks for the reply. I try to study your patch, i read the tutorial and the object help file but i don't understand all that i read, in addition my not good english don't help me
I ask to you, or other user, if you can show me how i can implemate poly~ and sfplay~ object in my patch for resolve my problem with sound's clip... i try but i'm not able...
My patch is this:
Thanks a lot if you want help me
Try this. I made it so that the only thing you need to set is the volume for each step. No more setting toggles or matrixctrls to define note ons. You will need my little sfplaypoly.maxpat abstraction from my last post somewhere in your search path.
Hopefully this will get you started. Really study this patch as just having me write your patch won't really teach you how to use Max. However I hope it gets you started on the path to using poly~ and understanding how to route some data in Max. Have fun!
Lewis