Page 3 of 5

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed Apr 28, 2010 7:07 pm
by c4s
Thank you very much pjay! That's definitely helpful for me.

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed Apr 28, 2010 9:40 pm
by jamirokwai
Hiya,

nice thing :-)
And works on Mac OS X, too!

If you replace the GetTickCount_() with ElapsedMilliseconds() and the #WAVE_FORMAT_PCM with 1, you add cross-plateform-compatibility ...
Besides the broken GUI because of different Button-sizes on Window and Mac ...

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 4:54 am
by Blue Steel
I can't get any sound playing using PB4.50 beta2 using your last posted code on windows 7

if i run it with debug mode off I get the window displaying. buttons working but no sound

if i run it in debug mode on it halts on line 408

Code: Select all

        SoundVolume(1, 255) : PlaySound(1)
then pressing run again and press a button "play" or "random" or mutate (after all the buttons appear) it stops at line 397

Code: Select all

              PlaySound(1)
can someone please help me out here ??

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 7:08 am
by pjay
Not sure what the problem is.... although the SoundVolume() should be between 1 & 100 according to the manual.

Does the code work from a straight copy & paste?

Edit-

Actually, having had a look through the code, I can see a couple of differences in this version compared to the earlier released version:

The waveform is now normalized after creation, so that the samples are always at their loudest & without distortion. This means that (a) previously inaudible/quiet samples are now amplified & (b) sample volume now has to be controlled with the native Purebasic commands.

So the command is now:

Code: Select all

SpotFX_Create(Seed.i, Mutations.i, Sample_Number.i)
and not

Code: Select all

CreateSpotFX(Seed,Mutate,Sound_Volume,Sample_Number)
So make sure you're not passing the sample volume (as it'll be capturing the sample to that number instead!)

Also, supersampling is now included as part of the randomization. This results in more sound variations, but is likely to mean that previously discovered seeds will sound different.

@jamirokwai - thanks for the advice, i'll make the necessary changes :)

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 8:00 am
by Blue Steel
sorry i changed the volume.. it was set to 60 originally.. but that didn't play anything either..

I'm using the exact copy / paste from your last example (on page 2 of this thread.. the one you stated sorry for taking so long that you thought you had pasted it in) nothing being edited by me.
ie:
new file
paste
compile and run
on windows 7 PureBasic 4.50 beta2
(edited to remove code at pj's request)

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 8:04 am
by pjay
Ok, thanks. What error message does the debugger give you?

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 8:21 am
by Blue Steel

Code: Select all

[ERROR] The specified #Sound is not iniyialized

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 8:39 am
by pjay
Hmmm :?

Are you running it in unicode mode? I've just made the source unicode compatible, so could be worth checking again.

If that doesn't work, then I'm at a loss :(

Could you edit your previous post to remove the source code, as it's quite long... thanks.

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Apr 29, 2010 8:53 am
by Blue Steel
thanks that was it.. but i can't ever remember enabling it.. lol

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed May 26, 2010 1:58 pm
by c4s
Hi pjay,
Finally I had the time to work with an older project of mine that uses the SpotFX Library. So now I switched to your source version and noticed that all my collected seeds don't sound the same!

Do you know why the older library doesn't sound like the newest source?
Did you change something else except of removing the volume parameter that might be responsible for that?

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed May 26, 2010 7:37 pm
by pjay
Hi c4s,

You're quite right, this code came from a different project & had some changes which (as I stated earlier in this thread) is likely to make your seeds sound different..... sorry.

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed May 26, 2010 7:51 pm
by c4s
Sad, so there is no way of transfering them?

If it's not too much work: Could you update your "SpotFX prehearer" which had the oszillograph in it? It's really helpful for finding new sounds when the wave form is displayed as well...

Re: SpotFX Lib - Retro Sound Generator

Posted: Fri May 28, 2010 11:36 pm
by pjay
I've been through the posted code and identified/eliminated a couple of the 'creative' tweaks I'd made. The seeds should now generate samples that sound much closer to the library version.

I've also updated and re-compiled my original conversion (which pre-dates the library) - It has the oscilloscope function, as well as full waveform definition control (which does away with the 'hit and hope' aspect of the random seed).

Image

Download here:
http://dl.dropbox.com/u/6000090/Purebas ... potfx2.zip

Re: SpotFX Lib - Retro Sound Generator

Posted: Sat May 29, 2010 1:14 am
by c4s
Wow - This looks really really good and thanks for adding this nice oscillator!

I'll take a deeper look at it tomorrow. I just noticed that I can't bring the code to work here. Should I type "OpenGL" in the subsystem setting?

Edit:
A small bug? Try "AAAAAJqZWT8AAAAAAAAAAJqZGT8fhWu+CtcjvY/C9b1I4Xq/mpkZPylcT7+uR2E/7FG4vc3MTD2kcL2+mpkZPuxROL8AAAAAw/Uovylcj724HgW/MzNzP65H4T3sUTi/Dg==". The blue screen won't clear.

Re: SpotFX Lib - Retro Sound Generator

Posted: Sat May 29, 2010 7:27 am
by pjay
Yes, the second line of the code says that you need the OpenGL option, I should've put a code check in there.

I couldn't see any problems with the string you gave.... but I expect there'll be a bug or 2 :)