Closed sdoherty0 closed 5 years ago
You can load and play any number of midi simultaneously. You can send all notes from all midi's into single Gain node.
Please be more specific.
Place link to your code here if you need review.
I have done this in your riffshare app by allowing the storeTracks object to keep adding tracks to it from multiple file loads by changing the openSong function to handle all files passed to it . However, I have not seen a code example or snippet of how to load multiple midi files in webaudiofont. What I have seen is javascript sf2 loads, or a single midi file loader, but I do not know how to load the individual midis and pass them to gain nodes and then play them all at the same time. Do you have an example of this?
No.
Could you show me a snippet of how I could do it? Your riffshare is awesome, I just don't need all of the visuals, but I'm amazed at its ability to handle so much complexity.
Invoke loading function twice and store notes in two arrays. Send notes from both arrays to single output in the same time.
This is very easy.
Thank you for your patience. I am looking at the midiplayer.html example, and I do not see how to do what you are describing because i don't see where it is being sent to an output. It is calling sendNotes, which calls player.queueWaveTable, and I don't see how to do that with two things. Again, thank you for your patience.
function sendNotes(firstSong, secondSong ...
for (var t = 0; t < firstSong.tracks.length; t++) {
var track = firstSong.tracks[t];
for (var i = 0; i < track.notes.length; i++) {
...
}
for (var t = 0; t < secondSong.tracks.length; t++) {
var track = secondSong.tracks[t];
for (var i = 0; i < track.notes.length; i++) {
...
}
That did it! Thank you so much.
How can I change the tempo? Thanks again,your library has solved a problem I have been facing for a long time.
On Wed, Feb 6, 2019, 1:46 PM Srgy Surkv notifications@github.com wrote:
function sendNotes(firstSong, secondSong ...
for (var t = 0; t < firstSong.tracks.length; t++) {
var track = firstSong.tracks[t]; for (var i = 0; i < track.notes.length; i++) { ... }
for (var t = 0; t < secondSong.tracks.length; t++) {
var track = secondSong.tracks[t]; for (var i = 0; i < track.notes.length; i++) { ... }
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/surikov/webaudiofont/issues/29#issuecomment-461139698, or mute the thread https://github.com/notifications/unsubscribe-auth/AtB-QPBArrizZdO4TO01ydFC5MQK5lMdks5vKyLzgaJpZM4akbTu .
search closed issues for same question
I have found a way to do it in riffshare, by changing the file loader function, but I cannot find a way to load four midi files in webaudiofont and then play them simultaneously with gain nodes to alter their respective volumes. Do you have an example of loading from multiple simultaneous midi files? Thanks.