Page 3 of 5

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

Re: SpotFX Lib - Retro Sound Generator

Posted: Sat May 29, 2010 12:02 pm
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?

Re: SpotFX Lib - Retro Sound Generator

Posted: Sun May 30, 2010 11:23 am
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.

Re: SpotFX Lib - Retro Sound Generator

Posted: Sun May 30, 2010 3:39 pm
by c4s
Thanks for fixing it.

Re: SpotFX Lib - Retro Sound Generator

Posted: Tue Jul 13, 2010 12:30 pm
by PHP
Is it possible to add a "SaveSound()"-function like in the other generator from Demivec?

Re: SpotFX Lib - Retro Sound Generator

Posted: Tue Jul 13, 2010 2:15 pm
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.

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed Aug 11, 2010 10:13 am
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?

Re: SpotFX Lib - Retro Sound Generator

Posted: Wed Aug 11, 2010 1:43 pm
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.

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Aug 12, 2010 4:23 pm
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.

Re: SpotFX Lib - Retro Sound Generator

Posted: Thu Aug 12, 2010 6:27 pm
by c4s
Phil, thank you again for fixing this and even adding a new option!

Re: SpotFX Lib - Retro Sound Generator

Posted: Fri Aug 13, 2010 12:56 am
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

Re: SpotFX Lib - Retro Sound Generator

Posted: Fri Aug 13, 2010 8:35 am
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.

Re: SpotFX Lib - Retro Sound Generator

Posted: Fri Aug 13, 2010 9:26 am
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.