Debian Codegraph @

externals/README

raw
1 Welcome to this quick guide for those of you who want to write their
2 own pyo objects. These few steps explain how to add custom objects,
3 written in C, to the pyo library.
4
5 In this folder, there is three self-documented files that can be used
6 as a template to build an effect processor (I intend to write examples
7 for more object's types in the future). These files can be used as is
8 to compile a "Gain" object, which is modifying the volume of a signal
9 according to a value, static or audio, given in decibel.
10
11 Files are:
12 - externalmodule-template.c : C part of the object. Here is defined
13 all the DSP and the python object structure using the Python-C API.
14 It creates an object called "Gain_base".
15
16 - externalmodule-template.h : This file indicates to the "_pyo"
17 module which objects to compile.
18
19 - external-template.py : Python part of the object. Here is defined
20 the user interface of the object. An audio processor is a class that
21 inherits from the PyoObject. In this example, the object is simply
22 called "Gain" and uses "Gain_base" as the real processing part and
23 for multi-channel expansion purpose.
24
25 === Steps to compile the "Gain" objects ===
26
27 1. All three files must be copied and renamed respectively:
28 - externalmodule.c
29 - externalmodule.h
30 - external.py
31
32 2. Compile pyo with the flag --compile-externals
33
34 That's it! The setup.py will add these files to the compilation chain
35 and create a "Gain" object in the pyo library.
36
37 To add other processing objects, all you have to do is to copy everthing
38 about the "Gain" object and then change the name, attributes, methods
39 and the processing part according to your new functionnality.
40
41 * VERY IMPORTANT *
42 Only these three files are added to the compilation, so, for the time
43 being, all objects MUST be written in those files. Perhaps one day,
44 it will be possible to write new objects in separated files but actually,
45 it's not possible.
46
47 For questions and comments, please write to the pyo-discuss mailing list:
48 pyo-discuss(at)googlegroups(dot)com