Home

1. The samples() command is a tool to allow you to use your own sounds in your compositions. There as several ways to use sounds, but we are going to use a technique using the website freesound.org. There you can find all sorts of different sounds that people around the world have recorded.

Freesound -> Strudel

When you found a sound that you like, you copy the address of the page, ( the address bar at the top of you web browser ). This link cannot be used in Strudel directly, we have to transform it. Below is a tool that can do just that. Paste it in the text field, it will do some magic and post the useful link below.

< Copy this link >

Below we have an example using a very famous drum sound called the Amen Break, which was a foundation for several musical genres, most notably Jungle and Drum and Bass. We use the command .slice to cut the sound to even pieces, and then play them using a pattern.

A good exercise would be to go to freesound.org and search for a drum sample to use. Try it out, and switch between .slice() and another similar command, .splice() and listen to the difference.

There is a quirk though, and you might have already noticed it. If we have 4 slices, we use the numbers 0 to 3. Why not 1 to 4?

Zero Index

Imagine a youtube video that you want to play from the beginning, you would play it from 00:00, which is position 0. The first slice is the part between 0 and 1, the second between 1 and 2, and so on. The fourth slice would be between 3 and 4. If we try to play something from the position of 4, we are trying to continue playing after the clip has ended. There is nothing there.

We reference the slices by their distance to the beginning. Since the first slice starts at the beginning, there is no distance, hence the position is 0. This is called zero indexing and is a common concept across many programming languages. It is useful to know about in programming in general. You can think of the word index as a fancy word for position.

Graphic explaining zero index

2. In previous examples, if we wanted to repeat a sound or note, we had to spell it out, each sound or note at a time. We did have the * symbol, which creates a subpattern of one sound or note, but that is not equal to repetition.

There is an symbol that will make a sound repeat as if we wrote it several times in a row. It is the ! symbol. If you have a melody which repeats the same note, as "A A A A", you can use the ! to make the code shorter and more compact like this: "A!4". The two does the same thing.

When we have wanted to let a sound ring, or add space after it, we have been using the ~ symbol, the musical rest. This is great if you actually want silence, but there is a symbol that makes a sound have a longer duration that we can use instead in certain cases. It is the @ symbol, and you tell it how many beats you want a particular sound to sound. For example, "A ~" has the same duration as "A@2", but where the musical rest adds silence, the @ makes the note extend and sound longer.

3. This last example shows how a song could be created using only samples. This way we can choose any sound we like and make a song out of it. There are even entire genres of music where the songs are created from sampling other pieces of music. This can sometimes lead to legal issues of copyright©. That is why we use freesound.org, because the sounds there are free to use.

There are several new commands in the example below that could be fun to know. The .room() command adds a bit of reverb to the pattern, as if it were played in a large room. The higher the value the larger the room.

The .distort() adds a bit of distortion to a pattern. It can sound a bit warmer, or it can sound completely broken, depending on how high you set its value.

Lastly there is the .slider() command, which produces an actual slider inside your code, which you can move. This is useful in a performance, when you might not want everything to sound all the time, or if you want to change something in the code on the fly. We have only used it within the .gain() below, but it can be used with a lot of things, like the .room() or the .distort() commands. It needs 3 values, a starting value, a minimum value and a maximum value.