Concept of 'zones' unclear and how to work with it / use it / modify it #115
Replies: 1 comment
-
You're calling webaudiofont/npm/src/player.ts Line 89 in fd16e95 where for the
As per the quoted code above, the output of
It looks like
It looks like it doesn't matter. You can for example use the one that uses the same units as other parts of your app.
I guess the default is A=440Hz. I haven't checked whether you can pass a noninteger |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi and thanks for the great library! This is very helpful!
I am totally new to SoundFonts and read around in the original SoundFont specs, but I did not understand the webaudiofont implementation.
See the "Hello world"-example https://github.com/surikov/webaudiofont?tab=readme-ov-file#hello-world
This embeds a file https://surikov.github.io/webaudiofontdata/sound/0250_SoundBlasterOld_sf2.js . It is basically a global variable ("preset?") which contains 3 zones, all meant for midi note? / program? 25.
Question 1: When loading the preset and playing it with player.queueWaveTable(audioContext, audioContext.destination, _tone_0250_SoundBlasterOld_sf2, 0, 12*4+7, 2); : Which zone is played? Zero?
Question 2: How can I change the zone and e.g. play the second zone/sample?
Question 3: The zones do not have a description as an object member of type string. Only a comment gives some information on the sample/zone, e.g. //_tone.kpianob5 . However this is not accessible in the code at runtime such as _tone_0250_SoundBlasterOld_sf2.zones[0].name. Why has https://surikov.github.io/webaudiofont/npm/src/docs/modules/otypes.html#WaveZone no member "name", "info", "description"?
Question 4: I did not understand the difference between "coarse tune" and "fine tune". What is the unit? When to use which to alter the sound?
Question 5: Take the "Hello world" example. I have loaded the sound font and already played a sound / note. How can I access "coarse tune" and "fine tune" in case the end-user wants to retune the instrument slightly e.g. with a HTML5 slider / input type range? Some people do not prefer A=440Hz but A=432Hz. Or think of a drum, which should be slightly tuned up to sound higher.
Any help for a newbie would be appreciated very much!
Thanks
Paul
Beta Was this translation helpful? Give feedback.
All reactions