Cabbage Logo
Back to Cabbage Site

Sample based drum machine

Hello,

Thanks to the great help of @rorywalsh and @iainmccurdy, I wish to share the following set of Cabbage 2 instruments (I did not test them with cabbage 1). Most of the code is based on Iain’s and Rory’s examples.
The set included a mini-sequencer and a sample player

  • ** Sequencer**
    It’s a 32 steps for 12 instruments, each step velocity can be adjusted thanks to its slider.
    By default, each instrument complies with GM midi drum note (i.e. Note 36 = Kick)…
    Therefore it can be used with other sample players.
    As turned into a vst , it can be triggered by the host.

  • ** Sample player**
    The player is made of 12 instruments receiving midi messages from the sequencer.
    Each instrument sound can be modulated thanks to a pitch change, filter (low or high ), pan and reverb. A very raw envelope is also included in order to avoid click and interrupted reverb. (If reverb is stopped in the middle, increase the release time).
    In order to load sample, prepare a directory with 12 samples (I number them to make sure that the 1st sample is loaded into the first instrument, i.e. 01-Kick.wav, 02-SdStick.wav, …) and click on the button “open samples”. It might take a few second until the filers are updated.

[EDIT ] It accepts both mono and stereo samples.

To play with the set in cabbage : open the cabbage patcher and connect the midi output of the sequencer to the midi input of the sample player.

Feed back is welcome, bug reports also. As I am a noob in csound and Cabbage, please don’t expect to much from these.
Should they work on your computer, I wish you a lot of fun. Please share you sound tracks !
Should you enjoy it, please thank @rorywalsh and @iainmccurdy !
About licensing (yes…???) : same license as Cabbage. This will allow Rory to use it as an example of what not to do with cabbage :smiley:

JMDrum_Module-3_final.csd (47.4 KB)

JMDrum_Sequencer-2-Final.csd (58.8 KB)

I had a chance to play around with these earlier today. Lots of fun, and they work very well in the new patcher. A random function for generating patterns would be a nice addition. It should be easy enough. A few lines of code at most.

i noticed when i open more the decay and or or keep the key pressed its like a delay effect or a “loop on” type of thing, nice job by the way!

This looks great! I like the modular approach the the sequencer and sampler.
Thanks for sharing it.

I’m going to ping @Karamel1 as he hasn’t been here in a while. He shared some great instruments when we was around. It would be nice to have him back :wink:

Hi Guys,
Thank you a lot ! I am really glad that some of you enjoy the instruments. Unfortunately, my work being very far from music and very much demanding keeps me away from Cabbage.
As usual, the code is free to use and update and modify. Just one request, if anyone finds a bug and corrects it… Please Share your patched version with other users and thank Rory and Ian for their work. :wink:

Nice to hear from you @Karamel1! Sorry you’re not getting as much time to work on music lately. All good here, drop by any time!

im testing this sampler when i want to save a preset it crash cabbagge, so if im in a beat session at my daw i have to keep loading the sound used on that beat everytime i want to work in that session .
also how i can make any vst sampler made with cabbage resume automatic with the last sound i was working with ? i think i saw a thread about that but i cant find it, thank you

Certain widgets will have their states saved when you save a session. A Soundfiler will remember the last file loaded to it. So too will a filebutton. Just query their channels when your instrument loads.

Yeah, it’s amazing.