SynthMaker

Delay primitive has extra sample delay

Archive · 2008 6 old posts

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

Andrew J ·

The delay primitive seems to delay one more sample than instructed (sorry if this has been reported before).

The compare audio module simply runs a mono analyser on both inputs and the stream delta of those inputs. The delta is non-zero if only a single DelayS primitive is in the chain.

If I increase the NS input to 2, then I need 3 DelayS primitives to match things up.

This seemed to be happening in SM 1.0.9. This particular example is confirmed on my machine with 1.1beta.

Regards, Andrew

infuzion ·

Hey, every programmer knows that 0=1st, 1=2nd! 😉

Have you tried to compare them against Code delays? streamin i;streamout o; float lastI=0; o=lastI; lastI=i;

malc ·

I think the problem is in the Delay by One Sample primitive. If you test with an Analyser you can see that just one of these seems to have no effect. Two of them delay by 1 sample, three delay by 2 samples. Unless I'm going mad (which is quite possible 🙂)

The Delay component seems to work fine (although there is a minimum delay of 1 sample so putting N=0 still delays by 1).

Andrew J ·

Just to be sure, I coded my own delay by one sample - and that matched the Delay by One Sample primitive. In case I made a silly mistake, I also tested with MyCo's optimised fixed delay. That also matches the DelayS correctly.

On the regular delay primitive, setting N=0 and N=1 result in a delay of 2 samples. N=2 gives you a 3 sample delay, N=3 gives you 4 ... and so on.

On MyCo's delay primitive, setting N=0 and N=1 result in a delay of 1 samples. N=2 gives you a 2 sample delay, N=3 gives you 3 ... and so on.

The DelayS primitive definitely works correctly.

See for yourself: Delay_test.osm

-Andrew

Andrew J ·

malc wrote: I think the problem is in the Delay by One Sample primitive. If you test with an Analyser you can see that just one of these seems to have no effect. Two of them delay by 1 sample, three delay by 2 samples. Unless I'm going mad (which is quite possible 🙂)

The Delay component seems to work fine (although there is a minimum delay of 1 sample so putting N=0 still delays by 1).

If I test with one DelayS and look at the samples coming out of the analyser, I see 0.000000 for the first entry. With 2xDelayS I get 0.000000 for the first two entries. That looks to me like it's working correctly.

-Andrew

Andrew J ·

Bump - this is definitely a bug!

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.