├── README.md └── sound_examples ├── example_1.flac ├── example_2.flac ├── example_3.flac ├── example_4.flac └── example_5.flac /README.md: -------------------------------------------------------------------------------- 1 | # Generic Additive Synthesis 2 | 3 | Julian Rohrhuber and Juan Sebastián Lach Lau. 4 | 5 | A generalisation of additive synthesis, as described in our article [Generic Additive Synthesis. Hints from the Early Foundational Crisis in Mathematics for Experiments in Sound Ontology](https://link.springer.com/chapter/10.1007/978-3-319-47337-6_27) 6 | 7 | Here we provide some examples from the article and will add more in the future. 8 | 9 | A few simple examples, using [SuperCollider](https://github.com/supercollider/supercollider): 10 | 11 | ## Simple case of concatenative frequency (phase) modulation (p. 273) 12 | 13 | ```supercollider 14 | ( 15 | Ndef(\g, { 16 | var combinator = { |a, b| a <> b }; // operator: function composition 17 | var c = { |i| LFTri.ar(1 / i, 1 / i).range(-1, 1).max(0) }; // spectrum: time varying 18 | var g = { |x, i| 19 | SinOsc.ar(i * 40, x * 3) // basis: sine function that takes a modulated phase argument 20 | }; 21 | var n = (1..12); // number of operands 22 | n.inject(0, { |x, i| // inject is also known as left fold. Base case is 0 here 23 | g.(x, i) * c.(i) + (x * (1 - c.(i))) // this is so we get 0 as the neutral element 24 | }) * 0.1 25 | }).play; 26 | ) 27 | ``` 28 | 29 | [sound_examples/example_1.flac](sound_examples/example_1.flac?raw=true) 30 | 31 | ## Generic additive synthesis with a sine basis and addition (p. 271) 32 | 33 | ```supercollider 34 | ( 35 | Ndef(\g, { 36 | 37 | var combinator = { |a, b| a + b }; // operator: just binary sum here 38 | var c = { |i| 1 / ((i % 7) + (i % 8) + (i % 11) + 1) }; // spectrum: jagged static shape 39 | var g = { |i| 40 | SinOsc.ar(110 * i) * c.(i); // basis: sine function 41 | }; 42 | var z = (1..30); // number of operands 43 | var set = z.collect { |i| g.(i) }; // sequence 44 | // combine and scale output: 45 | set.reduce(combinator) ! 2 * (1 / z.size) 46 | 47 | }).play; 48 | ) 49 | ``` 50 | 51 | [sound_examples/example_2.flac](sound_examples/example_2.flac?raw=true) 52 | ## Generic additive synthesis with a more complicated basis and a product combinator (p. 271) 53 | 54 | ```supercollider 55 | ( 56 | Ndef(\g, { 57 | var combinator = { |a, b| a * b }; // operator: product function 58 | var c = { |i| 8 / i }; // spectrum: linear 59 | var g = { |i| // basis: phase modulated pulses 60 | var cn = c.(i); 61 | var y1 = SinOsc.ar(120 * i, SinOsc.ar(cn * 10 * i) * (1/i)); 62 | var y2 = LFPulse.kr(cn, 0, SinOsc.ar(cn * i, i, 0.2, 0.3)); 63 | y1 * y2 * cn + 1 64 | }; 65 | var n = (1..12); // number of operands 66 | var set = n.collect { |i| g.(i) }; // sequence 67 | LeakDC.ar(set.reduce(combinator) * (0.01 / n.size)).tanh * 0.1 ! 2 // tanh projects the final output into range 68 | }).play; 69 | ) 70 | ``` 71 | 72 | [sound_examples/example_3.flac](sound_examples/example_3.flac?raw=true) 73 | ## Modifications of the examples from the article 74 | 75 | ### Generic additive synthesis with a sine basis and addition, interactively control the spectral shape 76 | 77 | ```supercollider 78 | ( 79 | Ndef(\g, { 80 | var x = MouseX.kr(0, 50); 81 | var y = MouseY.kr(0, 10); 82 | var combinator = { |a, b| a + b }; // operator: just binary sum here 83 | var c = { |i| // spectrum: jagged dynamic shape 84 | i = i * y + x; 85 | 1 / (((i % 7) + (i % 8) + (i % 11)).max(0) + 1) 86 | }; 87 | var g = { |i| 88 | SinOsc.ar(50 * i) * (100 / i) * c.(i); // basis: sine function 89 | }; 90 | var z = (1..100); // number of operands 91 | var set = z.collect { |i| g.(i) }; // sequence 92 | // combine and scale output: 93 | set.reduce(combinator) ! 2 * (1 / z.size) 94 | 95 | }).play; 96 | ) 97 | ``` 98 | 99 | [sound_examples/example_4.flac](sound_examples/example_4.flac?raw=true) 100 | 101 | ### Steno 102 | 103 | Another example, using the [Steno](https://github.com/telephon/Steno) embedded language: 104 | 105 | ```supercollider 106 | 107 | t = Steno.push(8); // a small 8 channel spectrum 108 | 109 | // definition of a spectrum composition operator G 110 | ( 111 | t.filter(\G, { |in, envir| 112 | var r = \rotate.kr(0); 113 | in = in.collect { |x| PanAz.ar(in.size, x, 2*r/in.size) }.sum; 114 | SinOsc.ar((100 / (\index.kr + 1)), in * 2) 115 | }); 116 | 117 | // the last node mixes down to stereo 118 | t.filter('.', { |in| 119 | Splay.ar(in) 120 | }) 121 | ); 122 | 123 | 124 | --GGGGG. 125 | 126 | t.setGlobal(\index, { |i| i + 1 }); 127 | 128 | ``` 129 | 130 | [sound_examples/example_5.flac](sound_examples/example_5.flac?raw=true) 131 | -------------------------------------------------------------------------------- /sound_examples/example_1.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musikinformatik/Generic-Additive-Synthesis/25c024d4e11031503979c985907b6a1c2b82fad3/sound_examples/example_1.flac -------------------------------------------------------------------------------- /sound_examples/example_2.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musikinformatik/Generic-Additive-Synthesis/25c024d4e11031503979c985907b6a1c2b82fad3/sound_examples/example_2.flac -------------------------------------------------------------------------------- /sound_examples/example_3.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musikinformatik/Generic-Additive-Synthesis/25c024d4e11031503979c985907b6a1c2b82fad3/sound_examples/example_3.flac -------------------------------------------------------------------------------- /sound_examples/example_4.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musikinformatik/Generic-Additive-Synthesis/25c024d4e11031503979c985907b6a1c2b82fad3/sound_examples/example_4.flac -------------------------------------------------------------------------------- /sound_examples/example_5.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musikinformatik/Generic-Additive-Synthesis/25c024d4e11031503979c985907b6a1c2b82fad3/sound_examples/example_5.flac --------------------------------------------------------------------------------