magenta / magenta-studio

Magenta Studio is a collection of music plugins built on Magenta’s open source tools and models
https://g.co/magenta/studio
Apache License 2.0
1.01k stars 152 forks source link

Linux support #13

Open zanieb opened 5 years ago

zanieb commented 5 years ago

Hi! I just found this project and am curious what the barriers are to building on linux?

Happy to help contribute to make this work.

Thanks! Michael

UnknownLocation commented 5 years ago

Also I don't understand why standalone version for Windows still isn't available.

adarob commented 5 years ago

Re: Linux, this should be easy but I haven't looked into it. @teropa did you have a look at this? Re: Windows, we have limited limited cycles right now, and we haven't prioritized it yet. I am looking into it this week, but there are some difficulties around dealing with DLLs etc. Also none if us use Windows so there is a learning curve :)

zanieb commented 5 years ago

So I actually just cloned the code and built on linux successfully.

The following was necessary:

  1. I had to install some dependencies manually
  2. I added linux to the output options and nameToPlatform in build.js
  3. I printed the temporary build directory since linux binaries are extensionless and not found by the regex, also I stopped the temp directory from being deleted so I could test the build

It looks like the app works too, I just opened a couple and then tested generate since I didn't need midi files to train it with.

adarob commented 5 years ago

@mikeza would you might contributing back changes you made to get this working?

zanieb commented 5 years ago

Yeah I'd be interested in working on this, let me figure out what's up with the dependency installation.

adarob commented 5 years ago

I just tried building for linux on my mac, and the resulting build seems to work on a linux machine. However, I am not sure how to package it with an installer since the executable seems to need to live in the same folder as all of the resources.

adarob commented 5 years ago

With #16, you should be able to build the standalones with npm run --output=linux-standalone. I'll leave this open until I have a chance to add actual packages.

zanieb commented 5 years ago

I just tried building for linux on my mac, and the resulting build seems to work on a linux machine. However, I am not sure how to package it with an installer since the executable seems to need to live in the same folder as all of the resources.

Maybe consider referring to https://github.com/electron-userland/electron-packager for best practice packaging the resources and executable (or could just use the project).

tank-trax commented 5 years ago

I have successfully built this in February on Debian Stretch following instructions that a member of the Facebook Linux Musicians posted, as follows:

  1. git clone https://github.com/tensorflow/magenta-studio
  2. follow the install instructions to get the npm node modules installed
  3. In ./electron/build.js add linux: 'linux'to the hash nameToPlatform and comment out
    windows : 'win32',
    macOS : 'darwin'
  4. in moveFiles, comment out the await fs.remove(buildDir)
  5. The temp build directory is in the /tmp/, and the electron apps for each working application is there separately.
bkmgit commented 4 years ago

Is it worth also making the Linux build downloadable, in addition to the sourcecode? Snap might be one way. Flatpak and Appimages are possible other ways.

han-so1omon commented 4 years ago

For me on Archlinux, the app does not function correctly and renders as a gray box. I built using yarn install && yarn build linux-standalone. I also had to manually install gconf dependency.

Sidenote: User flying-sheep comments on the AUR gconf package that gconf typically is no longer a dependency of Electron apps. Is that the case here as well?

tank-trax commented 1 year ago

@Joseppi83

I think you mean npm install --14

following your instructions the apps do build, execute and are functional, but they still produce the same errors as below and in https://github.com/magenta/magenta-studio/issues/46#

ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

image

tank-trax commented 1 year ago

@Joseppi83 ahhh had to close and reopen terminal it seems for nvm to execute

however

nvm install --14
grep: unrecognized option '--14'

Edit:

this worked

nvm install 14

tank-trax commented 1 year ago

@Joseppi83

the command example they use is

nvm install 12

tank-trax commented 1 year ago

@Joseppi83 I have a working copy using the older commit and have posted functional binaries in my fork... and yes for my purposes Magenta-Studio is the perfect percussionist

https://github.com/tank-trax/magenta-studio/releases/tag/v2.0.11

tank-trax commented 1 year ago

@Joseppi83 because I am always on the lookout for the newest version of any app I tried this but it failed again. as well the apps are not working after testing

my builds work... I have tested them thoroughly. If you want to build them yourself follow the steps below. They should work with the NPM you have set up.. am trying now just to make sure

git clone https://github.com/magenta/magenta-studio.git
cd magenta-studio
git checkout c76f20c
npm install
npm run build linux-standalone
tank-trax commented 1 year ago

sorry to hear that

have you tried my binaries? if they don't work your system may be missing deps

try any one of the executables with ldd

for example ldd Continue

you may want to try and clear out the folders like I did

~/.node-gyp/ ~/.npm/ ~/.electron/

I also cleared ~/.cache using bleachbit

I have successfully built these packages on Mint 20.3 and Debian 11 without a hitch by literally copy and pasting those five lines into a terminal and pressing Enter

and FYI successfully again with the NVM environment as per your suggestion

Joseppi83 commented 1 year ago

@tank-trax

Found out the problem. I was lacking python2. That was the only thing keeping me from successfully running the standalones. Oy! It's usually the smallest overlooked detail that gets me.

I really only wanted the drumify to see if it would create a cooler drum effect than I produced on LMMS. It was really impressive, but it didn't quite capture the feeling I wanted to convey.

In the end, I chose my drum creation.

But I will definitely use these standalones in the future! I'm constantly vomitting lyrics and acoustic guitar melodies and progressions. I can use these apps to stimulate and inspire the other components to the whole.