Debian Codegraph @

doc-en/source/src/api/Interface/csampler.rst

raw
1 csampler : creates a popup menu to load a soundfile in a sampler
2 ================================================================
3
4 Initline
5 ---------
6
7 .. code::
8
9 csampler(name='sampler', label='Audio', help='')
10
11 Description
12 ------------
13
14 This menu allows the user to choose a soundfile for processing in the
15 module. More than one csampler can be defined in a module. They will
16 appear under the input label in the left side panel of the main window,
17 in the order they have been defined. When the user chooses a sound using
18 the interface, Cecilia will scan the whole folder for soundfiles. A
19 submenu containing all soundfiles present in the folder will allow a
20 quicker access to them later on. Loop points, pitch and amplitude
21 parameters of the loaded soundfile can be controlled by the csampler
22 window that drops when clicking the triangle just besides the name of
23 the sound.
24
25 A sampler returns an audio variable containing Cecilia's number of
26 output channels regardless of the number of channels in the soundfile.
27 A distribution algorithm is used to assign X number of channels to Y
28 number of outputs.
29
30 In the processing class, use the BaseModule's method `addSampler` to
31 retrieve the audio variable containing all channels of the looped sound.
32
33
34 .. code::
35
36 BaseModule.addSampler(name, pitch, amp)
37
38 For a csampler created with name='mysound', the audio variable is
39 retrieved using a call like this one:
40
41
42 .. code::
43
44 self.snd = self.addSampler('mysound')
45
46 Audio LFOs on pitch and amplitude of the looped sound can be passed
47 directly to the addSampler method:
48
49
50 .. code::
51
52 self.pitlf = Sine(freq=.1, mul=.25, add=1)
53 self.amplf = Sine(freq=.15, mul=.5, add=.5)
54 self.snd = self.addSampler('mysound', self.pitlf, self.amplf)
55
56 Parameters
57 -----------
58
59 **name**: str
60 A string passed to the parameter `name` of the BaseModule.addSampler
61 method. This method returns a Mix object containing Cecilia's
62 number of channels as audio streams from a Looper object
63 controlled with the sampler window of the interface.
64 **label**: str
65 Label shown in the interface.
66 **help**: str
67 Help string shown in the sampler popup's tooltip.
68
69