SynthMaker

Wave Read interpolation

Archive · 2005 10 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

lalo ·

HI guys!

i 've discussed with jorge about sample interpolation (linear, cubic, spline etc..) for the wave read component... he said that probably in the future it will have interpolation options...

but for now...how would you solve the interpolation problems (while i.e. readinf the sample at lower speed than the original) with a code component after the wave read?

lalo

stefan ·

lalo wrote: HI guys!

i 've discussed with jorge about sample interpolation (linear, cubic, spline etc..) for the wave read component... he said that probably in the future it will have interpolation options...

but for now...how would you solve the interpolation problems (while i.e. readinf the sample at lower speed than the original) with a code component after the wave read?

lalo

You have to read both at the current and at the next index and mix these.

A linear interpolation could work like this:

streamin readPos; streamout intPos1; streamout intPos2; streamout amp1; streamout amp2; intPos1 = rndint(readPos); intPos2 = intPos1 + 1; amp1 = readPos - intPos1; amp2 = 1.0 - amp1;

Now read from the buffer using the intPos1 and 2 outputs, and multiply the values you get back with amp1 and amp2.

If something is unclear, do tell 🙂

lalo ·

stefancrs wrote: lalo wrote: HI guys!

i 've discussed with jorge about sample interpolation (linear, cubic, spline etc..) for the wave read component... he said that probably in the future it will have interpolation options...

but for now...how would you solve the interpolation problems (while i.e. readinf the sample at lower speed than the original) with a code component after the wave read?

lalo

You have to read both at the current and at the next index and mix these.

A linear interpolation could work like this:

streamin readPos; streamout intPos1; streamout intPos2; streamout amp1; streamout amp2; intPos1 = rndint(readPos); intPos2 = intPos1 + 1; amp1 = readPos - intPos1; amp2 = 1.0 - amp1;

Now read from the buffer using the intPos1 and 2 outputs, and multiply the values you get back with amp1 and amp2.

If something is unclear, do tell 🙂

thanx stefan...

how can i use 2 different index to read from the file?

an example schematic would be cool if you can...

thanx again

lalo

stefan ·

Don't have the time! Can't you just use two wave read components?

lalo ·

ok ok..thanx..now i think get it 🙂

at least i think... the idea is to have 2 copies of the buffer and interpolate between them?

so cubic interpolation would require 4 different copies..am i right?

thanx again and have a good work 🙂

lalo

stefan ·

you don't need copies of the actual buffer though, you just need to read from different indices simultaenously 🙂 apart from that, you're right 🙂

jorge ·

lalo wrote: the idea is to have 2 copies of the buffer and interpolate between them?

I think it would be two read components reading from the same sound buffer. One reads from intPos1 and the other from intPos2. The outputs of the two read components would then be multiplied by amp1 and amp2 and added together.

lalo ·

yes i intended 2 copies of wave read 🙂

sorry for the mess guys 🙂 and thanx for the hint...DSP school here 😀

so for cubic interpolation we'd need 4 indexes ....

lalo

jorge ·

lalo wrote: yes i intended 2 copies of wave read 🙂

sorry for the mess guys 🙂 and thanx for the hint...DSP school here 😀

so for cubic interpolation we'd need 4 indexes ....

lalo

I'd say you're right. I didnt try it but for linear interpolation on a stereo buffer it would be something like:

The read components should pick up type, that's a bug.

lalo ·

cool 🙂 i 'm starting to grasp it..

thanx jorge and stefan 🙂

lalo

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.