surikov / webaudiofont

Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
https://surikov.github.io/webaudiofont/
GNU General Public License v3.0
891 stars 92 forks source link

How do I slide a whole chord? #80

Closed ckoppelman closed 2 years ago

ckoppelman commented 2 years ago

Is your feature request related to a problem? Please describe. When I play guitar, it's quite common to pluck two or more strings at the same time, and then slide them both up or down the fretboard, so I have two or more sliding notes. In WebAudioFont, I have tried to duplicate this by using the slides parameter in queueChord. There is not a lot of documentation on slides, but I'd assume the syntax should be something like this:

player.queueChord(audioContext, output, guitar, now,
  [
     _1st+1,
     _3rd+1
  ],
  1.5, 1.4,
  [
     {pitch: _1st+5, when:now + 2},
     {pitch: _3rd+5, when:now + 2}
  ]
);

That sounds like it's only playing _3rd+5. I must be using this wrong.

Describe the solution you'd like I assume the API already supports this. Can you help me understand how to do it?

If somehow the API doesn't support this, I would love a feature of bending or sliding multiple "strings" at a time.

surikov commented 2 years ago

Don't use queueChord for slides. Use queueWaveTable for each string. See the source code for the Mixer example at https://surikov.github.io/webaudiofont/examples/mixer.html