Giter Club home page Giter Club logo

Comments (5)

newlandsvalley avatar newlandsvalley commented on July 22, 2024

Yes, this would work, I think, if you are able to choose a soundfont that represents the ring tone sound you're looking for.

I'm afraid I have no plans whatsoever to update any of my Elm code to 0.19. Unfortunately, I came up against a set of insurmountable barriers in Elm and I chose instead to rewrite everything in PureScript.

from elm-soundfont-ports.

jtrunick avatar jtrunick commented on July 22, 2024

Curious what your barriers were, but more important how do you get a .js file from a soundfont file?

from elm-soundfont-ports.

newlandsvalley avatar newlandsvalley commented on July 22, 2024

I'm not sure exactly what you mean. The soundfont files are themselves .js files - see for example https://raw.githubusercontent.com/gleitz/midi-js-soundfonts/gh-pages/FluidR3_GM/acoustic_grand_piano-mp3.js. But what they really consist of is base64 encoded MP3 or OGG data expressed as JSON.

So what the module does is to decode this data and reconstitute images of the sound files which can then be played through web-audio. Under the covers it uses danigb's JS soundfont player to do all the heavy lifting.

from elm-soundfont-ports.

jtrunick avatar jtrunick commented on July 22, 2024

Oh I see. I had found a .sf2 file that definitely isn't .js format. Are soundfonts strictly needed to play midi files? Possibly for my purposes I don't care exactly on the exact sound. I could likely still use your code to convert from Elm -> js midi format.

from elm-soundfont-ports.

newlandsvalley avatar newlandsvalley commented on July 22, 2024

Well, MIDI is just a definition of a bunch of notes and in order to 'play' MIDI, you need to use some sort of synth to produce actual sounds. Soundfonts are just one option. You could, for example, synthesize the sounds yourself using web-audio oscillators and filters and so on.

You could, if you wanted, use a library like elm-comidi to generate MIDI, but by itself, it won't play anything.

from elm-soundfont-ports.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.