This discussion is archived
6 Replies Latest reply: Oct 8, 2010 2:53 PM by 802580 RSS

How can I create my own Midi Soundbank file ?

802580 Newbie
Currently Being Moderated
Hello everyone !

I wanted to know if someone knew how to create a Soundbank* file like those are propsed here : [http://java.sun.com/products/java-media/sound/soundbanks.html].
I tried to find something to explain that in the internet, but I have found nothing.

Thanks in advance
  • 1. Re: How can I create my own Midi Soundbank file ?
    captfoss Pro
    Currently Being Moderated
    Dooxe wrote:
    I wanted to know if someone knew how to create a Soundbank* file like those are propsed here : [http://java.sun.com/products/java-media/sound/soundbanks.html].
    I tried to find something to explain that in the internet, but I have found nothing.
    Well, I've never heard of anyone on these forums creating their own soundbank files... More than likely, you'd want to use a MIDI sound bank editor capable of outputting a soundbank that JavaSound knows how to load.

    Doing a google search for "Soundbank editor" brings up lots of results.
  • 2. Re: How can I create my own Midi Soundbank file ?
    802580 Newbie
    Currently Being Moderated
    Thanks for your help.

    Apparently classes like SoundbankResource and Instrument in the javax.ssound.midi package allow us to do that but I don't really understand how they work.

    I will so research about the Sound Bank editors like you adviced me.
  • 3. Re: How can I create my own Midi Soundbank file ?
    captfoss Pro
    Currently Being Moderated
    Dooxe wrote:
    Apparently classes like SoundbankResource and Instrument in the javax.ssound.midi package allow us to do that but I don't really understand how they work.
    The way the code is structured...

    A Soundbank is a set of Instrument and/or SoundbankResource (An Instrument is a type of SoundbankResource and is just a subclass)

    A SoundbankResource appears to be a class that contains either
    (1) Intruments
    (2) Sampled audio data
    (3) MIDI Sequence data

    Regardless of what the SoundbankResource provides, all it is is a wrapper around some sort of data object. It's job, in essense, is to return whatever it is holding in response to a getData() request.

    In order to utilize a SoundbankResource, you'd have to wrap around an object that whatever Synthesizer you're using is capable of playing.

    Probably the easiest way to implement your own custom Soundbank without using a soundbank editor (which may or may not work with JavaSound's engine when all is said and done) would be to write a custom Synthesizer that plays short WAV files, and build SoundbankResource objects to wrap around said short WAV files.
  • 4. Re: How can I create my own Midi Soundbank file ?
    802580 Newbie
    Currently Being Moderated
    I see, so the Synthesizer is a facade interface that I have to implements all functionalities, and then use it as I use Midi synthesizer.
    I'm right ?

    Well, it could be very amusing :)
  • 5. Re: How can I create my own Midi Soundbank file ?
    captfoss Pro
    Currently Being Moderated
    Dooxe wrote:
    I see, so the Synthesizer is a facade interface that I have to implements all functionalities, and then use it as I use Midi synthesizer.
    I'm right ?
    Is an InputStream a facade interface? Because it's basically the same interface concept, and I wouldn't personally consider either of them facade interfaces.

    A facade interface is designed to make it easier to use a specific subsystem, which isn't really the case here. The goal of the Synthesizer (and in my example, InputStream) is to make a bunch of different objects interchangable so you can write algorithms to handle any of them. I'd define that as, well, just a normal interface...

    I suppose you could make an argument that each individual instance of the Synthesizer is a facade interface to its particular backend object, but, taken as a whole, I wouldn't consider the purpose of the interface to provide a facade.
    Well, it could be very amusing :)
    Beep beep quack quack moooo...
  • 6. Re: How can I create my own Midi Soundbank file ?
    802580 Newbie
    Currently Being Moderated
    >
    Is an InputStream a facade interface? Because it's basically the same interface concept, and I wouldn't personally consider either of them facade interfaces.

    A facade interface is designed to make it easier to use a specific subsystem, which isn't really the case here. The goal of the Synthesizer (and in my example, InputStream) is to make a bunch of different objects interchangable so you can write algorithms to handle any of them. I'd define that as, well, just a normal interface...

    I suppose you could make an argument that each individual instance of the Synthesizer is a facade interface to its particular backend object, but, taken as a whole, I wouldn't consider the purpose of the interface to provide a facade.
    >

    You're totally right.
    I have just learned about design pattern and it's true that I'm not familiar with most of them ( this is the case with Facade ).


    >
    Beep beep quack quack moooo...
    >

    Not amusing for evryone I suppose :D

    But it's true that it will be more difficult that I thaught...

    -----
    PS : By the way, I wanted to apologize for my english ( I'm a french man ;) )

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points