Page 3 of 8
Re: how to add offset
Posted: Fri Aug 08, 2014 1:29 pm
by KG_is_back
Here you go...
I have just added a few lines of code that will add length to counter if it's smaller than 0; Now the looping works in both directions.
To reverse, you just make the step negative.
Re: how to add offset
Posted: Fri Aug 08, 2014 11:43 pm
by tester
Thanks. Now I need to wire a little bit of stuff and check if there are no errors.
But reverse speech sounds cool.

.looc sdnuos hceeps esrever tuB

Re: how to add offset
Posted: Wed Aug 13, 2014 11:31 pm
by tester
Quick question. If the audio is played back at such slower speeds (several octaves) - is there a way smooth them a little bit, to remove these digital sounding artifacts? Would it be some sort of oversampling or some stuff like that useful here?
Re: how to add offset
Posted: Wed Aug 13, 2014 11:53 pm
by KG_is_back
You need better interpolation. With linear interpolation the algorithm simply connects the points with straight lines - however real wave is smooth, so it is distorting it, creating aliasing which results in nasty artifacts you are mentioning. With pitch shifting down, they become rather obvious because you are basically "zooming in" on the wave or upsampling it.
You need better interpolation algorithm that interpolates the waves "smoother" (closer to original). Many such algorithms exist and many were implemented in FS/SM. Just search for "interpolation".
The difference between interpolation and oversampling is, that interpolation is an operation of calculating "inbetween" values in sampled signal, while oversampling is increasing number of samples per section of sampled signal. Basically you oversample using interpolation to make up the missing samples.
Re: how to add offset
Posted: Thu Aug 14, 2014 11:13 am
by tester
As I thought, thanks for confirming.
So oversampling modules for interpolation, yes? As far I remember, there were triangular and polyphase modules for that. Since I work on octaves here, it would fit 1:1 at the end.
Re: how to add offset
Posted: Thu Aug 14, 2014 11:18 am
by KG_is_back
If you are working in octaves, then the oversampling will do the task quite good (basically the points you are looking for are identical with those that the oversampling provide).
Re: how to add offset
Posted: Thu Aug 14, 2014 9:41 pm
by tester
I found two things, but I'm not sure how to use it in this design (waveplayer).
If I understand correctly, there is only upsample part needed if oversampling is used. In wav player (almost the same as the stock one), there is the counter (yours), something called interpolated "read" that takes mem (audio) and stream values according to counter.
My understanding tells me, that if I use oversampling modules, then it should be placed after that "interpolated read" module, to mess with the stream. But if so, then I'm not sure how to combine these two outputs into single one. Just mix them? Delay one output by one sample?
On the other hand, in "interpolated read" part there is a module responsible for some sort of simple interpolation, but it relies on counter. But again - there might be the problem with the counter itself (fractions).
Re: how to add offset
Posted: Thu Aug 14, 2014 9:53 pm
by tester
Hehe, I found even Trogs notes:
http://synthmaker.co.uk/forum/download/file.php?id=5232
and something like this. But no idea yet what worth is it. (plus - it oversamples only within 1 octave range).
And "developer toolkit" (registered area). Is the 0.1.8 the latest version?
Re: how to add offset
Posted: Thu Aug 14, 2014 10:40 pm
by tester
Okay, give me few moments to combine my findings. I will need to know whether I did not made mistakes there.
For more than 1 octave, should there be more oversampling than 2x?
//edit:
what worries me about these oversampled examples is, what happens with fract part of the index...
Re: how to add offset
Posted: Thu Aug 14, 2014 11:01 pm
by KG_is_back
The "interpolated read" modules within should be of your main interest. Copy them into your schematic and test them.
For oversampling you may use two in tandem. One will be fed by normal counter and one will be fed with counter -(step/2). then the two must go into downsampling. For 4x oversampling you need 4 interpolated reads in tandem each delayed by step/4 more than the previous. And the downsample those 4.
You can actually hear the dramatic drop of aliasing within this schematic, if you use step 8 (basically 8*playback speed = 3 octaves up). I hear no difference on slowing things down though... I would definitely go with better interpolated read modules (provided in that schematic you posted) for improving that.