drahoslove/pianco

Switch instrument output

Rominwolf opened this issue ยท 2 comments

Is there have a chance to switch instrument output?

I saw there has a folder named "audio", and I made a new folder called "banjo" in it, but I do not know how to switch it on frontend.

Snipaste_2023-01-09_14-06-44

Thanks for answer! :)

Hi @Rominwolf
sorry for the late reply.

I updated the frontend a bit.

All you have to do now is to edit the file /js/instruments.js and add your new instrument to the instruments object, like this

'Banjo ukulele': new Tone.Sampler({
  urls: {
    "A0" : "C8.[mp3|ogg]",
    "C1" : "A7.[mp3|ogg]",
    ...
    "C8" : "A0.[mp3|ogg]"
    },
    baseUrl: "/audio/banjo-ukulele/",
    release: 1,
}).toDestination(),

Once you do that, the little icon [๐ŸŽน] at the left side of the screen will be rotating between the instruments.

If your ukulele-banjo sample set has some appropriate license, feel free to create a pull request with those. I'll be happy to incorporate it ๐Ÿ™‚

Note: I'll probably implement a better instrument selector (together with better MIDI in/out selector) in the future, but this is IMHO good enough for now.

Thanks a lot! And I think I don't have license about that instrument. Sorry.