/
startup.scd.template
52 lines (45 loc) · 2.61 KB
/
startup.scd.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
This is an ansible generated startup file.
Modifications will be overwritten on next run,
but a backup copy will exist in the same dir as this file
*/
(
s.reboot { // server options are only updated on reboot
// configure the sound server: here you could add hardware specific options
// see http://doc.sccode.org/Classes/ServerOptions.html
s.options.numBuffers = {{ sc_option_numBuffers }}; // increase this if you need to load more samples
s.options.memSize = {{ sc_option_memSize }}; // increase this if you get "alloc failed" messages
s.options.numWireBufs = {{ sc_option_numWireBufs }}; // increase this if you get "exceeded number of interconnect buffers" messages
s.options.maxNodes = {{ sc_option_maxNodes }}; // increase this if you are getting drop outs and the message "too many nodes"
s.options.numOutputBusChannels = {{ sc_option_numOutputBusChannels }}; // set this to your hardware output channel size, if necessary
s.options.numInputBusChannels = {{ sc_option_numInputBusChannels }}; // set this to your hardware output channel size, if necessary
s.options.maxLogins = {{ sc_option_maxLogins }}; // optional, required to enable feedforward VU meter
// boot the server and start SuperDirt
s.waitForBoot {
~dirt = SuperDirt(2, s); // two output channels, increase if you want to pan across more channels
~dirt.loadSoundFiles; // load samples (path containing a wildcard can be passed in)
// for example: ~dirt.loadSoundFiles("/Users/myUserName/Dirt/samples/*");
{% if custom_sample_paths is defined %}
{% for item in custom_sample_paths %}
~dirt.loadSoundFiles("{{ item }}/*");
{% endfor %}
{% endif %}
// s.sync; // optionally: wait for samples to be read
{% if sc_option_numOutputBusChannels == 2 %}
~dirt.start(57120, 0 ! 12); // start listening on port 57120, create two busses each sending audio to channel 0
{% else %}
~dirt.start(57120, [{% for i in range(0, sc_option_numOutputBusChannels, 2 ) %}{{ i }}{% if i != sc_option_numOutputBusChannels - 2 %}, {%endif %}{% endfor %}]); // start listening on port 57120, create {{ (sc_option_numOutputBusChannels/2)|int }} stereo busses
{% endif %}
// optional, enable feedforward vu meter
~dirt.startSendRMS;
// optional, needed for convenient access from sclang:
(
~d1 = ~dirt.orbits[0]; ~d2 = ~dirt.orbits[1]; ~d3 = ~dirt.orbits[2];
~d4 = ~dirt.orbits[3]; ~d5 = ~dirt.orbits[4]; ~d6 = ~dirt.orbits[5];
~d7 = ~dirt.orbits[6]; ~d8 = ~dirt.orbits[7]; ~d9 = ~dirt.orbits[8];
~d10 = ~dirt.orbits[9]; ~d11 = ~dirt.orbits[10]; ~d12 = ~dirt.orbits[11];
);
};
s.latency = 0.3; // increase this if you get "late" messages
};
);