1 title:: 11_Test_functions
2 summary:: Mark Polishook tutorial
3 categories:: Tutorials>Mark_Polishook_tutorial
4 related:: Tutorials/Mark_Polishook_tutorial/00_Introductory_tutorial
6 section::Functions and .scope messages
8 An easy way to audition synthesis processes is to test them within a function. To do this, append a .scope or a .play message to a function. The .scope message, which works only with the internal server, displays a visual representation of a sound wave.
10 ////////////////////////////////////////////////////////////////////////////////////////////////////
12 Boot (turn on) the internal server
18 Run this example, and look at the scope window.
21 // test a synthesis process in a function
24 SinOsc.ar([440.067, 441.013], 0, 1)
26 SinOsc.ar([111, 109], 0, 0.2)
31 ////////////////////////////////////////////////////////////////////////////////////////////////////
33 Code can be transfered from a test function into a synthdef. In the following example, the code from the function (above) is the second argument to the Out ugen.
40 SinOsc.ar([440.067, 441.013], 0, 1)
42 SinOsc.ar([111, 109], 0, 0.2)
50 section::Multi-channel expansion
52 Expand a ugen to two channels with an array in any of the argument (control) slots.
55 { Saw.ar([500, 933], 0.1) }.scope;
58 Another (longer) way to write the same thing is
61 { [ Saw.ar(500, 0.1), Saw.ar(933, 0.1)] }.scope;
64 Expand a ugen to three channels by adding values to the array.
67 { Saw.ar([500, 933, 2033], 0.1) }.scope;
71 { Saw.ar([500, 933, 2033, 895], 0.1) }.scope;
74 ////////////////////////////////////////////////////////////////////////////////////////////////////
76 go to link::Tutorials/Mark_Polishook_tutorial/12_UnaryOp_synthesis::