Wav (Mem) to Float array issue.

For general discussion related FlowStone
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wav (Mem) to Float array issue.

Post by martinvicanek »

Damned! Thank you, Hugh. Fixed in the original post.
User avatar
Duckett
Posts: 132
Joined: Mon Dec 14, 2015 12:39 am

Re: Wav (Mem) to Float array issue.

Post by Duckett »

Found this interesting free wave editor (intended for wavetables for specific hardware units, but can save single-cycle .wav files): http://synthtech.com/waveedit/
We have to train ourselves so that we can improvise on anything... a bird, a sock, a fuming beaker! This, too, can be music. Anything can be music. -Biff Debris
User avatar
HughBanton
Posts: 265
Joined: Sat Apr 12, 2008 3:10 pm
Location: Evesham, Worcestershire
Contact:

Re: Wav (Mem) to Float array issue.

Post by HughBanton »

martinvicanek wrote:Fixed in the original post.

From which I deduce that the 'counter' in the original 2017 version can simply read -

Code: Select all

streamout index;
index += 1;


Is that right? I'll have to see if I can't optimise that a bit ;)

H
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Wav (Mem) to Float array issue.

Post by Spogg »

Martin, I just tried your latest (fixed) reader and the load time is now good and the CPU is even lower than your previous one.

Now here comes that big BUT…


The wrap-around glitch is back :o :shock:

With this version my nasty trick of resampling up to 2048 doesn’t fix it.

I should also mention that on one change of wav file the audio stream turned off. That never happened before with my current system. I suspect it’s something to do with writing stuff to memory 9 times, but I don’t know for sure.

Honestly Martin, unless you really want to carry on with this, please keep in mind that I’m happy with what I have. Of course if you would like to try other solutions I will happily test them.

Cheers

Spogg
User avatar
HughBanton
Posts: 265
Joined: Sat Apr 12, 2008 3:10 pm
Location: Evesham, Worcestershire
Contact:

Re: Wav (Mem) to Float array issue.

Post by HughBanton »

Here's a basic note counter that plays Martin's wave readers from MIDI_in.

Annoyance Warning! - made in FS64 so will be 3.09 (or higher??) ...

Spogg'sWave player.fsm
(22.54 KiB) Downloaded 841 times


This is based on pretty much the same as I do. I do hear a slight 'buzzing', slightly more on some notes than others, but I can't see anything wrong as such with the numbers. The wrap-around slope value that it generates looks correct.

Maybe the sharp slope at the end is exessive for a 256-point waveform, and this is just regular aliasing as a result?

Dunno! Hope it's useful ...

H
Last edited by HughBanton on Tue Sep 24, 2019 9:33 am, edited 1 time in total.
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wav (Mem) to Float array issue.

Post by martinvicanek »

Spogg wrote:The wrap-around glitch is back :o :shock:


That's odd, it does work here. The attached demo showa a clean sinewave regardless of frequency. Distortion and aliasing would indicate a glitch but no such thing here.
:?
Attachments
Interpolated Wave Reader Test.fsm
(1.28 MiB) Downloaded 905 times
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Wav (Mem) to Float array issue.

Post by Spogg »

Thanks Martin. I can confirm that your demo doesn’t show a glitch. I added a “Steady Scope” which works with the analyser and the sine wave was indeed pure.
I re-tried the reader from your test and used the counter from it as well (just in case) but I still got the issue.

glitch on sinewave .png
glitch on sinewave .png (31.96 KiB) Viewed 16483 times


So I’m puzzled!

Cheers

Spogg
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Wav (Mem) to Float array issue.

Post by martinvicanek »

If yo post a stripped down schematic which shows the glitch we may sort this out.
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Wav (Mem) to Float array issue.

Post by Spogg »

Well, this is fascinating!

I stripped down the schematic to almost nothing and added you reader and counter and there was no glitch.
So I copied that oscillator back into the original schematic and still no glitch. :o

I just can’t account for this so maybe it was a weird FS issue, not updating the compilation correctly or something. I would say that it could have been my mistake but I had already changed for your reader and counter on 2 separate occasions previously.

Whatever the reason, I can confirm that it works great now. The wav changeover is fast and the CPU is lower than before. So I’m left puzzled but happy. :? :D

Thank you so much Martin!

Spogg
Post Reply