{"id":13603645,"url":"https://github.com/musikinformatik/Generic-Additive-Synthesis","last_synced_at":"2025-04-11T22:31:51.609Z","repository":{"id":50940178,"uuid":"93270072","full_name":"musikinformatik/Generic-Additive-Synthesis","owner":"musikinformatik","description":"Generic additive synthesis is a generalisation of additive sound synthesis.","archived":false,"fork":false,"pushed_at":"2021-05-27T08:18:28.000Z","size":8856,"stargazers_count":21,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T08:41:37.669Z","etag":null,"topics":["sound"],"latest_commit_sha":null,"homepage":"https://link.springer.com/chapter/10.1007/978-3-319-47337-6_27","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/musikinformatik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-03T19:37:55.000Z","updated_at":"2023-08-20T07:32:39.000Z","dependencies_parsed_at":"2022-08-25T13:51:32.353Z","dependency_job_id":null,"html_url":"https://github.com/musikinformatik/Generic-Additive-Synthesis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musikinformatik%2FGeneric-Additive-Synthesis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musikinformatik%2FGeneric-Additive-Synthesis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musikinformatik%2FGeneric-Additive-Synthesis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musikinformatik%2FGeneric-Additive-Synthesis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/musikinformatik","download_url":"https://codeload.github.com/musikinformatik/Generic-Additive-Synthesis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489711,"owners_count":21112622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sound"],"created_at":"2024-08-01T19:00:28.019Z","updated_at":"2025-04-11T22:31:48.410Z","avatar_url":"https://github.com/musikinformatik.png","language":null,"readme":"# Generic Additive Synthesis\n\nJulian Rohrhuber and Juan Sebastián Lach Lau.\n\nA 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)\n\nHere we provide some examples from the article and will add more in the future.\n\nA few simple examples, using [SuperCollider](https://github.com/supercollider/supercollider):\n\n## Simple case of concatenative frequency (phase) modulation (p. 273)\n\n```supercollider\n(\nNdef(\\g, {\n\tvar combinator = { |a, b| a \u003c\u003e b }; // operator: function composition\n\tvar c = { |i| LFTri.ar(1 / i, 1 / i).range(-1, 1).max(0) }; // spectrum: time varying\n\tvar g = { |x, i|\n\t\tSinOsc.ar(i * 40, x * 3) // basis: sine function that takes a modulated phase argument\n\t};\n\tvar n = (1..12); // number of operands\n\tn.inject(0, { |x, i| // inject is also known as left fold. Base case is 0 here\n\t\tg.(x, i) * c.(i) + (x * (1 - c.(i))) // this is so we get 0 as the neutral element\n\t}) * 0.1\n}).play;\n)\n```\n\n[sound_examples/example_1.flac](sound_examples/example_1.flac?raw=true)\n\n## Generic additive synthesis with a sine basis and addition (p. 271)\n\n```supercollider\n(\nNdef(\\g, {\n\n\tvar combinator = { |a, b| a + b }; // operator: just binary sum here\n\tvar c = { |i| 1 / ((i % 7) + (i % 8)  + (i % 11) + 1) }; // spectrum: jagged static shape\n\tvar g = { |i|\n\t\tSinOsc.ar(110 * i) * c.(i); // basis: sine function\n\t};\n\tvar z = (1..30); // number of operands\n\tvar set = z.collect { |i| g.(i) }; // sequence\n\t // combine and scale output:\n\tset.reduce(combinator) ! 2 * (1 / z.size)\n\n}).play;\n)\n```\n\n[sound_examples/example_2.flac](sound_examples/example_2.flac?raw=true)\n## Generic additive synthesis with a more complicated basis and a product combinator  (p. 271)\n\n```supercollider\n(\nNdef(\\g, {\n\tvar combinator = { |a, b| a * b }; // operator: product function\n\tvar c = { |i| 8 / i }; // spectrum: linear\n\tvar g = { |i| // basis: phase modulated pulses\n\t\tvar cn = c.(i);\n\t\tvar y1 = SinOsc.ar(120 * i, SinOsc.ar(cn * 10 * i) * (1/i));\n\t\tvar y2 = LFPulse.kr(cn, 0, SinOsc.ar(cn * i, i, 0.2, 0.3));\n\t\ty1 * y2 * cn + 1\n\t};\n\tvar n = (1..12); // number of operands\n\tvar set = n.collect { |i| g.(i) }; // sequence\n\tLeakDC.ar(set.reduce(combinator) * (0.01 / n.size)).tanh * 0.1 ! 2 // tanh projects the final output into range\n}).play;\n)\n```\n\n[sound_examples/example_3.flac](sound_examples/example_3.flac?raw=true)\n## Modifications of the examples from the article\n\n### Generic additive synthesis with a sine basis and addition, interactively control the spectral shape\n\n```supercollider\n(\nNdef(\\g, {\n\tvar x = MouseX.kr(0, 50);\n\tvar y = MouseY.kr(0, 10);\n\tvar combinator = { |a, b| a + b }; // operator: just binary sum here\n\tvar c = { |i|  // spectrum: jagged dynamic shape\n\t\ti = i * y + x; \n\t\t1 / (((i % 7) + (i % 8)  + (i % 11)).max(0) + 1) \n\t}; \n\tvar g = { |i|\n\t\tSinOsc.ar(50 * i) * (100 / i) * c.(i); // basis: sine function\n\t};\n\tvar z = (1..100); // number of operands\n\tvar set = z.collect { |i| g.(i) }; // sequence\n\t // combine and scale output:\n\tset.reduce(combinator) ! 2 * (1 / z.size)\n\n}).play;\n)\n```\n\n[sound_examples/example_4.flac](sound_examples/example_4.flac?raw=true)\n\n### Steno\n\nAnother example, using the [Steno](https://github.com/telephon/Steno) embedded language:\n\n```supercollider\n\nt = Steno.push(8); // a small 8 channel spectrum\n\n// definition of a spectrum composition operator G\n(\nt.filter(\\G, { |in, envir|\n\tvar r = \\rotate.kr(0);\n\tin = in.collect { |x| PanAz.ar(in.size, x, 2*r/in.size) }.sum;\n\tSinOsc.ar((100 / (\\index.kr + 1)), in * 2)\n});\n\n// the last node mixes down to stereo\nt.filter('.', { |in|\n\tSplay.ar(in) \n})\n);\n\n\n--GGGGG.\n\nt.setGlobal(\\index, { |i| i + 1 });\n\n```\n\n[sound_examples/example_5.flac](sound_examples/example_5.flac?raw=true)\n","funding_links":[],"categories":["SuperCollider"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusikinformatik%2FGeneric-Additive-Synthesis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmusikinformatik%2FGeneric-Additive-Synthesis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusikinformatik%2FGeneric-Additive-Synthesis/lists"}