From 11ff996b2a7cc7017966a60331b88dd42bf7cbf5 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Wed, 28 Apr 2021 17:10:07 +0100 Subject: [PATCH 1/3] Improve formatting of credits in readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bccbac5..3300bf7 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,11 @@ For ARM, we use the following default set of flags (with the Bela in mind): -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon ``` -# Credits -### FluCoMa core development team (in alphabetical order) -Owen Green -Gerard Roma -Pierre Alexandre Tremblay +## Credits +#### FluCoMa core development team (in alphabetical order) +Owen Green, Gerard Roma, Pierre Alexandre Tremblay -### Other contributors: +#### Other contributors: Alex Harker, Francesco Cameli -- From 5d7b5991cd23545c7039241a3cac7e3e901ee18b Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Wed, 28 Apr 2021 17:27:21 +0100 Subject: [PATCH 2/3] bufnmfcross - updated help and examples --- .../Classes/FluidBufNMFCross.schelp | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp b/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp index d5be65f..c4cb526 100644 --- a/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp @@ -1,18 +1,15 @@ TITLE:: FluidBufNMFCross -summary:: Cross Synthesis with Nonnegative Matrix Factorization +summary:: Reconstructs the sound in the target buffer using components learned from the source buffer using an NMF decomposition categories:: FluidManipulation related:: Classes/FluidBufNMF, Classes/FluidNMFMatch, Classes/FluidNMFFilter DESCRIPTION:: -Produces hybridisations of two link::Classes/Buffer::s by using Nonnegative Maxtrix Factorization (NMF) +The process works by attempting to reconstruct compoentns of the code::target:: sound using the timbre of the code::source:: sound, learned through a Nonnegative Matrix Factorisation. The result is a hybrid whose character depends on how well the target can be represnted by the source's spectral frames. -See Driedger, J., Prätzlich, T., & Müller, M. (2015). Let it Bee-Towards NMF-Inspired Audio Mosaicing. ISMIR, 350–356. http://ismir2015.uma.es/articles/13_Paper.pdf - -The process works by attempting to reconstruct the code::target:: sound using the timbre of the code::source:: sound, resulting in a hybrid whose character depends on how well the target can be represnted by the source's spectral frames. - -In contrast to link::Classes/FluidBufNMF::, the size and content of the bases dictionary are fixed in this application to be the spectrogram of the code::source::. Each spectral frame of code::source:: is a template: be aware that NMF is O(N^2) in the number of templates, so longer code::source:: buffers will take dramatically longer to process. +In contrast to link::Classes/FluidBufNMF::, the size and content of the bases dictionary are fixed in this application to be the spectrogram of the `source`. Each spectral frame of `source` is a template: be aware that NMF is O(N^2) in the number of templates, so longer `source` link::Classes/Buffer::s will take dramatically longer to process. +See Driedger, J., Prätzlich, T., & Müller, M. (2015). Let it Bee-Towards NMF-Inspired Audio Mosaicing. ISMIR, 350–356. http://ismir2015.uma.es/articles/13_Paper.pdf CLASSMETHODS:: @@ -40,6 +37,9 @@ Control the repetition of source templates in the reconstruction by specifying a ARGUMENT:: polyphony Control the spectral density of the output sound by restricting the number of simultaneous templates that can be used. Units are spectral bins. +ARGUMENT:: continuity +Promote the use of N successive source frames, giving greater continuity in the result. This can not be bigger than the sizes of the input buffers, but useful values tend to be much lower (in the tens). + ARGUMENT:: iterations How many iterations of NMF to run @@ -71,7 +71,18 @@ code:: b = Buffer.read(s,~path+/+"Nicol-LoopE-M.wav") t = Buffer.read(s,~path+/+"Tremblay-SA-UprightPianoPedalWide.wav") o = Buffer.new -FluidBufNMFCross.process(s,t,b,o,action:{"Ding".postln}) -//wait for it to be done. It is a long process. +FluidBufNMFCross.process(s,t,b,o,windowSize: 2048, action:{"Ding".postln}) +//wait for it to be done. It can take a while, depending on the length of your source. +o.play + +//The result of the cross synthesis is a hybrid of the source and target sounds. The algorithm tries to match the target spectrum over time using components learned from the source. These parameters affect the reconstruction: +~sparsity = 4; //Avoid reusing a component from the source for this number of time frames +~polyphony = 3; //Avoid overlapping more than this number of source components at the same time +~continuity = 20; //Encourage the reconstruction to use this many temporally consecutive frames from the source + +{FreeSelfWhenDone.kr(FluidBufNMFCross.kr(t,b,o,timeSparsity: ~sparsity, polyphony: ~polyphony, continuity: ~continuity, windowSize: 2048).poll)}.play +//Using the UGen to run the process can be useful to monitor its progress +o.query o.play :: + From ad49e3c7e5cbba3413c0742bcff112e3766b7521 Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Wed, 28 Apr 2021 18:01:56 +0100 Subject: [PATCH 3/3] now without error... --- .../HelpSource/Classes/FluidBufNMFCross.schelp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp b/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp index c4cb526..acc8a06 100644 --- a/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp @@ -67,7 +67,7 @@ EXAMPLES:: code:: -~path = File.realpath(FluidBufNMF.class.filenameSymbol).dirname.withTrailingSlash +/+ "../AudioFiles/" +~path = File.realpath(FluidBufNMFCross.class.filenameSymbol).dirname.withTrailingSlash +/+ "../AudioFiles/" b = Buffer.read(s,~path+/+"Nicol-LoopE-M.wav") t = Buffer.read(s,~path+/+"Tremblay-SA-UprightPianoPedalWide.wav") o = Buffer.new @@ -80,9 +80,15 @@ o.play ~polyphony = 3; //Avoid overlapping more than this number of source components at the same time ~continuity = 20; //Encourage the reconstruction to use this many temporally consecutive frames from the source -{FreeSelfWhenDone.kr(FluidBufNMFCross.kr(t,b,o,timeSparsity: ~sparsity, polyphony: ~polyphony, continuity: ~continuity, windowSize: 2048).poll)}.play //Using the UGen to run the process can be useful to monitor its progress -o.query +( +Routine{ + ~cross = FluidBufNMFCross.process(s,t,b,o,timeSparsity: ~sparsity, polyphony: ~polyphony, continuity: ~continuity, windowSize: 2048); + defer{{FreeSelfWhenDone.kr(~cross.kr).poll}.play;}; + ~cross.wait; + \Done.postln; +}.play; +) o.play ::