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 »

Strange... Yesterday I used the "OpenGL" subsystem and got this Linker error saying something like "path not found". Today everything works as expected.
Is it possible to adjust the length of a sound as well? I mean now it's limited to 2-5 seconds. Could I say I want maybe about 10 secs?

I remember you've changed your smaller code to enable unicode mode. Is it possible that it isn't supported again?


Edit:
Ok, what?
Now I get the message again: "fatal error: The system can't find the specified path."

Edit2:
I started the code out of the zip file and refused to "modify the archive" (because PureBasic changed something in the source). Now The compiler subsystem option still says "OpenGL" but in the source code there isn't that flag anymore I guess.
Sounds like a little IDE bug?
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 »

A file opened from a zip archive is normally extracted to a temporary directory, which the IDE may not have write access to and throw up odd errors as a consequence - best avoided in my opinion.

I use jaPBe normally, and it appears that the two IDEs store/retrieve the code settings differently, which would explain why the OpenGL system isn't set when loaded in the default IDE. A code check is now in for the OpenGL option.
Is it possible to adjust the length of a sound as well? I mean now it's limited to 2-5 seconds. Could I say I want maybe about 10 secs?
Unfortunately, i'm not the brains behind the clever creation routines (wish I was that smart!) :D, I really don't think it was designed with longer in mind. Playing with the attack / decay / sustain options could help in some circumstances though...
I remember you've changed your smaller code to enable unicode mode. Is it possible that it isn't supported again?
Good spot. The Base64 decoding/encoding required ascii strings. Fixed.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: SpotFX Lib - Retro Sound Generator

Post by c4s »

Thanks for fixing it.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
PHP
User
User
Posts: 63
Joined: Sat Sep 10, 2005 5:38 pm

Re: SpotFX Lib - Retro Sound Generator

Post by PHP »

Is it possible to add a "SaveSound()"-function like in the other generator from Demivec?
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post by pjay »

A SaveSound facility is now in.

Usage is SpotFX_Create(B64String, Sound# to capture to, *Memory to copy to ['0' if no memcopy required], Filename to save to ["" or leave blank if no save required])

The example code has been amended to save the generated sound as 'Testwave.wav' in the directory it was ran from.

Download from previous download link.
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,
I had problems finding the latest download link. Could you please edit your first post in this topic so that anyone who is searching this can easily download your excellent improved code.


Anyway, I'm here for another reason.
It looks like your include has an invalid memory access at line 56, or as the Purifier says "Overflow in the global data block" (don't know what this means):

Code: Select all

Base64Decoder(*mem, Len(Txt), @B64Gen\wave_type, SizeOf(GenBits))
Do you know how this can be fixed?
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 »

Hiya,

I think the fault lies in the Base64decoder routine, rather than my code - I've posted a bug report, thanks. I've also linked to the latest version on the original post.
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post by pjay »

I retract my last comment, it wasn't a bug, but rather my mis-understanding of the routine.

All fixed now, and i've added a sample-rate slider as well.

Phil.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: SpotFX Lib - Retro Sound Generator

Post by c4s »

Phil, thank you again for fixing this and even adding a new option!
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). 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 »

I see that your displaying the Create command line at the bottom.. how can i add it to my program to play that created wave with that commandline.

has the library been updated to PB 4.50.. if not how can I do that or can you do it.
I really need a way to incorporate the reading of that create statement and playing of the sound within my programs.. without the sliders etc.... like the first version did for PB4.3
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 »

Hi Blue,

If you re-download, you'll see that I've properly structured the source code, so it now has an include file - use this and the SpotFX_Create command, as demonstrated in the file 'Spotfx2b Playsound.PB'.

It's as simple as this:

Code: Select all

;{- SpotFX Test app - Generate & play sound only.
XIncludeFile("Spotfx2b Include.pbi")
InitSound()
SpotFX_Create("AQAAAClcjz4AAAAAAAAAALgeBT4zM7M+AAAAv83MTL0pXI+9CtejPo/C9T6PwvU+cT0KPwrXoz1mZiY/7FG4Po/Cdb0AAEA/CtcjPFyPwr49Cte+CtejPhSuB7/sUTi+BAE=",1)
PlaySound(1)
Delay(10000)
End
;}
Phil.
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 »

Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol: Thankyou :lol:

:twisted:

sorry... i got carried away ;)

now i'm off to convert my current project to PureBasic for sure, Originally written in Blitzbasic , then , IWBasic (Ebasic back then) then in GLBasic.. now comming soon to PureBasic (BTW its still a work in progress .. been woking on it for about 4 years off and on.
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
xperience2003
Enthusiast
Enthusiast
Posts: 111
Joined: Tue Oct 05, 2004 9:05 pm
Location: germany
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post by xperience2003 »

hi,

maybe there is this lib or code anywhere ?
pjay
Enthusiast
Enthusiast
Posts: 163
Joined: Thu Mar 30, 2006 11:14 am

Re: SpotFX Lib - Retro Sound Generator

Post by pjay »

Hi,

This puzzled me as the code has been in my Dropbox Public folder for years... but it turned out that Dropbox stopped allowing for shares on theire free accounts some 3 years ago... oooops.

I've uploaded to OneDrive, please try: Here
xperience2003
Enthusiast
Enthusiast
Posts: 111
Joined: Tue Oct 05, 2004 9:05 pm
Location: germany
Contact:

Re: SpotFX Lib - Retro Sound Generator

Post by xperience2003 »

wow,
thank you so much :)
Post Reply