ШЛАМ


Behold: My magnum opus!

When autistic nerd and drum breaks love each other very much, the so-called...

SHLAM-MASHYNA

...is born.

SHLAM-MASHYNA (ШЛАМ-МАШИНА) - is an instrument for slicing audio samples (such as drum breaks), shuffling them, and applying different audio effects to them.

This page will serve as a documentation for this Pure Data patch I made (almost) from scratch. I will share all of the nuances which i discovered while programming and using this patch.

This article will be updated gradually.

Here you can also download the SHLAM-MASHYNA itself, some previous versions of it that I backed up, and explore the possibilities it can open in music-making.

A few examples of sliced audio this patch can make (made those on the first take without any external editing):

1. Amen Break

2. Think Break

3. Random sample

Click here to scroll down to the Downloads if you are so impatient.
But I still recommend reading the whole page.

Table of contents

Introduction

1. The Industrial Revolution and its consequences have been a disaster for the human race On April 5th, 2023, being on my final college year as a programmer, I randomly stumbled upon programming language called "Pure Data". It is a visual programming language designed for manipulating audio data. At that time I also enjoyed musical genres such as mashcore and breakcore. Putting two and two together, I realised that I could possibly automate the process of slicing drum breaks using this language. So I did.

Armed with lessons from these(1) two(2) distinguished gentlemen, I got to work. First and second version of this project were manipulating MIDI signals, and I used external VST plugins to read them. This was good, but not enough for me. I decided to fully focus on manipulating .wav files, and so the third version was put to development.

This is the version that over the span of one year became the SHLAM-MASHYNA itself.

The last changes I made to this patch were on February 2nd, 2024. At that time I've already found a job and didn't spend as much time making music as I spent in 2023. Since then, I've always wanted to share this project, as my free time began to reduce to zero, and also I started to gradually forget the inner workings of the patch.

Since then I also couldn't find any similar patches to this on the Internet.

Description

SHLAM-MASHYNA (ШЛАМ-МАШИНА) is a Pure Data patch. You can open (and modify) it using Pure Data.

SHLAM-MASHYNA manipulates .wav files - cutting them into pieces, shuffling them, and applying different audio effects. All within one .pd file.

Using it, you can slice drum breaks and other audio, making glitchy and even mashcore-like effects.

To my knowledge, there aren't any similar projects to this one.

License

This project is licensed under WTFPL. I do not care about any forks or modifications of this project, but if you credit me as an original author, you will earn my utmost respect.

You can freely use and modify this project, host a mirror of it on GitHub, make forks, sell it (good luck with that), print its source code on paper and then burn it - I do not care.

Downloads

The final version of SHLAM-MASHYNA, direct download from my website.

I also regularly made backups of the project, 14 in total. You can download them below. In the earliest versions I didn't even make subpatches, so it looks very cluttered but also kinda cool with all those wires.

Initial backup, one (dead), two (dead), three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen.

I just noticed the first two folders didn't have any files inside, but oh well.

Documentation

Note: all of the images you can open in new tab to see them in full size.

Using in music projects

Let's first jump to the very conclusions and see how we can use audio files produced by the SHLAM-MASHYNA. For this purpose I will use Ableton 9 as my DAW of choice.

You can just take any sample, warp it to match desired BPM, and throw the sliced drum break over the top. Maybe add some external audio effects.

Voila, you've just made some goofy ass """le breakcore""".

(WARNING VERY VERY LOUD) Listen

Or, you can use certain parts of this sliced drum break to create a meaningful, melodic composition. The only limit is your imagination.

You can also slice a sample that is not a drum break, and if you get something cool from slicing it, you can use it however you want.

Getting started

You've downloaded SHLAM-MASHYNA and opened it with Pure Data. Cool, now what?

First, let's open a sample. Click here to bring the Open menu. Choose your file.

Note: the only format supported by Pure Data natively is .wav!

For making something adequate, you'll need to choose a sample that is EXACTLY 1/2/4/8/16/32/64/... bars long, and it needs to be evenly warped. For better effect, all the drum hits need to start strictly at bar/beat start. This patch operates strictly by sample's duration in bits. If you choose an unevenly warped sample, you may hear clicks and other unpleasant stuff.

Also, check your audio's sample rate. You can set it here.

You can prepare your sample beforehand in Ableton, Tracktion Waveform, Audacity or any other audio software.

Let's hear the sample as it is. Click here or press "Z" to play/stop the playback.

If it plays - all's good.

You can also turn off the sound completely by pressing "SPACEBAR" in case of emergency, when the audio is too loud or unpleasant. Trust me, I added this function for a reason.

You can turn it back only manually by pressing the nearby GUI button or in Pure Data options.

Every time you start playing the sample, it automatically starts writing the output in real time to the rec.wav file. When you stop, the writing stops too and the file is closed. This file is located or created automatically in the same folder where the patch resides. You can store the patch wherever you want to, but keep this fact in mind. I usually store my .pd files in the bin folder because I like to.

Of course, if you start playback once more, the current rec.wav will be overwritten, so be careful and move recordings that you like to another place.

This method of recording is very convenient, as it doesn't depend on your machine's current audio volume, and it creates files that are exactly of duration that matches the current BPM.

Speaking of BPM. Right now your sample is one long piece. Let's divide it into smaller bits.

Click here to split your sample into what I call "slices".

A good measure is making one slice match one drum hit or one small shuffle. In this case, the classic Amen Break is 4 bars long, each bar having 8 drum hits/shuffles, so the total number of slices would be 32. As you can see on the screnshot, it matches.

Where the magic happens

Note: the counting in every place in this patch starts from 0, not 1.

When you are done setting up your sample, you can finally do the interesting stuff. First, let's check out how we can play slices in the random order.

This whole section is about reordering slices:

pd jumpamount - this module sets the "jumping" amount. The default value is 1, meaning all your slices will be played in order, one after another. If the value is 2, for example, only every second hit will be played, essentially skipping over one. 3 will play only every 3rd hit and so on.

You can set the value using you mouse or keyboard, in the text field. Also there are two buttons:
the first one will trigger a random jump once in a while, setting the current slice to random, and then resuming the playback from this slice;
the second will randomly set the value to 0, effectively playing the same slice over and over, creating "stuck" glitchy sound.

pd addrandom - this module, when triggered, sets only the current slice to random, then resumes the playback from the point it was before.

pd slice_by_key - you can actually play the first 8 slices in your sample using you keyboard buttons 1-8. Note: the slice can be overwritten by the modules.

pd forceslices - force the first of every 8 hits to be the slice you set in the text field. For example, you can set it to be a kick, so it sounds somewhat more structured in a large mess of random drums hits.

By the way, you can see your sample visualized as a whole, and the visualized current sample, in these two windows.

Now, let's check out the "glitches" section:

It is used for making stutters and glitchy effects. Those effects divide the slice into even smaller pieces, and replay the first piece several times for the duration of the whole slice.

Toggle the glitches on/off using the GUI or by pressing "0" (zero) on your keyboard.

You may not hear any changes until you select the desirable "glitch density", i.e. the duration of the first part of the slice that will be played over and over.

You can select it here using GUI buttons or by pressing "=" (equals) to set it randomly.

The farther to the left the button is, the smaller the first part will be, meaning tighter glitches.

You can also set the maximum and minimum threshold when setting random glitch density.

There also is that one part, which I probably forgot to connect when I still developed the patch, but now decided to leave as is just out of principle.

If you connect it as the green line shows and enable it, the density will change randomly every full slice duration. I will call it automatic random glitch density, keep this in mind for later.

Now, these buttons decide if the current glitch particle will be the same, e.g. repeat the first part of the same slice, or consist of the first part of different slices. Think of it as if the glitch will play the first part of the same slice several times, or take the first part of several different slices and play them in a row, one at a time.

To take things further, this button makes so that after the small glitch part is played, the slice as a whole changes, and if you have automatic random glitch density enabled, the density will also change, which will create glitches of uneven duration. This almost never sound nice in practice, but you do have the ability to do that.

The last but also very important function is dual channel mode - this essentially makes your glitch particles play even after the next particle has already started playing. This makes glitches more smooth. By default it is disabled, and particles are cut off immediately, creating more sharp sound.

This next part is literally useless. I tried to make built-in fades in/out, and I DID make them, but they were somewhat unstable, so I disassembled them. You can tinker with this part if you want to try and complete the fades functionality.

Audio effects

This section contains different audio effects you can apply directly from the patch.

pd speed - pretty straightforward, this changes the speed of your sample, also affecting the pitch. You can use pre-defined values, or enter your own using mouse dragging while pressing the Shift key.

pd speedtricks - once in a while makes the current speed randomly two times faster or slower for a brief moment. Pretty fun to use.

pd scale, pd octave, pd tinytranspose - to use them, you'll need to enable "pd transposition" - these bad boys change the pitch of your sample.

pd scale changes the pitch up by the number of semitones following the major scale - 2 2 1 2 2 2 1. Using this, you can make random melodies with musical instruments samples.

pd octave just changes the pitch up or down an octave once in a while.

pd tinytranspose changes the pitch up or down randomly by up to 2 semitones. I use this mainly with drum samples to make the patterns slightly more interesting.

Also, you can just use the value parameter of any of these to set the static pitch yourself. And you need to do this here and not in the "pd transposition" part, because there it will just reset every slice. Sort of a bug, I know.

And of course, you can combine these pitch manipulators.

pd bitcrush - also pretty straightforward, applies a random amount of bitcrushing every slice. To set a static value, you'll need to tinker inside the subpatch.

pd volume - changes the loudness of audio output. If you set it too high, it will also create an overdrive effect. Just try not to bleed your ears out.

pd volumetricks - changes volume down a random amount each slice. Sometimes sounds cool.

pd sliceminus - silences the last part of the current slice, making it end abruptly. The value of 2 will mute the second half of the slice, 4 will mute the last 25% of it and so on. Sounds very cool almost all of the time.

pd silence - completely mutes the slice with a random chance. Works good with fast-paced samples.

One more thing I'd like to add at the end, is about granular synthesis. You can technically do it with this patch too, although not very well. For this exact reason I tried to implement fades, about which I wrote previously. To go granular, you just set the number of slices to a few hundreds/thousands, depending on the source sample's duration, and experiment with the order of slices and audio effects.

For now, that is all. I may add some info gradually in the future. Experiment and have fun!

Modifying the patch

If you are proficient with Pure Data, you can obviously modify the patch however you want.

If you're not - here are some basic principles.

You can enable the Edit mode by pressing Ctrl+E.

Almost all of the modules are separated by their own subpatches. To open a subpatch, press the right mouse button on it and select Open.

There you will see the inner workings of the subpatch.

From there, you can experiment using your logic, or watch a few videos on Pure Data, especially from those gentlemen I mentioned in the Introduction.

шлам