Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Avoid re-inventing the wheel #4

Open
Yuleblinker opened this issue Apr 28, 2017 · 23 comments
Open

TODO: Avoid re-inventing the wheel #4

Yuleblinker opened this issue Apr 28, 2017 · 23 comments

Comments

@Yuleblinker
Copy link
Member

Yuleblinker commented Apr 28, 2017

There are already a good number of resources/projects that could be useful as a starting point. Making use of existing code bases would save a good deal of time.
For reading and parsing MIDI files there are many existing and mature code libraries that could be used as a basis for this project. For example here are a few:

Python
py-midi 1.2.2 https://pypi.python.org/pypi/py-midi/1.2.2
Mido - MIDI Objects for Python https://mido.readthedocs.io/en/latest/
python-midi https://github.com/vishnubob/python-midi
music21 http://web.mit.edu/music21/
Javascirpt
MIDI.js https://galactic.ink/midi-js/

And something that almost is exactly what we are after:
Falcon MIDI to music box punch card converter https://github.com/Tenchi2xh/Falcon
This allows output to 15, 20 and 30 not music box strips. It currently outputs pixel-based formats but support for vector or DXF formats could easily be added

In terms of what could be created there is already a web based application that allows the import of MIDI files, transposing, selecting music box device and output. It can be found here:
Musicboxmaniacs
https://musicboxmaniacs.com/create/

A web-based solution would definately allow the greatest access to the application and would also negate cross-platform issues.

@JonesyLeo
Copy link

JonesyLeo commented Apr 28, 2017

I'm a C# passionate, and I link also this: https://github.com/stephentoub/MidiSharp
(but the web-based solution would be the best idea.)

EDIT:
Talking about web, I develop in PHP, and I found this:
https://github.com/tmont/midiparser

It seems very cool and useful.

Looking for something to export in vectorial graphic from PHP, maybe we can check this:
https://github.com/PhenX/php-svg-lib

@ChemiCalChems
Copy link
Member

Then I'll stop making a MIDI parser myself. I was having fun, but it's not needed.

@Yuleblinker
Copy link
Member Author

The PHP resources look good but relying on PHP to do the parsing and processing would put the load on the server. And whilst we're probably not talking about a hugh amount of traffic it may still affect performance. If a web-based option is to be considered I'd suggest passing on all of the processing to the end user and have it done whitin their browser i.e. using Javascript

A Javascript approach would also open it up to many more people to use/amend/hack any code as there is no reliance on having access to a server. A Javascript approach would also mean the user could play the MIDI track directly within the browser to validate/check it and possibly even create/edit it without needing other software - along the lines of the Musicboxmaniacs tool: https://musicboxmaniacs.com/create/

@DrSkunk
Copy link
Member

DrSkunk commented Apr 28, 2017

An in-browser solution is easier to host, it can even be hosted on this repository using GitHub pages.

@ChemiCalChems
Copy link
Member

So JavaScript it is? I think it's a good idea.

@ianespana
Copy link
Contributor

I already made something for it: https://github.com/ianespana/Wintergatan-Laser-MIDI

It's in C#, but if we were to make a website I think we could integrate it there

@JonesyLeo
Copy link

@ianespana , Excellent!! (I also like C# ❤️ )
The project will probably be JS-based but your program is cool!
We have a good start point, a good ispiration!
Ok, different libraries, different languages... but a good ispiration!

@ianespana
Copy link
Contributor

@JonesyLeo To be honest we don't need a library for this. It's really easy to interpret MIDI, specially since we only have to worry about note on commands, their pitch, and the absolute time they are played on. Delta time is useless, as well as all the other attributes

@JonesyLeo
Copy link

@ianespana Cool, a cleaner work!

@emosenkis
Copy link
Contributor

So... why not just use https://musicboxmaniacs.com/create/? It seems to already do everything. Converting the PDF into another format if necessary is trivial and I bet the creators of that site would be happy to add another format for laser cutters.

@emosenkis
Copy link
Contributor

I emailed the site's creators and asked if they would add a laser cutter-friendly format

@ChemiCalChems
Copy link
Member

Then, what's really the point on having this project? Just saying. I'd rather actually do it for ourselves.

@rzinurov
Copy link

rzinurov commented Apr 28, 2017

Hi everybody. I'm the creator of http://musicboxmaniacs.com and a big fan of Wintergatan. Supporting laser cutting friendly formats has been in my todo list for a long time, but this effort makes me consider this to be the top priority (big thanks to @emosenkis for writing to me). I'm open for collaboration and will be happy to use a third-party library (my backend is running on python) or integrate my website with a REST API for that.

@DrSkunk
Copy link
Member

DrSkunk commented Apr 28, 2017

Hey @rzinurov , you can join the discussion on gitter: https://gitter.im/Wintergatan/Midi-to-laser-cutter

@DrSkunk
Copy link
Member

DrSkunk commented Sep 24, 2018

Hey @rzinurov
After reviewing some code I think it's interesting to integrate the project with your website.
How I see it is that you can press a share button that opens up this project with the music notes filled in.

Are you still interested in collaborating?

@DrSkunk DrSkunk reopened this Sep 24, 2018
@rzinurov
Copy link

Hi @whitebird. It's been a long time and I ended up developing my own DXF export. And even though your idea sounds interesting, I don't think I will have time for this in the next couple of months.

screen shot 2018-09-24 at 10 10 21

@DrSkunk
Copy link
Member

DrSkunk commented Sep 24, 2018

Hey @rzinurov,

Your exporting options look very clean, i'm really impressed by the PDF that's generated.
There's no hurry to it. It may be possible that we provide a generic API that you can call to generate the export.

The reason why I thought again about the collaboration is that your editor is very refined and robust already.

One thing of importance to me is that as much as possible is generated client-side on our side. The extra challenge in that is so that it remains portable to other platforms and usable around the world, either offline or online.

@rzinurov
Copy link

Hey @whitebird. Thanks, I'm glad that you like my export implementation. Unfortunately, a pretty big amount of the editor logic is done on the backend side, so it's not really possible to use it offline. If you need a similar editor, I think it will be easier to build it from scratch, rather then reusing my code. It was built 4 years ago in angular and frankly I had no idea what I was doing 😬

@DrSkunk
Copy link
Member

DrSkunk commented Sep 26, 2018

and frankly I had no idea what I was doing 😬

Oh, so it's not just me, hahaha

Do you have an interface that solely exports the note data? As in Note 1 is an A at 1 sec, or something like that? Or MIDI?

@rzinurov
Copy link

Do you have an interface that solely exports the note data? As in Note 1 is an A at 1 sec, or something like that? Or MIDI?

No, not really. I use custom JSON format to send melody data between client and server. It is based on bar number indexing, the notes are quantized to the grid, which sometimes causes problems with rhythm when importing MIDI files. MIDI, MP3 and other files are generated from this internal format.

@DrSkunk
Copy link
Member

DrSkunk commented Sep 26, 2018

Interesting, maybe I can adopt your custom JSON format so you won't have to do much work.

@rzinurov
Copy link

I don't think you should, really. The format is not great and in fact at some point I considered to deprecate it and switch to a better one, but I did not get to it.

@DrSkunk
Copy link
Member

DrSkunk commented Sep 26, 2018

Currently I'm using the format generated by MidiConvert: https://github.com/Tonejs/MidiConvert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants