Hi, this is the second tutorial of
poly~object. In this tutorial, we will try controlling each instance individually. Source code (.maxpat) is uploaded here on github and we will use
First, let’s see the essential point of the instance of
poly~. Please open
As you can see, most objects are common except
in. If you are also unfamiliar with
out~, please check the previous article.
So, how do you think
inobject works? Yes, it is similar to
out~ object or
inlet object. It works as the inlet of
poly~object. In other words,
in emits what each instance gets from outside the instance.
in works only inside
thispoly~? This object is REALLY IMPORTANT especially when we control huge amount of instances and want to reduce the use of computational resources. But in this patch,
thispoly~ is used only to get the index of each instance. When
bang is sent to
thispoly~, it emits index number of each instance starting from 1.
Therefore, if there’s no input from
sub-2.maxpatcreates sine wave and its frequency is the multiple of 440 based on the instance index.
Then, let’s see
If you are ready, turn on the audio. You will hear the sound and see 3 waves on
From now, we’ll control each instance. We have to take 2 steps in order to control individually.
- Select target instance to control.
- Send message.
For step 1. we need to send a
target X message to specify the target instance. Click
target 1message and all incoming messages will be sent to 1st instance of
sub-2.maxpat. Then, scroll number box next to the
tab. This is step 2. Now you hear the different sound.
Change the target and frequency more so that each pitch gets different sound. Let’s change each frequency to 261.6, 329.6, and 392 to get C major!
This is how to control the instances individually.
If you want to see what is going on the each instance, sending
open Xmessage to
poly~ is a good way to do it.