Wintergatan / Midi-to-laser-cutter

https://wintergatan.github.io/Midi-to-laser-cutter/
MIT License
126 stars 16 forks source link

Hosting the project #22

Closed Pierstoval closed 7 years ago

Pierstoval commented 7 years ago

For now, the project is hosted on Github websites, but I had an issue today:

I tested the app on my Chrome browser today with a .mid file, and my browser crashed for lack of memory 😕

I think the file processing should be handled server-side, and it's a chance: it's already written in Javascript, and Heroku can host Node.js projects for free as long as it doesn't need a lot of server resources 😉

If you need help with this, I can contribute

What do you think?

/cc @whitebird @Wintergatan2000

Yuleblinker commented 7 years ago

@Pierstoval The reason your browser crashed is due to a known issue with the midi-parser.js library.

A conscious decision was made early in the project to create an app that does not require a server and that could run entirely locally on the user's computer. This enables the most flexibility for those who wish to use and modify the application.

Pierstoval commented 7 years ago

Making the app with node.js & hosting it on Heroku doesn't mean the end-user cannot use the app on his own computer.

On each Github release, we can easily create a deploy script that would send a ZIP file on this Github release that contains everything needed for the end-user to run the application.

A simple documentation is enough to explain how to install the project: download the ready-to-use file depending on your platform (we could create a zip for windows and another for linux/mac that would have pre-installed modules), install nodejs, run a simple executable or script that would run the server and open a browser.

I understand the wish to give users the right to download & modify the application, but this would be better if application updates could be made directly on github so every user could benefit from contributions. And users will never have to update the app either. Just an internet connection would be enough.

Yuleblinker commented 7 years ago

@Pierstoval I don't know what the other contributers thoughts are on this but I would like an app that consists of a single HTML document and linked Javascript files. That can be hosted, but importantly can also be run locally without internet connection or running server, and without the need for node.js or any other 'installable' components. All the user would need is a relatively modern browser.

My reasons for this is that I work in a number of schools and local authorities across Scotland where users are not able to install node.js, do not have the option of locally running servers and cannot download and run executables. (Why this is the case for these schools would take me a long time to explain but let's just summarise it as 'protective' and 'restrictive' network administration policies).

Casual users, and most of the schools I work with, would use the GitHub hosted application. However, to allow them to modify/create templates, add their own devices and allow students to learn from and modify the code, I would like them to be able to download a simple folder. This folder would contain the HTML, javascirpt, styles and pre-built templates. They can then use the application whilst connected to the internet or not, without need for any kind of executable or requirement for any kind of installation. They can also modify the application to suit their specific needs. I appreciate this means re-downloading the app to recieve any updates but this is minor inconvenience compared to not being able to run the app at all locally and having full control over how the application is configured.

Let me give you an example use-case. A Primary teacher who wants to use the app with children in the classroom. They only ever use 25 key MIDI keybords so the app 'editor' view should only ever show 25 slots that represent the actual keys available on the keyboards they use. They have 20 note music box mechanisms so the app should only include this 'device'. They use A3 paper. The app should only have an A3 'template'. The teacher makes very minor changes to the app code and gets exactly this.

I can only express here what I want the app to be and I appreciate this isn't what others may want. I like and use node.js often for personal projects. If I was writing this app for personal use only I'd have probably used python. I've tried to explain why I think we should go forward with plain client-side javascript with no need for servers, executables or anything that needs installing. The code I'm working on takes this into account. I don't know what the requirements for Lars-Kristian's version are. Feel free to contribute a node.js version too. As a group we will need at some point to decide on what represents the 'official' version and approach. Once decided we can all start contributing to the same code base rather than working on multiple versions. That's why conversations like this are important and the opinions of others from the group are also needed.

Pierstoval commented 7 years ago

I completely understand your specific needs, and I know what it is to work in a "protective" and "restrictive" network 😉

Then, if we want to host the project elsewhere and benefit from server-side processing, I guess the app will be more complex to handle, so we may try to find a solution for both systems to work: the base would be client-side, but there may be a server-side app using some of the client-side tools to process the file.

By the way, what is the issue with the midi-parser.js library? I couldn't debug the issue as my browser always crashes 😕

DrSkunk commented 7 years ago

I completely agree with Yuleblinker. It's a restriction we're setting for ourselves, but one of the goals of the project is the ease of use. I've had a request for offline use as well, which would not be possible with a back-end. Now it can be packaged into an offline website.

Yuleblinker commented 7 years ago

The issue with midi-parser.js seems to occur when attempting to load MIDI files with more than one channel. Using the debugger in Firefox It appears to get stuck on the readIntVLV: function, within the while loop. Function can be found at line 137 in midi-parser.js

I'm not sure what the 'benefits' of server-side processing are. If what we want the app to do can be done client-side then whey bother with a server at all? What do you see as the benefits of server-side processing?

DrSkunk commented 7 years ago

Since it's an issue in the library we'll not migrate to server-side solution. If wished, the application can be packaged into a standalone offline solution.

DrSkunk commented 6 years ago

Test