From 4889515a91c6fe7f0eb7261956138e5e9518703e Mon Sep 17 00:00:00 2001 From: antisvin Date: Thu, 25 Nov 2021 16:54:45 +0300 Subject: [PATCH 1/4] Use param F for output --- Faust/04Output.dsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Faust/04Output.dsp b/Faust/04Output.dsp index ec788f4..a35a4c2 100644 --- a/Faust/04Output.dsp +++ b/Faust/04Output.dsp @@ -2,6 +2,6 @@ import("stdfaust.lib"); freq = hslider("Frequency[OWL:A]", 60, 60, 440, 1); lfo_freq = hslider("LFO frequency[OWL:B]", 0.3, 0.01, 1.0, 0.01) : si.smoo; -lfo_out = hbargraph("LFO>[OWL:C]", -1, 1); +lfo_out = hbargraph("LFO>[OWL:F]", -1, 1); process = attach(os.osc(freq), os.osc(lfo_freq) : lfo_out); From d312abcf45df90abeb4c2f31efd11410db420a18 Mon Sep 17 00:00:00 2001 From: antisvin Date: Thu, 25 Nov 2021 20:27:19 +0300 Subject: [PATCH 2/4] Add support for loading instead of storing in FAUST patches build script --- Faust/upload.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Faust/upload.py b/Faust/upload.py index 2b050ae..d813237 100755 --- a/Faust/upload.py +++ b/Faust/upload.py @@ -2,12 +2,12 @@ import argparse import os -import shutil import subprocess parser = argparse.ArgumentParser('Upload Faust samples') parser.add_argument('--owl', help='path to OwlProgram directory', default='../../OwlProgram/') parser.add_argument('--slot', help='slot number used for first patch', default=1, type=int) +parser.add_argument('--load', help='load patches instead of storing', action=argparse.BooleanOptionalAction) args = parser.parse_args() @@ -19,17 +19,20 @@ env = os.environ.copy() -print(f'Using owl program from {owl}') +print(f'Using OWL program from {owl}') + +env['PATCHSOURCE'] = os.getcwd() for i, fname in enumerate(faust_files): - # copy file without first 2 symbols used for sorting - dst = os.path.join(owl, 'PatchSource', fname[2:]) - shutil.copy(fname, dst) # set env vars for current patch processing - env['SLOT'] = str(args.slot + i) - env['FAUST'] = fname[2:-4] + env['FAUST'] = fname[:-4] + env['PATCHNAME'] = fname[2:-4] print() - print(f'{env["SLOT"]} <= {env["FAUST"]}') - # upload patch - subprocess.run(['make', 'clean', 'store'], cwd=os.path.abspath(args.owl), env=env) - os.remove(dst) + if args.load: + # load patch + subprocess.run(['make', 'clean', 'load'], cwd=os.path.abspath(args.owl), env=env, check=True) + else: + # store patch + env['SLOT'] = str(args.slot + i) + print(f'{env["SLOT"]} <= {env["FAUST"]}') + subprocess.run(['make', 'clean', 'store'], cwd=os.path.abspath(args.owl), env=env, check=True) From 4e3dabc821e32e565b26f1ef81d4b41385030895 Mon Sep 17 00:00:00 2001 From: antisvin Date: Thu, 25 Nov 2021 20:48:28 +0300 Subject: [PATCH 3/4] Add buttons sample code and make everything stereo --- Faust/00Bypass.dsp | 2 +- Faust/01Message.dsp | 2 +- Faust/02Input.dsp | 2 +- Faust/03Harmonics.dsp | 2 +- Faust/04Output.dsp | 2 +- Faust/05Buttons.dsp | 6 ++++++ Faust/{05MIDI.dsp => 06MIDI.dsp} | 2 +- Faust/{06VoctIn.dsp => 07VoctIn.dsp} | 2 +- Faust/{07VoctOut.dsp => 08VoctOut.dsp} | 0 Faust/README.md | 16 ++++++++-------- 10 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 Faust/05Buttons.dsp rename Faust/{05MIDI.dsp => 06MIDI.dsp} (79%) rename Faust/{06VoctIn.dsp => 07VoctIn.dsp} (71%) rename Faust/{07VoctOut.dsp => 08VoctOut.dsp} (100%) diff --git a/Faust/00Bypass.dsp b/Faust/00Bypass.dsp index 514eb33..2d5b3e3 100644 --- a/Faust/00Bypass.dsp +++ b/Faust/00Bypass.dsp @@ -1 +1 @@ -process = _; +process = _, _; diff --git a/Faust/01Message.dsp b/Faust/01Message.dsp index f5527dc..c75ddb8 100644 --- a/Faust/01Message.dsp +++ b/Faust/01Message.dsp @@ -2,4 +2,4 @@ declare message "Hello\nmake some noise"; import("stdfaust.lib"); -process = no.noise : *(0.5); \ No newline at end of file +process = no.noise : *(0.5) <: _, _; diff --git a/Faust/02Input.dsp b/Faust/02Input.dsp index cce2441..4a5af8e 100644 --- a/Faust/02Input.dsp +++ b/Faust/02Input.dsp @@ -2,4 +2,4 @@ import("stdfaust.lib"); freq = hslider("Frequency[OWL:A]", 60, 60, 440, 1); -process = os.osc(freq); +process = os.osc(freq) <: _, _; diff --git a/Faust/03Harmonics.dsp b/Faust/03Harmonics.dsp index c595050..c52d4f7 100644 --- a/Faust/03Harmonics.dsp +++ b/Faust/03Harmonics.dsp @@ -6,4 +6,4 @@ process = par( i, 8, hslider("Harmonic %i[OWL:%i]", 1 / (1 + i), 0, 1, 0.001) * os.oscs(i * freq + freq) -) :> _ : *(0.125) <: _, _; \ No newline at end of file +) :> _ : *(0.125) <: _, _; diff --git a/Faust/04Output.dsp b/Faust/04Output.dsp index a35a4c2..3b52f41 100644 --- a/Faust/04Output.dsp +++ b/Faust/04Output.dsp @@ -4,4 +4,4 @@ freq = hslider("Frequency[OWL:A]", 60, 60, 440, 1); lfo_freq = hslider("LFO frequency[OWL:B]", 0.3, 0.01, 1.0, 0.01) : si.smoo; lfo_out = hbargraph("LFO>[OWL:F]", -1, 1); -process = attach(os.osc(freq), os.osc(lfo_freq) : lfo_out); +process = attach(os.osc(freq), os.osc(lfo_freq) : lfo_out) <: _, _; diff --git a/Faust/05Buttons.dsp b/Faust/05Buttons.dsp new file mode 100644 index 0000000..034c605 --- /dev/null +++ b/Faust/05Buttons.dsp @@ -0,0 +1,6 @@ +import("music.lib"); + +btn1 = button("Button1[OWL:B1]"); +led1 = hbargraph("LED2>[OWL:B1]", 0, 1); + +process = attach(osc(1000) * btn1, 1-btn1 : led1) <: _, _; diff --git a/Faust/05MIDI.dsp b/Faust/06MIDI.dsp similarity index 79% rename from Faust/05MIDI.dsp rename to Faust/06MIDI.dsp index 65e649d..88ed284 100644 --- a/Faust/05MIDI.dsp +++ b/Faust/06MIDI.dsp @@ -7,4 +7,4 @@ gain = hslider("gain", 0.0, 0.0, 1.0, 0.001); gate = button("gate"); sustain = hslider("Sustain[OWL:A]", 5.0, 1.0, 10.0, 0.01); -process = sy.combString(freq, gain * sustain, gate); +process = sy.combString(freq, gain * sustain, gate) <: _, _; diff --git a/Faust/06VoctIn.dsp b/Faust/07VoctIn.dsp similarity index 71% rename from Faust/06VoctIn.dsp rename to Faust/07VoctIn.dsp index 1c60303..5d98a36 100644 --- a/Faust/06VoctIn.dsp +++ b/Faust/07VoctIn.dsp @@ -5,4 +5,4 @@ import("owl.lib"); tune = hslider("Tune[OWL:A]", 0, -2, 2, 0.01); -process = sample2hertz(tune) : os.oscs; +process = sample2hertz(tune) : os.oscs <: _, _; diff --git a/Faust/07VoctOut.dsp b/Faust/08VoctOut.dsp similarity index 100% rename from Faust/07VoctOut.dsp rename to Faust/08VoctOut.dsp diff --git a/Faust/README.md b/Faust/README.md index 456c984..ef3d750 100644 --- a/Faust/README.md +++ b/Faust/README.md @@ -38,7 +38,7 @@ This compiles the patch and stores it on the device in memory slot 5. Simplest patch in FAUST would look like this: ``` -process = _; +process = _, _; ``` What it does is takes input from first audio channel and sends it to output without any modifications. @@ -55,7 +55,7 @@ declare message "Hello\nmake some noise"; import("stdfaust.lib"); -process = no.noise : *(0.5); +process = no.noise : *(0.5) <: _, _; ``` Here the first line adds a metadata declaration, second line imports FAUST's standard library and the last line sends output from a white noise generator to output channel 1 with gain reduced by half. @@ -68,7 +68,7 @@ You can control patch parameters by binding them with FAUST UI controls. Let's l ``` import("stdfaust.lib"); freq = hslider("Frequency[OWL:A]", 60, 60, 440, 1); -process = os.osc(freq); +process = os.osc(freq) <: _, _; ``` ``[OWL:A]`` in parameter label is what binds your device's input to FAUST parameter. Parameter ranges that you can use are A-H, AA-AH, BA-BH, CA-CH and DA-DH. The buttons are assigned with B1, B2 et c. This is what FAUST patches support, but the actual parameters that have physical inputs on a particular device would be more limited. You would have to use MIDI to access those that don't have physical control on device. @@ -107,7 +107,7 @@ freq = hslider("Frequency[OWL:A]", 60, 60, 440, 1); lfo_freq = hslider("LFO frequency[OWL:B]", 0.3, 0.01, 1.0, 0.01) : si.smoo; lfo_out = hbargraph("LFO>[OWL:F]", -1, 1); -process = attach(os.osc(freq), os.osc(lfo_freq) : lfo_out); +process = attach(os.osc(freq), os.osc(lfo_freq) : lfo_out) <: _, _; ``` This patch produces a static sine wave tone initially. But if we connect output from patch point `F` with the input on patch point `A`, then we get a slow frequency modulation in our audio. @@ -124,10 +124,10 @@ Here is an example that sends the inverted button value out to control the B1 LE ``` import("music.lib"); -btn1 = button("btn1[OWL:B1]"); -led1 = hbargraph("led2>[OWL:B1]", 0, 1); +btn1 = button("Button1[OWL:B1]"); +led1 = hbargraph("LED2>[OWL:B1]", 0, 1); -process = attach(osc(1000) * btn1, 1-btn1 : led1); +process = attach(osc(1000) * btn1, 1-btn1 : led1) <: _, _; ``` Gate outputs will have hardware specific assignments, e.g. on the Lich it is ``B3``, while the two gate outputs on the Witch are designated ``B5`` and ``B6``. You can also use ``PUSH`` as a more generic name for the first button or gate, and it works with both inputs and outputs. @@ -147,7 +147,7 @@ gain = hslider("gain", 0.0, 0.0, 1.0, 0.001); gate = button("gate"); sustain = hslider("Sustain[OWL:A]", 5.0, 1.0, 10.0, 0.01); -process = sy.combString(freq, gain * sustain, gate); +process = sy.combString(freq, gain * sustain, gate) <: _, _; ``` First of all, you must enable MIDI with metadata declaration. From e059d2eb373653f8b6c48b69f384f95a97f12da4 Mon Sep 17 00:00:00 2001 From: antisvin Date: Thu, 25 Nov 2021 20:51:45 +0300 Subject: [PATCH 4/4] Lower osc pitch --- Faust/05Buttons.dsp | 2 +- Faust/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Faust/05Buttons.dsp b/Faust/05Buttons.dsp index 034c605..3f3efe4 100644 --- a/Faust/05Buttons.dsp +++ b/Faust/05Buttons.dsp @@ -3,4 +3,4 @@ import("music.lib"); btn1 = button("Button1[OWL:B1]"); led1 = hbargraph("LED2>[OWL:B1]", 0, 1); -process = attach(osc(1000) * btn1, 1-btn1 : led1) <: _, _; +process = attach(osc(220) * btn1, 1-btn1 : led1) <: _, _; diff --git a/Faust/README.md b/Faust/README.md index ef3d750..830e204 100644 --- a/Faust/README.md +++ b/Faust/README.md @@ -127,7 +127,7 @@ import("music.lib"); btn1 = button("Button1[OWL:B1]"); led1 = hbargraph("LED2>[OWL:B1]", 0, 1); -process = attach(osc(1000) * btn1, 1-btn1 : led1) <: _, _; +process = attach(osc(220) * btn1, 1-btn1 : led1) <: _, _; ``` Gate outputs will have hardware specific assignments, e.g. on the Lich it is ``B3``, while the two gate outputs on the Witch are designated ``B5`` and ``B6``. You can also use ``PUSH`` as a more generic name for the first button or gate, and it works with both inputs and outputs.