SpotFX Lib - Retro Sound Generator

Advanced game related topics
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: SpotFX Lib - Retro Sound Generator

Post by c4s »

Thank you very much pjay! That's definitely helpful for me.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
jamirokwai
Enthusiast
Enthusiast
Posts: 771
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post 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 ...
Regards,
JamiroKwai
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post 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 ??
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post 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 :)
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post 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)
Last edited by Blue Steel on Thu Apr 29, 2010 8:50 am, edited 1 time in total.
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post by pjay »

Ok, thanks. What error message does the debugger give you?
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post by Blue Steel »

Code: Select all

[ERROR] The specified #Sound is not iniyialized
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post 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.
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post by Blue Steel »

thanks that was it.. but i can't ever remember enabling it.. lol
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: SpotFX Lib - Retro Sound Generator

Post 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?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post 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.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: SpotFX Lib - Retro Sound Generator

Post 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...
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post 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
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: SpotFX Lib - Retro Sound Generator

Post 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.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post 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 :)
Post Reply