mdedwards / slippery-chicken

slippery chicken: algorithmic composition software in common lisp and clos
http://michael-edwards.org/sc
72 stars 3 forks source link

adding spatialization with reaper #66

Closed Leon-Focker closed 11 months ago

Leon-Focker commented 1 year ago

Heyo! Here is my suggestion on how to implement adding envelopes and plugins into reaper files and using this for spatialization purposes. There are several functions which edit already existing reaper project files, rather than generating a new one:

Currently the strings for 6 plugins are already availabe:

To make this possible I use the ppcre-library, which is copied into src/ppcre/... to avoid having to load it via quicklisp. It is currently loaded via asdf - which could probably be avoided if neccessary (?).

Simple tests for the new utility functions and write-spatial-reaper-file (and thus the functions it uses) are provided and everything works perfectly on my system!

mdedwards commented 1 year ago

Thanks for this Leon. As you’ve added quite a number of text files to the src directory and I would like to avoid clutter in there, could you please create a subdirectory and put them there? Also have you added a WikiPage to show how you use this within slippery-chicken and in particular perhaps  with slippery-chicken objects? Best michaelOn 11. May 2023, at 02:20, Leon Focker @.***> wrote:Heyo! Here is my suggestion on how to implement adding envelopes and plugins into reaper files and using this for spatialization purposes. There are several functions which edit already existing reaper project files, rather than generating a new one:

set-master-channels set-track-channels set-all-faders insert-plugin insert-envelope I also added the reaper-envelope class. An example on how to put all of these additions into use is write-spatial-reaper-file.

Currently the strings for 6 plugins are already availabe:

iem-stereo-encoder iem-multi-encoder iem-simple-decoder iem-binaural-decoder iem-allra-decoder blue-ripple-stereo-decoder This list could easily be extended, see the documentation of insert-plugin for details...

To make this possible I use the ppcre-library, which is copied into src/ppcre/... to avoid having to load it via quicklisp. It is currently loaded via asdf - which could probably be avoided if neccessary (?). Simple tests for the new utility functions and write-spatial-reaper-file (and thus the functions it uses) are provided and everything works perfectly on my system!

You can view, comment on, or merge this pull request online at:   https://github.com/mdedwards/slippery-chicken/pull/66

Commit Summary

35267ce added reaper-envelopes and and write-spatial-reaper-file. Missing documentation and details dac6fd6 Documentation 48928f8 Merge branch 'mdedwards:master' into leon 839bac1 cleanup 87dc8ec Merge branch 'leon' of github.com:Leon-Focker/slippery-chicken into leon f3fc76b form 4016fea name changes, more plugins, all in one variable 7fc595f added ppcre into sc, no need for ql 01187a5 simple unit tests and bugfix ae98e5b doc 702f3f0 merge with origin 8f504c3 updated documentation

File Changes (50 files)

M
src/all.lsp
(6)

A
src/blue-ripple.txt
(6)

A
src/iem-allra-decoder.txt
(31)

A
src/iem-binaural-decoder.txt
(18)

A
src/iem-multi-encoder.txt
(144)

A
src/iem-simple-decoder.txt
(20)

A
src/iem-stereo-encoder.txt
(20)

A
src/ppcre/CHANGELOG
(400)

A
src/ppcre/README.md
(30)

A
src/ppcre/api.lisp
(1278)

A
src/ppcre/charmap.lisp
(152)

A
src/ppcre/charset.lisp
(242)

A
src/ppcre/chartest.lisp
(98)

A
src/ppcre/cl-ppcre-unicode.asd
(64)

A
src/ppcre/cl-ppcre-unicode/packages.lisp
(38)

A
src/ppcre/cl-ppcre-unicode/resolver.lisp
(61)

A
src/ppcre/cl-ppcre.asd
(85)

A
src/ppcre/closures.lisp
(471)

A
src/ppcre/convert.lisp
(879)

A
src/ppcre/docs/index.html
(2231)

A
src/ppcre/errors.lisp
(84)

A
src/ppcre/lexer.lisp
(738)

A
src/ppcre/optimize.lisp
(578)

A
src/ppcre/packages.lisp
(69)

A
src/ppcre/parser.lisp
(290)

A
src/ppcre/regex-class-util.lisp
(555)

A
src/ppcre/regex-class.lisp
(271)

A
src/ppcre/repetition-closures.lisp
(833)

A
src/ppcre/scanner.lisp
(506)

A
src/ppcre/specials.lisp
(172)

A
src/ppcre/test/packages.lisp
(37)

A
src/ppcre/test/perl-tests.lisp
(150)

A
src/ppcre/test/perltest.pl
(160)

A
src/ppcre/test/perltestdata
(14292)

A
src/ppcre/test/perltestinput
(3956)

A
src/ppcre/test/simple
(377)

A
src/ppcre/test/tests.lisp
(159)

A
src/ppcre/test/unicode-tests.lisp
(80)

A
src/ppcre/test/unicodetestdata
(107)

A
src/ppcre/util.lisp
(201)

A
src/reaper-env.txt
(8)

A
src/reaper-fx.txt
(5)

M
src/reaper-header.txt
(2)

A
src/reaper-masterfxlist.txt
(6)

M
src/reaper-track.txt
(2)

A
src/reaper-trackfxchain.txt
(6)

M
src/reaper.lsp
(725)

M
src/sndfile.lsp
(12)

M
src/utilities.lsp
(111)

M
tests/sc-test-suite.lsp
(45)

Patch Links:

https://github.com/mdedwards/slippery-chicken/pull/66.patch https://github.com/mdedwards/slippery-chicken/pull/66.diff

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

danieljamesross commented 1 year ago

My 2 cents, feel free to ignore, but I don't think it's a great idea to include yet more libraries inside this repo as it adds bloat and makes updates difficult.

(FWIW I like Quicklisp as it handles all of this for us and I think SC should be compatible with it, but I know @mdedwards has his reservations.)

What if instead of including the library, we implement a method that clones it from the git repo? (If it exists then it performs a pull request instead). One could probably use uiop:run-program https://github.com/fare/asdf/blob/11a691c03eba55b718a154b673a7b77eb63eb244/uiop/run-program.lisp#L486

I haven't actually run the code and I don't mean to dump on your work, @Leon-Focker, apologies. I'm sure its great!

mdedwards commented 1 year ago

I completely understand this Dan. As Leon’s extensions here are not ‘core’ it would also be fine with me if his files used quicklisp but I wouldn’t want quicklisp failures make SC installation even more difficult. Best, Michael

On 11. May 2023, at 09:59, Dan @.***> wrote:

My 2 cents, feel free to ignore, but I don't think it's a great idea to include yet more libraries inside this repo as it adds bloat and makes updates difficult.

(FWIW I like Quicklisp as it handles all of this for us and I think SC should be compatible with it, but I know @mdedwards https://github.com/mdedwards has his reservations.)

What if instead of including, the call to load the library, we implement a method that clones it from the git repo? (If it exists then it performs a pull request instead). One could probably use uiop:run-program https://github.com/fare/asdf/blob/11a691c03eba55b718a154b673a7b77eb63eb244/uiop/run-program.lisp#L486 https://github.com/fare/asdf/blob/11a691c03eba55b718a154b673a7b77eb63eb244/uiop/run-program.lisp#L486 I haven't actually run the code and I don't mean to dump on your work, @Leon-Focker https://github.com/Leon-Focker, apologies. I'm sure its great!

— Reply to this email directly, view it on GitHub https://github.com/mdedwards/slippery-chicken/pull/66#issuecomment-1543520619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3IOIU4JDNUQ2BM7T6T76DXFSL4NANCNFSM6AAAAAAX5MB5DQ. You are receiving this because you were mentioned.

Leon-Focker commented 1 year ago

Hey Dan, I understand not wanting to include the source code for ppcre in SC. I will look into your solution. I'm just now thinking that SC would then depend on git being installed (which is not the case currently, is it?). Also would it work just as easy on Windows? Making quicklisp and my additions optional would probably be easier to implement but I'm not sure I like that... Best, Leon

danieljamesross commented 1 year ago

uiop:run-program is not in sc, it is included in most (all?) common lisp distributions. In this use case you would use it to call a shell function, something like this:

(uiop:run-program "git clone <INSERT_REPO_URL>")

You would also then handle errors in case of failed clone or git not being installed by printing something useful and friendly.

Leon-Focker commented 1 year ago

Ah okay thanks. I'll see what I can do with that!

mdedwards commented 1 year ago

btw slippery chicken has the system function to run shell commands

On 11. May 2023, at 15:37, Dan @.***> wrote:

uiop:run-program is not in sc, it is included in most (all?) common lisp distributions. In this use case you would use it to call a shell function, something like this:

(uiop:run-program "git clone ") You would also then handle errors in case of failed clone or git not being installed by printing something useful and friendly.

— Reply to this email directly, view it on GitHub https://github.com/mdedwards/slippery-chicken/pull/66#issuecomment-1544022313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3IOIUE6SQN3PLPULM4TLTXFTTP5ANCNFSM6AAAAAAX5MB5DQ. You are receiving this because you were mentioned.

rubenphilipp commented 1 year ago

Hey all, first of all, @Leon-Focker, thanks a lot for this very useful addition (which we already discussed over lunch a few days ago). I can completely understand the "reservations" of Michael's and Dan's, especially as I appreciate clearness of sc's dependency policy. Dan's solution, for this case, also appears appropriate to me. As I am currently working on a piece employing several spatialization techniques using New Audio Technology's Spatial Audio Designer, I could imagine (just a thought -- maybe Michael already has his hands on this…) to write some SAD-related methods/functions upon Leon's code. Best Ruben

mdedwards commented 1 year ago

Anyone who wants to extend SC with Spatial Audio code is more than welcome! I would just suggest though, that until we have a reaper-play method, this all remains a little far-removed from SC in general. Anyone up for writing that method? Best, Michael

On 11 May 2023, at 22:53, Ruben Philipp @.***> wrote:

Hey all, first of all, @Leon-Focker https://github.com/Leon-Focker, thanks a lot for this very useful addition (which we already discussed over lunch a few days ago). I can completely understand the "reservations" of Michael's and Dan's, especially as I appreciate clearness of sc's dependency policy. Dan's solution, for this case, also appears appropriate to me. As I am currently working on a piece employing several spatialization techniques using New Audio Technology's Spatial Audio Designer, thus, I could imagine (just a thought -- maybe Michael already has his hands on this…) to build some SAD-related methods/functions upon Leon's code. Best Ruben

— Reply to this email directly, view it on GitHub https://github.com/mdedwards/slippery-chicken/pull/66#issuecomment-1544663856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3IOIW7IHCTYDFNTHS5GT3XFVGU5ANCNFSM6AAAAAAX5MB5DQ. You are receiving this because you were mentioned.

rubenphilipp commented 1 year ago

That sound reasonable. Let's talk about "reaper-play" on Monday.

Best Ruben

Leon-Focker commented 1 year ago

Hey all, I implemented the changes we discussed for the initial pull request and also added a lot more.

PPCRE is now loaded via git and the function #'import-ppcre which I defined in utilities (because I used the #'shell function). Maybe it could be placed somewhere else but for me it works there and does its job.

The txt files that were previously in the /src/ directory are moved into /src/txt/

Also there is now two methods instead of write-spatial-reaper-file:

As for reaper-play: I haven't actually tried it but if you wanted to integrate all of this into a make-slippery-chicken call, you could probably call (clm-play) and then spatialize the generated .wav files using (write-reaper-...-file ), which then does the same thing but maybe isn't quite as nice as a dedicated function...

I'm excited to hear your thoughts on all of this. Best, Leon

Leon-Focker commented 12 months ago

Hey all, I finally completed this - at least from my point of view. Obviously this is not integrated with reaper-play yet. But I think that should be its own project / another PR. For me, all the tests are good and both Ambisonics and SAD export work as expected. However I only tried it on my system, yet. Please let me know how it is working for all of you. Looking forward to finally merging ;)

Leon-Focker commented 11 months ago

Just to be thorough and mention it here as well: There was a bug with #'import-ppcre. I fixed it directly on the master branch. Hopefully slippery chicken does not crash anymore while loading - only ignore ppcre.