mwcm / pitcher

audio pitch-shifting & re-sampling utility, based on the EMU SP-1200
https://soundcloud.com/user-320158268/sets/pitcher-examples
MIT License
26 stars 6 forks source link

GUI Version? #2

Closed mattdrepo closed 1 year ago

mattdrepo commented 3 years ago

Any chance of wrapping this project into some gui driven apps? It would be great to drag some sliders to preview the results.

Great work!

mwcm commented 2 years ago

Hey, thank you for the kind words and the feature req!

I'd been thinking about a GUI using qt - I'll see what I can do, should be able to get something going over the weekend.

Updates to follow...

mattdrepo commented 2 years ago

That would be great! I have been talking to a few (lucky) friends who have the SP and it would be great to get into the ball park. Having a GUI version that could be used on a few platforms would open the gates to a lot more, less tech savvy. And I think the workflow for GUI stuff can be an example of where things can be speedier. It can be a pain having to type values, export, preview, rinse and repeat. So here's to that GUI version and you getting more exposure! Thanks for considering my input and here's to this being a great addition for lo-fi sounds in 2021!

Matt

mwcm commented 2 years ago

Hey Matt,

There's now a file included named pitcher_gui.py which can be run with python pitcher_gui.py There's also a release with an exe attached Can also generate your own exe with:

pyinstaller --onefile pitcher_gui.py

Might need to pip install pyintaller first though. So far the only supported options through GUI are:

Let me know if you use any of the other options often. The others that I use the most are quantize-bits, custom-time-stretch and skip-time-stretch. Those would be next on my list, I think.

mattdrepo commented 2 years ago

any chance of a mac .app ?

mwcm commented 2 years ago

yeah for sure, i'll try on my laptop

mwcm commented 2 years ago

Hey @mattdrepo going to call it for tonight, not having much luck turning it into a working .app

Have tried pyinstaller as well as py2app, they both created apps that generate zero byte mp3s

You can always run it with python pitcher-gui.py That command can also be wrapped in a .app using Automator on mac There's a short guide here

You might have more luck than me with py2app and pyinstaller. Let me know if you make any progress with them, would be interested in having an .app version with all the dependencies wrapped in.

UPDATE: On the release page I've uploaded a unix executable, which worked for me as well as a .app which didn't.

mattdrepo commented 2 years ago

Hey, lets try a few things app wise first as an idea: It may be that newer systems have frustrating security issues. My older systems (10.12 and below) normally don't. So we can test against 10.12 (if you build against sierra) and then we can work out if the newer systems baulk. Do your apps work on older macs? If so, throw the .apps this way and I'll test and see if they work or not. If they do, we know that, as Apple brings in tighter security protocols, we might have issues there. Then its a clue as to how to work around calling python. Could be that the python scripts need to be approved, then the app can call the script.

mwcm commented 2 years ago

Hey @mattdrepo

Looked into it a little while longer. There's a new version of the Mac Application (in the zip file) here https://github.com/mwcm/pitcher/releases/tag/0.0.1 It's inside the .zip folder bc I can't upload the app folder directly to github, makes me zip it.

This new version is working for me, but I had to hard code the path to my ffmpeg installation at /usr/local/bin/ffmpeg when it's not been detected otherwise. I'll have to improve this at some point, but It might work for you too - as long as your ffmpeg is at the same location.

If not, you can always download ffmpeg here and then just place it in the path /usr/local/bin/.

Anyways, let me know if it works for you! I was able to pitch and export both .wav's and .mp3's. If it's still broken please let me know where your ffmpeg lib is installed. Libav might work too if you have it.

mwcm commented 2 years ago

Here's a screenshot of the Mac Application file running w/ GUI Screen Shot 2021-08-13 at 5 34 20 PM

On Windows it launches with an additional console window (showing the logs) by default, i'd like to enable that on mac too so that it shows progress rather than just the spinner while converting.

Will upload a picture of it on windows too, will also add the images to the readme

mattdrepo commented 2 years ago

Hey man, that's great! Any chance you could build against 10.12 though? You'll realise that most Audio units worth their salt build against 10.10 10.11 and 10.12 - mainly due to the fact that there's a whole heap of stuff that literally gets dropped from the apple ecosystem often. If this could be built against Sierra as a minimum, then it can coexist on a system with 32 and 64 bit support. Later on Apple ditches this sadly. Great efforts so far. I think hardcoding the path to FFMPEG isn't so bad. FFMPEGX used to download them from within the app as an example.

mwcm commented 2 years ago

I'll see what I can do about building against 10.12, I can't roll back this laptop, but I have an older Macbook which I might be able to. I'd always planned to use this more as a pre-processing tool than as an AU. I see what you mean though, would be a nice benchmark to meet for compatibility and opens up some possibilities too.

It might be a little while before I can rollback and build against 10.12. If you're still on 10.12 you might have better luck trying yourself, the command I used is:

pyinstaller --windowed --collect-data librosa --onefile pitcher_gui_mac.py

If you're already upgraded too I may have to put it on the back burner for now until I can reset that laptop

mattdrepo commented 2 years ago

Just giving an example of compatibility. You might find a more varied user base having a 32 bit compatible system support. The audio units were more an example. I dont mind processing samples after I have constructed them as opposed to "live". I'll try the building command and get back to you though.

I literally cannot work on later macs simply due to how much hardware gets dropped. Check out how much hassle wine is for example on later machines. See how much legacy software gets dropped after 10.12 and so on. Keep up the good work though :).

mwcm commented 2 years ago

Thanks @mattdrepo , please do let me know how it goes :)

Oooohhh yea Catalina dropping 32x support in 10.15 would be an issue, completely forgot about that. I built a windows desktop for audio work 1.5y ago now, have been using it for music since then.

If your build doesn't work I'll see if I can backup and restore my old macbook at some point.

mattdrepo commented 2 years ago

Might have to drop trying this - sorry. I dont really want to install a heap of old homebrew for python3.x. I think I am digging bigger holes. I'll see about throwing this on some linux hardware and using it. I have to try and keep these machine as bloat free as possible and I think I'll end up with a LOT of my HDD taken up by homebrew. Shame theres not python 3.x binaries to install any more.

mattdrepo commented 2 years ago

Spoke too soon. Turns out that there's a python 3 package over at pythons website

mattdrepo commented 2 years ago

pyinstaller --windowed --collect-data librosa --onefile pitcher_gui_mac.py 85 INFO: PyInstaller: 4.5.1 85 INFO: Python: 3.9.6 108 INFO: Platform: macOS-10.12.6-x86_64-i386-64bit 111 INFO: wrote /Users/matt/Downloads/pitcher-0.0.1/pitcher_gui_mac.spec 117 INFO: UPX is not available. Traceback (most recent call last): File "", line 2, in ModuleNotFoundError: No module named 'librosa' Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/utils/hooks/init.py", line 381, in get_module_file_attribute attr = loader.get_filename(package) AttributeError: 'NoneType' object has no attribute 'get_filename'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller", line 8, in sys.exit(run()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/main.py", line 126, in run run_build(pyi_config, spec_file, vars(args)) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/main.py", line 65, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 815, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 762, in build exec(code, spec_namespace) File "/Users/matt/Downloads/pitcher-0.0.1/pitcher_gui_mac.spec", line 5, in datas += collect_data_files('librosa') File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/utils/hooks/init.py", line 774, in collect_data_files pkg_base, pkg_dir = get_package_paths(package) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/utils/hooks/init.py", line 545, in get_package_paths file_attr = get_module_file_attribute(package) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/utils/hooks/init.py", line 399, in get_module_file_attribute raise ImportError('Unable to load module attribute') from e ImportError: Unable to load module attribute

mattdrepo commented 2 years ago

getting librosa sorted

mattdrepo commented 2 years ago

matts-MacBook-Pro:pitcher-0.0.1 matt$ pyinstaller --windowed --collect-data librosa --onefile pitcher_gui_mac.py 91 INFO: PyInstaller: 4.5.1 91 INFO: Python: 3.9.6 115 INFO: Platform: macOS-10.12.6-x86_64-i386-64bit 117 INFO: wrote /Users/matt/Downloads/pitcher-0.0.1/pitcher_gui_mac.spec 123 INFO: UPX is not available. script '/Users/matt/Downloads/pitcher-0.0.1/pitcher_gui_mac.py' not found

UPX?

mattdrepo commented 2 years ago

struggling to build upx from source to use it against your python method. Think I'll leave it for now and see if you build against 10.12

mwcm commented 2 years ago

Ahhhhhhh yeah got it man, I'll see what I can do this weekend/next week. Have some time off so if it seems quick enough to back up/restore the old macbook I might do that

mattdrepo commented 2 years ago

Is their a binary build of UPX I can download and point to via the command line? That might help? Maybe link me to yours if you have built it? I don't know how dependent it is on the Operating System version, but happy to try. Still think that, long term, you ought to consider the older systems: When M1 Becomes the norm, having an Intel and Arm release will be cool. A LOT of stuff will be left in the dust, and I can see work flows moving into the future for sure. But I can't see me getting rid of my studio irrespective of migrating to M1X or whatever they will call it then. :)

mattdrepo commented 2 years ago

The solution is to install UCL via brew it seems then build the source

https://github.com/upx/upx/issues/22#issuecomment-262519045

however. I think because it's such a huge "checkout" from git, it just closes. Sadly. Do you have any ideas? Seems I am very close. Frustratingly!

matts-MacBook-Pro:~ matt$ brew install ucl ==> Tapping homebrew/cask Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'... remote: Enumerating objects: 586648, done. remote: Counting objects: 100% (34/34), done. remote: Compressing objects: 100% (27/27), done. error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed Error: Failure while executing; git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --origin=origin --template= exited with 128.

mattdrepo commented 2 years ago

Turns out my ISP blocks github, how helpful. Stay tuned.

mattdrepo commented 2 years ago

brew style --fix , has to be used to run brew in developer mode, and presumably updates brew (due to the older system). Now to wait till that has resolved... The things I do to run this old O.S :D

mattdrepo commented 2 years ago

Inspecting 1098 files ..................................................................................................................................................................................................................................................................................................................

mattdrepo commented 2 years ago

for anyone struggling to install UCL on 10.12 just run brew style --fix which will update the gem files. UCL is now installed, now to try UPX...

mattdrepo commented 2 years ago

matts-MacBook-Pro:src matt$ make Updating .depend clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] clang: error: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Werror,-Wignored-optimization-argument] make: Deleting file `.depend' make: No rule to make target .depend', needed byc_file.o'. Stop.

Looks like I might have to use an earlier version perhaps , due to compiler issues... Not sure.

mattdrepo commented 2 years ago

Installed gpgme, then i could install UPX. Getting somewhere - but still errors:

matts-MacBook-Pro:pitcher-0.0.1 matt$ pyinstaller --onefile pitcher_gui.py 260 INFO: PyInstaller: 4.5.1 260 INFO: Python: 3.9.6 273 INFO: Platform: macOS-10.12.6-x86_64-i386-64bit 274 INFO: wrote /Users/matt/Downloads/pitcher-0.0.1/pitcher_gui.spec 282 INFO: UPX is available. 284 INFO: Extending PYTHONPATH with paths ['/Users/matt/Downloads/pitcher-0.0.1', '/Users/matt/Downloads/pitcher-0.0.1'] 591 INFO: checking Analysis 592 INFO: Building Analysis because Analysis-00.toc is non existent 592 INFO: Initializing module dependency graph... 596 INFO: Caching module graph hooks... 620 INFO: Analyzing base_library.zip ... 4975 INFO: Processing pre-find module path hook distutils from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'. 4979 INFO: distutils: retargeting to non-venv dir '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9' 10357 INFO: Caching module dependency graph... 10654 INFO: running Analysis Analysis-00.toc 10673 INFO: Analyzing /Users/matt/Downloads/pitcher-0.0.1/pitcher_gui.py 12232 INFO: Processing pre-find module path hook site from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'. 12233 INFO: site: retargeting to fake-dir '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/fake-modules' 23559 INFO: Processing pre-safe import module hook win32com from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'. 29410 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'. 42830 INFO: Processing module hooks... 42830 INFO: Loading module hook 'hook-appdirs.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 42838 INFO: Loading module hook 'hook-certifi.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 42844 INFO: Loading module hook 'hook-llvmlite.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 42850 INFO: Loading module hook 'hook-numba.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 42891 INFO: Loading module hook 'hook-pycparser.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 42893 INFO: Loading module hook 'hook-resampy.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 42901 INFO: Loading module hook 'hook-sklearn.cluster.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 45695 INFO: Loading module hook 'hook-sklearn.linear_model.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 47780 INFO: Loading module hook 'hook-sklearn.metrics.cluster.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 47784 WARNING: Hidden import "sklearn.utils.lgamma" not found! 47784 WARNING: Hidden import "sklearn.utils.weight_vector" not found! 47784 INFO: Loading module hook 'hook-sklearn.neighbors.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 49972 INFO: Loading module hook 'hook-sklearn.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 50437 INFO: Loading module hook 'hook-sklearn.tree.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 50441 INFO: Loading module hook 'hook-sklearn.utils.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 50443 INFO: Loading module hook 'hook-soundfile.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'... 50444 INFO: Loading module hook 'hook-_tkinter.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 50681 INFO: checking Tree 50682 INFO: Building Tree because Tree-00.toc is non existent 50682 INFO: Building Tree Tree-00.toc 50717 INFO: checking Tree 50717 INFO: Building Tree because Tree-01.toc is non existent 50718 INFO: Building Tree Tree-01.toc 50824 INFO: checking Tree 50824 INFO: Building Tree because Tree-02.toc is non existent 50824 INFO: Building Tree Tree-02.toc 50830 INFO: Loading module hook 'hook-difflib.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 50851 INFO: Loading module hook 'hook-distutils.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 50872 INFO: Loading module hook 'hook-distutils.util.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 50881 INFO: Loading module hook 'hook-encodings.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 50996 INFO: Loading module hook 'hook-heapq.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51019 INFO: Loading module hook 'hook-lib2to3.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51091 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51099 INFO: Loading module hook 'hook-numpy._pytesttester.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51106 INFO: Loading module hook 'hook-numpy.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51212 INFO: Import to be excluded not found: 'f2py' 51259 INFO: Loading module hook 'hook-packaging.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51261 INFO: Loading module hook 'hook-pickle.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 51269 INFO: Loading module hook 'hook-pkg_resources.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52153 WARNING: Hidden import "pkg_resources.py2_warn" not found! 52643 WARNING: Hidden import "pkg_resources.markers" not found! 52651 INFO: Loading module hook 'hook-scipy.linalg.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52653 INFO: Loading module hook 'hook-scipy.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52655 INFO: Loading module hook 'hook-scipy.sparse.csgraph.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52659 INFO: Loading module hook 'hook-scipy.spatial.transform.rotation.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52720 INFO: Loading module hook 'hook-scipy.special._ellip_harm_2.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52722 INFO: Loading module hook 'hook-scipy.special._ufuncs.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52724 INFO: Loading module hook 'hook-scipy.stats._stats.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 52726 INFO: Loading module hook 'hook-setuptools.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 53669 INFO: Loading module hook 'hook-sysconfig.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 53670 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 53671 INFO: Loading module hook 'hook-xml.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 53767 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks'... 53912 INFO: Looking for ctypes DLLs 54369 INFO: Analyzing run-time hooks ... 54392 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py' 54399 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py' 54405 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py' 54408 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py' 54417 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_certifi.py' 54420 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rthtkinter.py' 54476 INFO: Looking for dynamic libraries 55675 INFO: Looking for eggs 55675 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.9/Python 55712 INFO: Warnings written to /Users/matt/Downloads/pitcher-0.0.1/build/pitcher_gui/warn-pitcher_gui.txt 55993 INFO: Graph cross-reference written to /Users/matt/Downloads/pitcher-0.0.1/build/pitcher_gui/xref-pitcher_gui.html 56148 INFO: checking PYZ 56148 INFO: Building PYZ because PYZ-00.toc is non existent 56148 INFO: Building PYZ (ZlibArchive) /Users/matt/Downloads/pitcher-0.0.1/build/pitcher_gui/PYZ-00.pyz 59143 INFO: Building PYZ (ZlibArchive) /Users/matt/Downloads/pitcher-0.0.1/build/pitcher_gui/PYZ-00.pyz completed successfully. 59234 INFO: EXE target arch: x86_64 59234 INFO: Code signing identity: None 59236 INFO: checking PKG 59236 INFO: Building PKG because PKG-00.toc is non existent 59236 INFO: Building PKG (CArchive) PKG-00.pkg 60105 WARNING: codesign command (['codesign', '-s', '-', '--force', '--all-architectures', '--timestamp', '/Users/matt/Library/Application Support/pyinstaller/bincache00_py39_64bit/x86_64/adhoc/no-entitlements/lib-dynload/_struct.cpython-39-darwin.so']) failed with error code 1! stdout: '' stderr: '/Users/matt/Library/Application Support/pyinstaller/bincache00_py39_64bit/x86_64/adhoc/no-entitlements/lib-dynload/_struct.cpython-39-darwin.so: invalid or unsupported format for signature\n' Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/bin/pyinstaller", line 8, in sys.exit(run()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/main.py", line 126, in run run_build(pyi_config, spec_file, **vars(args)) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/main__.py", line 65, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 815, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 762, in build exec(code, spec_namespace) File "/Users/matt/Downloads/pitcher-0.0.1/pitcher_gui.spec", line 23, in exe = EXE(pyz, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/api.py", line 509, in init self.pkg = PKG(self.toc, cdict=kwargs.get('cdict', None), File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/api.py", line 208, in init self.postinit() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/datastruct.py", line 159, in postinit self.assemble() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/api.py", line 274, in assemble fnm = checkCache(fnm, strip=self.strip_binaries, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/building/utils.py", line 391, in checkCache osxutils.sign_binary(cachedfile, codesign_identity, entitlements_file) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PyInstaller/utils/osx.py", line 383, in sign_binary raise SystemError("codesign failure!") SystemError: codesign failure!

Will continue to look for dependencies and fix!

mwcm commented 2 years ago

thanks for looking into it further! I started charging my old laptop, going to take a look and see if I can backup and restore will keep an eye on posts here, let me know if there's anything I can do to help

mattdrepo commented 2 years ago

Well this was as far as I could get. So if you can get a build for 10.12 I would be interested to know. Thanks for trying to help. :)

mwcm commented 2 years ago

it's restoring to 10.11, hope that's okay, i'll try a build soon image

mwcm commented 2 years ago

oof i need to clean that screen

mattdrepo commented 2 years ago

Look forward to hearing more! 10.11 may or may not work with 10.12, will let you know!

mwcm commented 2 years ago

hey @mattdrepo I've uploaded another zip file to the release, it's named pitcher_gui_1012.zip, it's a build from my old mac on 10.12

it's successfully pitched a wav file on 10.12 on my laptop, i downloaded it on my newer mac and it did the same there too

Screen Shot 2021-08-21 at 4 55 19 AM
mattdrepo commented 2 years ago

Works great! I have added it alongside my other tools.

Few Questions:

What are your thoughts regarding the filters?

You mentioned the terminal output being seen on the windows version. Do you have any idea why it might not on the Mac OS version?

Variables that are available on the script but not via the GUI, perhaps check boxes? Or via a .plist file?

I have to say that all these prior comments aren't digs at the code or your approach at all: I could see by your comments over on beatshelter, that you were aiming to create a workflow rather than another VST/AU plugin. I don't mind that at all: I use cheap hardware often to circumvent using "yet another plugin" or to save CPU resources, or just to keep my projects simplified (very easy to end up with a "stack" of plugins, and then later have to dig around to see where unwanted aliasing noise occurs etc etc). If you use other VST effects however in your DAW of choice - I'd suggest you post a Youtube video of your workflow using this app as it stands, and what you use later inside a DAW to achieve SP-Like sounds. I want your work to get seen :)

Thanks for doing this for earlier Mac systems. I know you have worked hard - the resulting file is 50mb which is pretty slim too! If I am not needed for testing the compilation - I'll free up the 4+GB of space now taken up by brew! :D

mwcm commented 2 years ago

Great! I'm glad it worked for you too.

  1. I think the filters are quite accurate, the anti aliasing input filter fit could be improved slightly, but I believe it's a negligible difference, likely not audible in the final product

  2. I'm not too sure about the terminal output and why it doesn't show by default on Mac, I'll try to figure that out today

  3. I'll see what I can do today to include the other variables in the GUI

  4. I kind of forget why I left the ring filter out. Can't remember if it was on purpose or I just didn't get to it. I'll look into this one today.

  5. Same answer as 1 wrt the high end input filter, I believe it's nearly identical already and might take longer than it's worth to perfect. I don't want to spend any more time on that one myself. I would be curious if anyone manages to perfectly match the original curve, though it might not audibly improve the final product's sound. It would be nice to match the specs exactly. I can post a photo of the difference sometime if you're interested.

  6. Thank you! That's exactly the intention: one less vst cluttering up the DAW, save resources, focus on workflow.

I like the idea of posting a Youtube video of my workflow, I might do that!

I don't use anything in DAW to get the "SP 1200 sound".

Occasionally I will use AudioThing's Reels or the RX950 by Inphonik, but for tape effect and S950 emulation respectively. So not the "SP 1200 sound" itself, but devices that would have been used alongside the SP1200 back in it's heyday.

My process for using pitcher is generally:

Ahahaha I'm glad I was able to save your mac from Brew, mine haven't been as lucky. 😂

Hope it's useful! Thank you for taking an interest in and using pitcher!

mattdrepo commented 2 years ago

Thanks for doing something plausible in python that the rest of us can use!

I am thinking that perhaps the Audacity script method could be used in your app then? Is it a .ny nyquist plugin or something that comes with Audacity as standard (haven't used Audacity much - used to use it a lot, but not for that purpose = mainly for "field" recordings where i needed to remove noise). Maybe alongside your slider another standard "pitch up" routine. Then you can let your script do the "dirty" (or you might double the effect undesirably).

I am also interested in the 8 outputs of the sp1200 and how they differ as well as the inputs:

"Channels 1 and 2 use SSM filers and their implementation is unique to the SP" "Channels 3-8 are discreet custom EMU low pass filters" "The sample input filter is also exactly as described in the service manual"

this was quickly ripped from the dxarmy forum. I am also thinking that doing this on system that works with 16/24/32 bit natively might have an effect. So perhaps lowering the dynamic range of the sample afterwards (i remember googling a while back about trying to lower bit rates in modern DAWs/Samplers and being presented with the whole - bits = dynamic range debate on an Audacity forum - to bring the sound closer to the noise floor...?).

This is all speculation of course and I could be giving total nonsense feedback. But I have experimented with different means to get the artefacts I want sonically from various tools along the way. I think I got pretty close with "soliton" which was lauded for it back in the day and a 32 bit vst "bit crusher" called "CMT-BitCrusher" - there was a comparisson against some SP1200 samples and the CMT-BitCrusher - the issues being that the "highs" in the sample were still present (in the crushed version). Now I know more about the outputs - it could of been the choice of output port used on the sp1200 - as many decide on what suits their drum hits and samples and route them to the desired port on a real machine. Hence discussing the filters again.

To leave my workflow here. I will be attempting to use "soliton" on a "clean" but pitched up sample done in Audacity. Mainly to make it "8-bit" via the menu, But I Imagine that could be done in Audacity by lowering the dynamic range. Then fed into your script and pitched down. Then if it sounds too clean - back through soliton again, to lower the dynamic range by chosing 8-bit again.

I think to get thump from the sample I will probably then emulate tape and desks. Using analogue obsession and chowtape. in that order (picking a SSL effect).

I am interested in what you use in your DAW when you have processed your samples. :)

mwcm commented 2 years ago

I like the idea of a dedicated pitch to 45rpm option, I'll add that as a todo.

So the 8 outputs & the filters... this is from the SP-1200 manual: "Channels 1 and 2 have dynamic filters whose bandwidth varies in time, channels 3, 4, 5, and 6 are filtered by a constant amount, and channels 7 and 8 are totally unfiltered"

So currently the behaviour matches outputs 7 & 8.

I think adding 1,2 and 3 through 6 will help get the "thump" you're looking for. Especially if we make them adjustable like this SP-12 Turbo mod https://www.youtube.com/watch?v=4kmd2nloi-Y

What you said about CMT-BitCrusher: "...the issues being that the 'highs' in the sample were still present (in the crushed version)."

Got me thinking... The highs and the artifacts present in that range are a big part of the effect I was hoping to create, which is partly why I'd left out the final output filters. The pitching algorithm was the focus for me, I was happy with the approximation and didn't go much further past that.

I'll take a shot at adding the different output filters though, I can see how they're important now.

mwcm commented 2 years ago

Oh and I'm going to check out those plugins!

mattdrepo commented 2 years ago

Yes perhaps a "change speed" button to not confuse with pitch. And have a 45 or 33 option. With the default being 33. So as to be very easy and clear.

The soliton program is a 32 bit windows exe. I seriously went quite mad. I am still pursuing 8-bit soundcards and how to make them cheap :). So maybe you have the right madman to converse with here :)

mattdrepo commented 2 years ago

I think the workflow has to be much more considered now to use this. Samples should be reduced to 22.5 khz or whatever the sample rate was, bit depth lowered to the noise floor of 8 bit, samples then upped to 45 rpm (or whatever the semitones) to get close to the recording input. Then your slider to lower them. Forcing more chances of aliasing.

:)

Maybe some of this could be done with your python script to save using sox and audacity. If you want to get more anal, you could then work out the frequencies of vinyl, and add line noise, electrical noise etc. But I think that could be done in a vinyl simulator. I do think that the SP 12 and 1200 users I spoke to (many!) would say that the natural compression of vinyl was what made the SP shine. Or you could end up with newbies hating on the workflow because their sounds are too clean to start with!

mwcm commented 2 years ago

Those first steps of converting to 22.5sr & 8 bit depth sound like they do make a bit of a difference.

Here's an example of a song pitched down 3 steps through pitcher:

The files do sound quite different before going into pitcher, but coming out the other side the waveforms look very similar. There are differences though, they're obviously on much different scales, but very similar shapes.

without steps with steps

They sounded very similar to my ear, though I'm listening on mediocre speakers rn. I'd be interested what you think if you do similar tests. Github doesn't let me upload a wav here.

mwcm commented 2 years ago

Going to look into the VCF's in a couple hours, I'll see if I can get into a few of the other TODOs as well. Might take a few days to get the VCF's and static lowpass filters sounding accurate.

mattdrepo commented 2 years ago

Out of curiousity what were you displaying the waveforms in, what application? And can you not upload your wavs to the github here in the repo? Could put them in a folder perhaps? If you want to upload the wavs elsewhere then that's fine too.

Also perhaps plot these ideas in some sort of mind mapping software so you can plot the various stages out (helps you from going mad haha) and shows others the path from getting a sample sounding more like the SP + shows what external programs have to be used alongside the workflow of your app.

I have actually been re-visiting some things since this conversation and would prefer to not have to use 32 bit FL Studio and a load of old vsts. Nor would I want to use the Windows version and miss using my Mac system. So I am interested in getting more aliasing and desired effects from something like your app. I just can't use it in my workflow totally at the moment as there's a lot of steps.

But I am keen to see how you progress the script and the GUI (which I think will be more important than you first think) previewing the end result helps a great deal too - but I respect that you aimed originally to make a scripted approach.

Thing is though, with it being early in development, I think having the gui reflect your stages of development will help it gain tracktion with those that wouldn't use a script and would use a GUI. So the RPM based pitch being added would be good.
I think having the option to lower bit depth and frequency too would help. But then you have the issue of the output file and how it is written to and how you would need to input the output for want of better words, to go to the next step.

Leads to the question of other scripts, other smaller apps perhaps. Or making it clear that it is an app to be used in conjunction with another workflow. I wonder if there's a blender equivalent to audacity - as you wrote this in python? :)

I could see you either writing a series of scripts in python like so:

vinyl.py - artefacts

vinyl-eq.py - rolling off frequencies to keep things "vinyl"

rpm.py - speeding up without using any sp-like effects (like the audacity method)

downsample.py - if we are pretending to be a sp, we would of recorded at 8-bit and 22.5 or whatever the sp's frequency was (i think sp's were 8 bit interpolated to 12 bit - this could be examined too)

pitcher.py - then your present script shows its magic.

filter.py - then you can optionally choose a filter here afterwards.

downsample.py -and maybe this has to be considered again with just a simple lowering of the noise floor, if at any time the system tries to default to 16 bit depth or 24. The brightness of most the sampling here is due to the frequencies the modern systems allow. does your pitcher program work in 8-bit depth or 16? or 24 when you do the math?

Anyway, late over here! Look forward to more from you :)

mwcm commented 2 years ago

This is really great feedback, thank you!

I like the idea of turning it into a bit of a toolchain.

Ahaha I know what you mean about the input/output if there are multiple steps. I like the idea of having multiple scripts all bundled in an easily usable gui.

Oooh duh you're probably right about putting them in the repo, I'll try that.

I used the pyhon libraries matplotlib and numpy for the plots.

As for the bitdepth, the script does simulate the SP 1200's A/D converter by quantizing w/ 12 bits by default. The script generally outputs a 32bit audio file, or 16 in the case that a non .wav/.mp3 type was specified. I've done that for compatibility and laziness, I think the audiofile library outputs 32 by default and the other library does 16 by default. I'm not sure that the higher export rate effects the final product audibly, might be worth testing though.

The script already also covers the sample rate change from the input file's sr to the SP-1200's sr of 26.04 kHz

I think most of the 1200's functionality is captured in the script - the notable exception being the VCF filter. I've just realized pitcher does apply the default LowPass filter though, more info below

mattdrepo commented 2 years ago

https://forum.audacityteam.org/viewtopic.php?t=36498

Maybe read about the 72db range with regards to adhering to 12 bit?

Best sleep! Look forward to more chats!

mwcm commented 2 years ago

I've added everything in this slide's graphic (not including the vcf, mentioned in text only): image

The output filter step it shows at the end represents either outputs 3&4 or outputs 5&6: image

This is the slide for the optional VCF filters (outputs 1 & 2) Which I haven't added yet image

Since 1&2, 3&4, 5&6, and 7&8 are pairs of identical outputs, pitcher will need 4 different output filtering options:

  1. simulated SSM2204 (4 pole VCF, TODO)
  2. low pass (pitcher's current default)
  3. low pass 2 (TODO)
  4. no final output filter step (pitcher's --skip-output-filter option)

Might also be nice to make them adjustable through params and then GUI.

mwcm commented 2 years ago

https://forum.audacityteam.org/viewtopic.php?t=36498

Maybe read about the 72db range with regards to adhering to 12 bit?

Best sleep! Look forward to more chats!

From that forum post

"What we are doing here is to drop the volume so that the waveform is within a 12 bit (72 dB) range, instead of a 16 bit (96 dB) range. Click "OK" (the waveform will go almost flat vertically). Now select the Amplify effect again, but this time just type 24 (plus twenty four) in the top text box and click OK. This will restore the amplitude to it's previous height, but with scaled values from the small waveform - that is, 12 bit values."

I believe that's very similar to what the 12 bit quantize algorithm achieves, difficult to explain through text haha 😅. Scaled 12 bit values, but exported in the 16/32bit format since actual 12 bit is seldom supported these days.

Likewise, take care!

mattdrepo commented 2 years ago

The next question then being - would it be better to do it at 8 bit? Because I hear that the SP is 8 bit interpolated to 12. so some magic is done perhaps? Just thoughts. As it think 8 bit samples put into it sound "better" objective though.

It would also be interesting to compare a sound source from vinyl over the exact same sound from CD or Lossless wav (near impossible to do sadly, as mastering techniques come into play, as well as copyright). Let alone SP12 and SP1200 owners.

Look forward to your next updates!

mwcm commented 2 years ago

As far as I know the SP aliasing can be partially approximated by linear interpolation, that's one of the methods I'm using. I don't think the machine converts to 8bit at any point, but if 8 bit audio is input it will quantize to 12. But thats the same for any type of audio which is input: 8, 16, 24, 32, etc...

I think that quantizing the audio at a lower bitrate of 8 should add to the artifacts,but it may be more than you'd like. You can use 8 quantize bits by specifying

--quantize-bits 8

Skipping output filtering will leave in more of the high end artifacts as well

--skip-output-filter

I'll add those options to the GUI so you can try it out

I think the resampling / interpolation, the ineffective lowpass filtering, the A / D conversion and the pitching algorithm are the main causes of the aliasing & artifacts.

Things which also factor into the process are the input file's medium, and bit rate.

I love the idea of comparing waveforms and values for output based on different input formats! I'm going to add that TODO, would be interesting and useful.