Plug-in Baby

Hi! Welcome to my “Blog”. This semester I will be showcasing my weekly ideas, struggles, and accomplishments in my attempt to create my own plug-in for my Music & Technology II class.

Week 1 (1/13/2020)

Some Preliminary Ideas:


Week 2 (1/20/2020)

Some academic papers that interested me from the International Computer Music Association:


Week 3 (1/27/2020)

What I’m Working On:

  • Making a plug-in for Ableton with Max
  • Figuring out Max – Self learning/Youtube process, similar to Pd in the way that it’s structured
  • The Prototype – Take in samples, alter them (through rhythm, pitch, etc. not sure yet)
  • Third link from last week is closest to what I’m aiming for.

What’s Blocking Me/What I Need to Do:

  • Cont. learning Max
  • The details of what I want my plugin to do
  • I just need to start prototyping and create something by next class.
  • Is Magenta (from google) something that I want to consider?
  • Download trial for a full version of Max
Image result for puredata memes
how Pd makes me feel 🙂 lost n confused

side note:

Video that i saw: https://www.youtube.com/watch?v=pih193lRiX8

^Youtuber who does sound design for games, made a plug in (called Tiramisu) with max for live that randomly samples samples. — just interesting


Week 4 (2/3/2020)

What I Did This Week:

  • I’ve learned a lot more about Max 8, from its limitations to workflow
  • I’ve started to flesh out the details for what I specifically want to do with my plugin.
  • I’ve been looking at other peoples patches on maxforlive.com for some inspiration on what I want my plugin to do.
  • Euclidean Rhythms!!

What the heck is a Euclidean Rhythm?!?!?

the man, the myth, the legend: Euclid!!!

Euclid was a famous mathematician, often called the “founder of geometry”, so what does he have to do with my plugin idea? Well, one of Euclid’s many discoveries was that of an Algorithm for efficiently computing the greatest common divisor of two numbers, often referred to as the Euclid’s algorithm. How does this relate to rhythm though…

When creating a Euclidean rhythm we need to imagine some periodical rhythm, and in most cases this is visualized as a circle, with a clock-like hand that moves around the circle at a specific speed. For the sake of simplicity, we can visualize our first example as just a clock with a single hand. If we want to make a rhythm out of this clock we could do something like: every time the hour hand passes  over a number on our clock we play a sound. This could be a drum hit, strum of a guitar, a sample, whatever, but we just do it every single time our hour hand passes over a big number on our clock. Since our clock is from 1 to 12, we will play our sound 12 times every 12 hours. So to spice stuff up let’s set the period of our clock to something significantly faster, like 12 hits every 12 seconds. Now if you can picture this in your head, the hand of the clock is doing one full rotation around the clock every 12 seconds. If we play our sound every time we pass over a number now, we have created a pretty standard Euclidean rhythm. You might thing this is kinda boring, however, once you start adding multiple Euclidean rhythms playing with different numbers of beats but the same period, things start getting kinda crazy!

Welcome to the World of Polyrhythms!

I am going to start referencing stuff a lot more than explaining, as the things people have done with polyrhythms are pretty awesome:

What my Plans are going forward:

The centerpiece of the Max for Live plugin/patch is going to be Euclidean rhythms. I’m really happy that I have a direction and I’m excited to move forward with this idea.  I’ve watched a lot of Max 8 tutorials and Max for Live plugin examples that people have made. Also, prototyping my ideas:

  • I want it to be able to take in samples (such as kicks, drones, etc.), randomize the samples into different orders/channels to create a random polyrhythm based on the user’s set parameters (see the second bullet point above).
  • This is idea is like a combination of last week’s side note video i posted, and the second bullet point.
  • Ultimately, I want my final project to be very visual and easy to work with.

Blockers?

  • getting over my fear of code. 🙂 hahahahhhhaaaaaaahahaha i’m working on it.
  • i feel like that is a fake blocker so just ignore that.

you’re welcome for the info dump, enjoy!


Week 5 (2/10/2020)

What I Did this Week:

This week I worked a lot of watching/finding tutorials that relate to my Max patch idea. And I think that I’ve made a lot of progress in this search. Some good references:

  • dude837 – Sam is one of the contributors of the Tiramisu plug-in (see above) and he has a video where he goes through all of the patches and logic for the plug-in. He also has a playlist of “Delicious Tutorials” that I’ve also been watching. I found one that I think might be very applicable.
  • dearjohnreed – John goes through the basics of Max 8 and I’ve been watching these to gain a very basic understanding of what’s going on. He goes very slowly and he’s pretty thorough, so I played the videos at 1.5x speed and I’m following along.

Some personal updates:

  • Some hand-drawn brainstorming/ideas:
  • I figured out how to make a buffer! And I was able to load in a sample and then play it! I did it in two different ways thanks to one of John’s Tutorials and one from the Max documentation reference!
Option 1: Uses “play~” from John
Option 2: Uses “groove~” from MSP Ref
MSP Reference/Documentation

What my Plans are for Next Week:

  • I think in order to load in multiple samples I need to use a “polybuffer~” so I’m going to work on figuring that out.
Max Help

Blockers: None


Midterm Week (2/24/20 + Spring Break)

Hi! Before the two week Spring Break, a lot of updates were made! And, I finally have a good grasp of my project and a physical idea of what my project will become!

Remember this video that I posted a few weeks back: https://www.youtube.com/watch?v=nkhtTdEK0tI –> Well this tutorial is part of a three video sequence that demonstrates how to use JavaScript within Max to create a circular sequencer. This is actually very similar to my project in some ways, so I decided to start off by following all three parts of this tutorial. I modify some of the code that the video used along the way, and ultimately, I had some prototype by the end!

Above is a snapshot of my Max Patch. By loading in your own sample and setting your desired number of Toggles (min 0 and max 16 toggles), you’ll create a circle of toggles when you used the “create” function (which is called when you press the “create $1” message in the Max Patch). The functions, “create” and “clear” are both featured as messages in the Max Patch. By pressing the bang in the top right corner, the circular sequencer will begin and this is visualized through the changing of colors of the toggles.

All of the functions that are physically visualized in the Max Patch, are actually connected through the JavaScript object where you can see that these functions actually exist within the code:

Create Function
Clear Function, Change_Step_Color Function

Enjoy this demo video of my prototype: https://drive.google.com/file/d/1qhJqoOmrGovM-68Ryw-3o7WCx1mMUhHb/view?usp=sharing

Some Future Endeavors:

  • Fix the colors of my toggles when switched “on” and “off”
  • Making multiples channels to create the polyrhythms.
    • Multiple buffers
  • Including User Parameters for steps and events.
  • Create the actual Euclidean Algorithm which will even distribute the steps among the events.
  • Create the randomization feature

Blockers:

  • None; I will be home 24/7 with my family in quarantine and I have everything I need to keep chugging along with my project :))

Week 10 (3/23/2020)

Lots of updates have been made to my project, things are coming together?

To start, I fixed the way the toggles were indicating when they were selected to be on or off to play the sample.

This was the colors when it was off and on; no matter what the background color was.

I realized that I didn’t want to change the background of the toggle, because the background was only changing to make the visualization of the rotations. I actually just wanted to change the color of the “X”. After being confused for a while and some google searches later, I figured out how to do that. The black “X” indicates ON, the purple background is the rotation visualization, and I made the “X” white for when the toggle is OFF. Seen here:

Revised Toggles

Next, I tackled the Euclidean Algorithm! First, I added an integer within the Max Patch next to the original integer that indicated the number of toggles. However, now the first integer would represent the number of steps and the second integer would represent the number of events. This way, the notation would replicate the actual way the Euclidean Algorithm notation works, for example:

E (5, 8) where 5 is the # of steps and 8 is the # of events
Updates to the Patch

Since I couldn’t figure out how to pass two integers into one function through the Max patch, I decided to pass each integer into their own functions: SetNumberOfEvents(e) & SetNumberOfSteps(s). These functions are then called into the Create() function in the Javascript code, but in the Max patch these functions are connected to the JS object.

Now, things started to happen. My next step was to actually introduce the Euclidean Algorithm into the code. I started to map out how I was going to do this on paper first. Here’s a picture of my thoughts/workflow; doodles included:

feat. my Working Array and Events Array

So I decided that I would need to create two arrays to organize the pattern; my “working array” and the “events array” (which would technically be the final array). And then I would be able to transfer those values from the events array to the toggles and switch them on or off depending on the steps and events previously given and the pattern that’s determined by the Euclidean Algorithm. So while I spent a long time trying to figure out how to actually accomplish that, I realized that I could probably just google it and implement that into my own code.

After finding/editing some code, I realized that the code I found was actually in an updated version of Javascript (ECMAScript 6.0) that Max wasn’t supporting. And that’s why my code wasn’t working. So then, I broke down the code and rewrote/translated it using simpler Javascript that Max would understand. Later, I found out that Max only supports ECMAScript 3.0. Through all this, I was able to make the getPattern() function, which then gets called in the Create() function.

The getPattern() function returns an array which would be used to tell which toggles to turn on or off during creation of the toggles. The index of the toggle would be the index of the pattern array.

Get Pattern Function
Get Pattern Function (cont.) : Returns array
update to the Create function

Some Next Steps:

  • Improve the algorithm?
  • My funnel is a little finicky, so I have to figure out that issue
  • Create the randomization based on probability feature
  • Make the second ring

Blockers:

  • None; unless I get sick somehow :((

Week 11 (4/6/2020)

This week I was able to create the 2nd Ring in my Max Patch!

Beautiful…

As you can see, I just copied and pasted the actual Max objects so that they would be side by side. However, I needed to create a new JavaScript object called “Ring2”. And this code just includes everything from the Main.js code. Except, I did have to change some of the variable values of the toggle_radius and the toggle_inset so that the circles could be inside one another. Also, I had to change the names of the steps within the codes so that they all have their own identification. And I changed the name of the buffers so that the play~ object could call from their own buffers and that would then correspond with the rings. Here are some video demos:

Video 1 (before I fixed the toggle_inset and toggle_radius): https://drive.google.com/file/d/1TS1v1MEO9rzc1tfQZf-RUB1oBoEpFvTQ/view?usp=sharing

Video 2 (fixed): https://drive.google.com/file/d/1MF2_ApHMIUJhZHxEaGtjWjbAcelgTjV7/view?usp=sharing

Some Next Steps:

  • Add a “Sync” feature for the metronomes of the two circles
  • Create the randomization based on probability feature

Blockers:

None whatsoever.


Final Week!!

A lot of new developments were made to bring this project up to this point!

I realized that I wanted my sequencer to create as many rings as the user wanted, without having to copy/paste the physical patch and create a new JS file for every ring.

First, I took all of the global variables that were used to create the funnel and moved them into an object

As new rings are created, each ring object would be added to a new global array; keeping track of all the rings every time the Create() function is called..

This Ring object is within the Create() function

Our array is keeping track of the rings that we’ve created.

During the creation of each ring, we based the new ring variables to recalculate the offsets of each new ring so that each one would be concentric to the previous ring…

Global Variable Declaration
Inset/Radius Calculation

The toggle_inset and toggle_radius is recalculated for the size and position of every ring that gets created.

Current Max Patch!

Here is the final Max Patch that I ended up with. As you can see, a funnel is created for every ring and every ring is concentric with each other. However some issues, that are clearly visual with this update is that the color of the toggles are inversed again. This was an issue that I fixed earlier, and then it completely “broke”, and then I semi-fixed it, which you can see in the image above.

Also, every time the user changes the steps/events, you have to click on the “SetNumberofSteps” and “SetNumberofEvents” and then click the Create function. This resets those variables and is used for each ring.

Video Demos!!

This is not the end… things to work on!

  • When created, the first ring has the inverse colors, and the beat visualization is not seen until the second ring is created.
  • Sometimes when the visualization does work, it will randomly stop the visualization as if they are not synchronized.
  • When clearing the funnels, the visualization also will stop.
    • Possible solutions: Rework the Beat() function 
  • Aesthetics
  • Implement the Randomization based on probability.

Thanks!

Create your website at WordPress.com
Get started