File: README.developers

package info (click to toggle)
guitarix 0.36.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 139,468 kB
  • sloc: cpp: 317,557; python: 42,482; ansic: 18,301; fortran: 2,012; sh: 662; makefile: 422; xml: 208; perl: 183; pascal: 74; lisp: 32
file content (102 lines) | stat: -rw-r--r-- 3,923 bytes parent folder | download | duplicates (3)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Documentation for Guitarix Developers

1. Measurement of DSP processing times
2. Formatting of source code
3. Thread architecture
4. Parameters (for DSP algorithms etc.)
5. Integration of faust code
6. LADSPA

1. Measurement of DSP processing times
----------------------------------------------------------------

Guitarix must be compiled with --debug (specifically NDEBUG not
defined). Time measurement is switched on by defining the environment
variable GUITARIX_MEASURE. When setting its value to 1 results are
more verbose. Results are printed each second on stdout.

For better controlled measurements you can disable frequency scaling
and set cpu affinity:

$ sudo cpufreq-set -d 800MHz -u 800MHz # or whatever your cpu supports
$ GUITARIX_MEASURE=1 taskset -c 0 guitarix


2. Formatting of source code
----------------------------------------------------------------

We use emacs c++ style "linux" (other formatters like astyle have
similar styles under this name) with following modifications:

 - namespaces do not increase indentation
   in .emacs: (setq c-offsets-alist '((innamespace . 0)))

 - tabs at the beginning of lines, but not for aligning indentation
   ("smart tabs", http://www.emacswiki.org/emacs/SmartTabs). Should
   look correct with any tab width (though for tab width 8 you need
   a wide screen..).


3. Thread architecture
----------------------------------------------------------------

Basically there are 2 threads:

 - the main thread for all work (especially all user interface)
   except audio processing

 - the jack rt thread for audio processing in the process() callback
   in hard real time (as "hard" as available..). The jack notification
   callbacks have more relaxed time constraints and may be executed in
   another thread created by libjack (depends on if you are using
   jack1 or jack2).

All other threads are just waiting for some semaphore or process
signal and delegate their work to the main thread via g_idle_add (this
is safe because the glib main loop data structures are protected by a
mutex).

An exception is the library for the zita convolver, which creates rt
threads to spread the work for convolution processing. But this is
internal to the library.

At some places in the program g_idle and g_timeout callbacks are
called threads, but these are running synchronous in the main loop and
are not meant here (on MP systems the main thread can even run
simultaneously with the rt thread).


4. Parameters (for DSP algorithms etc.)
----------------------------------------------------------------

All parameters have a unique string id. Its a path notation of group,
subgroup(s) and name separated by ".".

There is a base type (Parameter) and a central registry
(ParamMap) for all parameters. Parameters have a user-visible
group and name (e.g. when you set the midi controller for a
parameter) and a description, and can be defined in faust dsp code.

Registered parameters are saved into the application settings file and
possibly into preset files (depending on a flag in the parameter
definition).


5. Integration of faust code
----------------------------------------------------------------

Since faust code (http://faust.grame.fr ) is quite legible, but not so
the generated c++ code, its a good idea to work with the faust code
directly. This could be done by using the faust generated c++ objects
(and quite some runtime shuffling), but we are using the python script
tools/dsp2cc to post-process the faust output (giving some more
control at the expense of being a bit more faust version dependent).

Faust dsp files are in src/faust, the generated files get copied to
src/faust-cc for distribution so the program can be build later even
if faust is not installed (or no compatible version).

6. LADSPA
----------------------------------------------------------------

Guitarix has been allocated the range 4061 - 4099 for LADSPA UniqueID's.