nfroidure / midifile

A MIDI file parser/writer using ArrayBuffers
http://karaoke.insertafter.com
MIT License
199 stars 30 forks source link

Add Audio engine to play notes #27

Closed surikov closed 6 years ago

surikov commented 6 years ago

Add WebAudioFont to play parsed notes. It has 2000 instruments. See example https://surikov.github.io/webaudiofont/examples/dynamic.html

nfroidure commented 6 years ago

Hi @surikov !

Looks like a nice project but I think it would be better to submit it in the https://github.com/nfroidure/MIDIPlayer project.

That said, I'm not sure what you are looking for. If you want some visibility for your project, I think best would be to make a PR on MIDIPlayer with a working example or a link to a working example of wiring MIDIPlayer into webaudiofont.

mk-pmb commented 6 years ago

No matter where it might be added, the "add" should be in form of a reference, not an import of lots of sound data. It's always a hassle trying to verify the license claim on sound font projects, if they even clain to be FOSS. (Like in this case, big :+1: for at least the claim. Whether that claim is legally effective in a specific region of the world is a universe of its own, unfortunately.)

Edit: I remember now, the sounds themselves were in webaudiofontdata and I was unable to acquire any free enough audio font.

It's a really great project technology-wise, and very sad that I cannot use it due to the legal uncertainties.

surikov commented 6 years ago

I was unable to acquire any free enough audio font.

You didn't read my answer. I posted links to license of used soundfonts.

mk-pmb commented 6 years ago

I read your answer and I read the licenses. However, we seem to have different interpretation of European law and thus, different opinions about its legal consequences.

surikov commented 6 years ago

read https://github.com/surikov/webaudiofont/blob/master/LICENSE.md Thousands of projects from Europe use this license.

mk-pmb commented 6 years ago

Since in-depth discussion of our legal views is not really about MIDIfile, let's take it back to the license thread in your repo.

Update: Discovered that the license link is about the non-data repo. I still can't see a way to use the project without the audio data. It's worth noting that when the WAF Readme says

Instruments came from free soundfonts:

the "free" is the one as in beer, not the free software movement's "free". For details, see the WAF data issue.

surikov commented 6 years ago

This is standard MIT license. Of Course you can't use this project if you can't use MIT license. Project uses free soundfonts from some Linux distributions. Many users from Europe uses Linux.

mk-pmb commented 6 years ago

The problem isn't with the MIT license itself. It's about whether people in Europe can obtain sound font files. One easy way to solve this would be if you can give us some free software that allows us to convert sf2 sound fonts into WAF sound fonts, on our own computers.

surikov commented 6 years ago

What is WAF sound fonts?

mk-pmb commented 6 years ago

I used WAF as acronym for webaudiofont, and WAF data for webaudiofontdata.

surikov commented 6 years ago

One easy way to solve this would be if you can give us some free software that allows us to convert sf2 sound fonts into WAF sound fonts, on our own computers.

Create such software yourself and publish it under any license you like. I can help you in this task.

All others can use this instruments library without any modification.

mk-pmb commented 6 years ago

I can help you in this task.

Thanks! While I don't have the time myself currently, it would be nice if you could share some links to explanations of both data formats (SF2 and webaudiofont) so other people can help out.

mk-pmb commented 6 years ago

In the meantime, another solution could be that you transform a work that has a strong copyleft license (edit: more important: and a reliable verified source), e.g. debian's timgm6mb. Would you spare the time and effort to transform that with your tool, then publish it under the GPL v2 license? Ideally in a repo of its own.

surikov commented 6 years ago

About SF2 start here https://en.wikipedia.org/wiki/SoundFont This page has 'SoundFont 2.04 specification' link to pdf with full tech info. GitHub full of soundfont readers, start from here https://github.com/search?q=soundfont

TimGM is very small (size of TimGM6mb.sf2 is 6Mb) soundfont with ugly sounds. Don't use it. Debian consists of Fluid that much better, see parent folder of your link http://pimpmybyte.de/ftp-area/mirror/debian-unpacked/ FluidGM size is 130Mb. WebAudioFont has full set from Fluid already. You don't need to convert anything.

You need to spend many time to learn if you never develop musical applications before.

mk-pmb commented 6 years ago

You're right, I totally forgot there's actually hope for Fluid R3. It was too huge for my project but it seemed mostly ok for copyright. I'll post over on the license thread how we could make that one work.

Edit: With "make it work" I meant proving the license chain. Technologically it already worked when I discovered it. :+1: :heart:

surikov commented 6 years ago

May be you forgot something else. It works already. I don't see a case to change anything.

mk-pmb commented 6 years ago

Right, I forgot the clarification that I was talking about the license. I added that above.

mk-pmb commented 6 years ago

I have to correct my earlier comment.

You're right, I totally forgot there's actually hope for Fluid R3.

Reading again, I did not forget that. The "too huge" problem was with the MIDI.js version of it. The real reason why I was unable to use the WAF version of Fluid R3 was that it wasn't available in the webaudiofontdata repo at the time. :man_facepalming: This explains why I had suggested adding it. The response back then was a suggestion to use GeneralUser GS and "This issue is closed.", even deleting one of my comments.

Back then, I understood your reaction as dismissing my idea of adding a soundfont that had a clean license chain. You could have saved us both a major part of the confusion if you had told me about your change of mind, two days later.

Anyway. Thanks for the link to the technical specification. Do you have a spec for the webaudiofont format as well, or will it be easy to understand once I learned the SF2 spec? I tried searching for "ahdsr" and "anchor" in the spec but my PDF reader couldn't find either.

surikov commented 6 years ago

WebAudioFont consists of sounds from Fluid and other soundfont.

Read docs, create test project, test sound.