admin管理员组

文章数量:1394135

I am creating a Digital Audio Workspace in nextjs. I have audio samples for every third note of each instrument, and luckily Tone.js automatically handles this:

"Multiple samples can also be combined into an instrument. If you have audio files anized by note, Tone.Sampler will pitch shift the samples to fill in gaps between notes. So for example, if you only have every 3rd note on a piano sampled, you could turn that into a full piano sample."

The problem is, I also have different articulations and dynamics for each note. Just for violin theres multiple articulations, and then each articulation has a different dynamic. If I want to take advantage of the automatic pitch shifting the keys have to be exact note names like C3 or A4, but these can only map to one sound file and I have multiple.

I also considered using Tone.PitchShift to do the shifting manually but it seems that is only for pitching an entire audio channel and I need many different notes pitched differently simultaneously. My choices from what I know at this point seem to be 10s of samplers, 10s of pitch shift channels, or to speed up/ slow down the audio which I also dont want to do. Is there a performant solution to this problem?

Example:

// if a#3 is played, the g3 sample should play pitched up by 3 semitones
0: {lowkey: 'g3', highkey: 'a#3', key: 'g3', file: 'instrumentSounds/Samples/1st Violins/1st-violins-col-g3-p.mp3', dynamic: 'p'}
// here is the same but at a different dynamic level. If i want to use automatic pitch shifting there can only be one g3. Also this is only for one articulation (col legno) and there are many combinations
1: {lowkey: 'g3', highkey: 'a#3', key: 'g3', file: 'instrumentSounds/Samples/1st Violins/1st-violins-col-g3-pp.mp3', dynamic: 'pp'}

本文标签: javascriptHow can I handle Tonejs pitch shifting with multiple articulations and dynamicsStack Overflow