Mixed inlets in a subpatch
To create an inlet for a subpatch that accepts both signals and data, try using t signal. See the patch example for this implementation within the subpatcher.
To create an inlet for a subpatch that accepts both signals and data, try using t signal. See the patch example for this implementation within the subpatcher.
For the basics of binding a pattr object to another object, see also "Binding a pattr object to another object" and "Binding objects to each other, and to a pattr".
For this example to work properly you'll first need to download two other patches.
In programming, it’s often useful to divide a task into parts, and consider the overall program as a combination of small tasks. Each small task can be considered a subset of the overall program, to be called upon when needed. In programming lingo, that’s often called a “subroutine” or a “function”.
As you get more involved in programming audio, it's likely that you'll want to have multiple sound possibilities available in your program, that you can switch on and off as needed. You might want to take a look at MSP Tutorial 5: Turning signals On and Off to learn about some basic ways of doing that. However, that chapter leaves out the following pretty crucial issue.