rock-hopper / shuriken

Shuriken Beat Slicer
GNU General Public License v2.0
107 stars 6 forks source link

Feature Request / Question: Porting Shuriken to Windows 7 #24

Open bitshark opened 6 years ago

bitshark commented 6 years ago

First, to @rock-hopper , you did an amazing job with shuriken. It's my favorite beat slicer and I've tried dozens and dozens of them. Currently I use Shuriken, Ocenaudio, and Ableton, and that's all I need in terms of the computer.

Anyway I'd love to see a port of Shuriken to Windows 7 and later, and I think I'm going to take a stab at it myself. Has anyone considered this or tried this? I think it would be possible using something like MSYS2 w/ Mingw64. http://www.msys2.org/

Have there been any ports of Shuriken to OSes other than Linux? What would be the steps to get this to compile on Windows (would it be better to try to build natively or to cross compile?) Also out of curiousity what sound library would Shuriken need to use on Windows to communicate with the output sound device?

From what I gather, it seems that Shuriken outputs to ALSA right? If this is true, it seems that the ALSA (and perhaps JACK) part of the code is really the only part that would not be fully portable (since it's linux-specific). I checked and it looks like most of the other libraries used are highly portable (nice work!)

Would I need to replace the ALSA and linux-specific audio-output code with something cross-platform like PortAudio? I was looking at PortAudio and it seems pretty good, I noticed it has some cross-platform ASIO support , which would be awesome.

http://portaudio.com/docs/v19-doxydocs/compile_windows_asio_msvc.html

Thanks

rock-hopper commented 6 years ago

Glad you're enjoying Shuriken!

I'm not aware of any ports to other operating systems and I've never attempted to port Shuriken myself so I'm afraid I can't give you much guidance.

It should be possible to port Shuriken to Windows, though there might be a few snags. I had to make some modifications to the JUCE library in order to implement JACK MIDI. Whether these changes will cause compilation to fail on Windows I don't know. I also suspect that there's some incomplete platform-specific sections of code within Shuriken.

There shouldn't be any need to strip out the ALSA-related code as this is taken care of by #ifdef preprocessor directives. There may be compilation flags which need to be set in the qmake project file for Windows and OSX.

My time is quite limited but let me know if you need me to make any changes to the source code to allow Shuriken to compile on Windows.

Best of luck!

bitshark commented 6 years ago

Making some progress Shuriken on Win7 Build

Hey @rock-hopper , glad to hear back from you... I've made some solid progress on getting Shuriken (and all it's dependencies) to compile on Windows. The codebase is great btw, impressive work. Anyway, I'm hoping to have the Win7 port running in a few weeks at the latest.

Static Compilation

The main task so far has been to attempt to organize and compile all the Shuriken dependency libs on win7, in order that I can be sure I generate all of the .lib and .a files (not just the .dlls or .so) . I'm hoping this will let me static link most of the application to avoid major linker headaches, and so we can put up a self-contained exe / installer for Windows.

Open Questions: Shuriken Lib Dependencies

I want to determine a number of different things, and I'm hoping you could help by answering anything here that you might know off-the-top of our head.

Open Questions: Shuriken Audio & Midi Flow

Here's a few more questions on a related topic...

Shuriken Dependency Table

Anyway, thanks for reading. I've enclosed a table below that I built out to try to to understand the dependencies of the project, and I figured it might be useful to you or others.

name type flag win7 compat desc win7 compile notes
Shuriken Main main src cmake partial The main codebase for Shuriken that relies on the libraries characterized below The main codebase contains vendored versions of both Juce and Sndlib.
JuceLibraryCode vendored lib inline, included from Shuriken.pro Vendored Juce Library source provided in the Shuriken github codebase
Sndlib for Shuriken vendored lib -lsndlib_shuriken part of shuriken source code
Lib Aubio 3rd-party lib -laubio DSP (onset, beat detection, etc)
Lib Rubberband 3rd-party lib -lrubberband Audio Time-Stretching not attempted yet
Lib X11R6 unknown (Qt5)? -L/usr/X11R6/lib ? X11 Window Libraries unknown, probably handled by Qt5
Lib X11R6 unknown (Qt5)? -lX11 ? X11 Window Libraries unknown, probably handled by Qt5
Lib Alsa Linux HW Lib -lasound X Linux ALSA lib. Will not work on Win7.
Dynamic Linker Glibc Lib -ldl X linux dynamic linking library
Pthreads Posix Lib -lpthread ? posix implementation installed mingw pthread packages
Realtime Extensions Posix Lib -lrt ? POSIX.1b Realtime Extensions (bionic?) Librt + libpthread = Bionic (Android GlibC replacement)
WAV file R/W 3rd-party lib -lsndfile allows read/write with sampled sound (1) present from Cmake build from shuriken source, (2) from libsndfile binary win7 pkg, and (3) also located on msys2 as well
Lib Sample Rate 3rd-party lib -lsamplerate allows sample rates to be converted (1) successfully compiled during Windows Jack compilation, as well as (2) in a msys2 binary lib package
POSIX Open Snd Ctrl 3rd-party lib -llo lightweight OSC posix sound implementation not attempted yet
Lib Jack 3rd-party lib -ljack JACK Auto and MIDI Library (1) present as .a and .dll files for CodeBlocks exec output, but (2) only .dll files supported for the Binary Jack distro
Lib AV 3rd-party lib -llibavcodec Required to build lib aubio Currently fully compiled and working
FFTW3 3rd-party lib -lfftw3 Required to build lib aubio Currently fully compiled and working
rock-hopper commented 6 years ago

I agree that static linking is the way to go.

The libraries which Shuriken definitely needs are: aubio, rubberband, libsndfile, libsamplerate, JUCE, and of course Qt. As far as I'm aware, all of these libraries are cross-platform and don't require additional patches.

aubio has no required dependencies, though I'd strongly recommend building it against FFTW. Shuriken calls libsndfile and libsamplerate directly so I believe these can be omitted from aubio's dependencies, as can the JACK dependency.

Whether aubio should be linked against libav will require some testing on my part. aubio has a function which calls libsndfile/libav to open an audio file. Although convenient, I stopped using this function because it had a bug: it would stop reading before reaching the end of an audio file. If this bug has been fixed then I will update Shuriken to make use of the function again; if not, there's no point in linking libav.

liblo is Linux-specific. It is only required to implement support for Non Session Manager. I should be able to add some #ifdef directives in the code to remove this dependency on Windows.

The customised sndlib library may compile on Windows, though it's non-essential and shouldn't be too difficult to remove with some #ifdef directives.

The ALSA and JACK libraries can safely be omitted. Even though JACK can run on Windows, the JUCE library only supports JACK on Linux.

As for the other libraries, I suspect that they're Linux-specific but I don't know for sure. There will likely be an element of trial and error here.

All audio and MIDI input/output is handled by JUCE (4.3.0). I don't have a patch file (perhaps I ought to) but if you look in the README.txt file in the JUCE folder I've listed the modified files and included the originals so you can perform a diff to see the changes.

Hopefully that answers most of your questions!

Also, I found a good YouTube video which shows how to install Qt Creator + MinGW on Windows: https://www.youtube.com/watch?v=LdSTgR0xJco

daslicht commented 4 years ago

anyone ever made it ?

macramole commented 4 years ago

+1 i use linux but my students use mainly windows and mac. i couldn't find an alternative to this in those OS.