It is currently Sat May 25, 2013 5:31 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: PBSpotFX_Demivec v1.5
PostPosted: Tue Dec 15, 2009 8:33 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
This is a program that is more or less a direct conversion of 'sfxr' written my Tomas Pettersson (DrPetter).

It differs from the version implemented by pjay found here and so I thought I would put it in its own thread to avoid confusion.

pjay's works great but I was interested in the original program's ability to control the sound being generated as well as having certain sound types that could be generated more quickly with only a single button push. That's why I produced this version (in 3/9/2009).

I was delayed a little as I worked on a custom sliderGadget to use for input. I learned a great deal in the process and will post that soon in the Tips and Tricks forum. It works well for this utility though admittedly things could have no doubt been done in a simpler way. :wink:

The last feature I wanted to add was a visual display for the sound being generated. I finally finished the details on that. It doesn't compare to pjay's but it works and that will have to do for the moment.

The file requires PureBasic v4.40 (though not by much). All source is included. It requires windows because of my custom sliderGadget and has only been tested with 32-bit x86.

I hope you find it useful. Simply compile the code and start off by pushing some buttons.

Image

The file can be found here.

_________________
Image


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 12:01 am 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1568
Location: Germany
This looks really great!

But at first I missed a clear structure that enables me to generate my sounds. A procedure with an sound settings structure as a parameter or so.
Tomorrow I will take a deeper look at it because maybe I have missed it in this short time. ;)


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 12:07 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
c4s wrote:
This looks really great!

But at first I missed a clear structure that enables me to generate my sounds. A procedure with an sound settings structure as a parameter or so.
Tomorrow I will take a deeper look at it because maybe I have missed it in this short time. ;)


Do you mean you would like to generate the sounds by specifying their parameters? That is something that is not implemented with this utility but I think could easily be done. That would allow you to generate sounds for use in a program instead of including them as binaries or otherwise, thus saving a few megabytes of storage for each one. It deserves to be looked into a little more.

This utility simply generates the sounds randomly or from settings and then allows them to be exported to a wav file.

_________________
Image


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 7:24 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 2704
I don't see any of your custom sliders being drawn and the jiggling-line-display (the thing with the black background) doesn't animate.

I'm using Windows 7 x64 and compiling with PB 4.40 x86.

_________________
Image


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 9:18 am 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 26, 2003 1:11 am
Posts: 1300
great stuff......thx a lot

_________________
SPAMINATOR NR.1


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 12:24 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Apr 25, 2005 9:28 pm
Posts: 553
Location: $300:20 58 FC 60 - Vietnam
My wish comes true :shock:
Thanks a lot Demivec :D

_________________
“Fear is a reaction. Courage is a decision.” - WC


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 2:07 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1568
Location: Germany
Demivec wrote:
Do you mean you would like to generate the sounds by specifying their parameters? That is something that is not implemented with this utility but I think could easily be done. That would allow you to generate sounds for use in a program instead of including them as binaries or otherwise, thus saving a few megabytes of storage for each one. It deserves to be looked into a little more.

This utility simply generates the sounds randomly or from settings and then allows them to be exported to a wav file.

I would like to use it just like SpotFX from pjay. What I like on your porting is that I'm able to set up every parameter instead of hitting "random" all the time to explore new sounds.

So I don't get the structure of the sound generation code very well.
What procedures do I need for only generating a sound? And is it possible to use it like a normal PureBasic sound or do I have to generate it each time?


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 3:29 pm 
Offline
Addict
Addict

Joined: Wed Aug 24, 2005 8:39 am
Posts: 2559
Location: Southwest OH - USA
Mistrel wrote:
I don't see any of your custom sliders being drawn and the jiggling-line-display (the thing with the black background) doesn't animate.

I'm using Windows 7 x64 and compiling with PB 4.40 x86.


Same config and works fine here.

All I can say is WOW :shock:

cheers


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 5:13 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
I corrected a very small fault in the program dealing with the animated sound display. The corrected version is available for download under the same name and from the same link in the first post.

If you would rather simply make the change yourself instead of re-downloading it. Here's the info:
Code:
;file " PBSpotFX (Demivec) v15.pb"
;change line 675 from
iWidth = ImageWidth(expImage) - 1
;to
iWidth = ImageWidth(expImage)


@Mistrel: The sliders and animated sound display use ImageGadgets. In addition the sound display is drawn to only with PB's 2D_Drawing Library. With that in mind I cannot determine what may be preventing the display of those things.


c4s wrote:
What procedures do I need for only generating a sound? And is it possible to use it like a normal PureBasic sound or do I have to generate it each time?

@c4s: The sound is generated by setting parameters in the structure 's.soundsettings' (sliders) and uses the work structure 'p.playsettings'. The sound is produced in PB by creating a wave file in memory using procedure CreateSpotFXWAV(). This in turn calls the procedure SynthSample() repetively until the wav's sound data is completed.

You can use it like a normal PureBasic sound by using CatchSound() to convert the wav file from the memory buffer. I would like to make this a little easier to do, possibly including a trimming ability to select only a portion of a sound from what was generated. There's no need to wait for me you can take what is available and adjust it to suit your needs. :wink: As I stated this would allow a sound to be used by creating it during runtime and thus keep a file's size very low.


@Rings, flaith, rsts, & others: I am happy to see that this has been well received. :D

_________________
Image


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 7:54 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1568
Location: Germany
Thanks Demivec for the short explanation of (obvious?) your code - It's well done!

One thing about the SliderGadget: When I click on one it is selected (like buttons are). In my opinion this selection line is really confusing but except of this it's great too ;)


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 8:56 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
c4s wrote:
One thing about the SliderGadget: When I click on one it is selected (like buttons are). In my opinion this selection line is really confusing but except of this it's great too ;)


I agree that the selection line can be confusing.

It indicates that you can interact with the slider by using the keyboard also. I considered several ways of indicating that the SliderGadget had keyboard focus and this was the simplest and least intrusive. The SliderGadget responds to the Home, End, Delete, Tab, and directional keys. It can also sport a variety of borders and colors, be made vertical or horizontal and can have the way it responds to directional keys flipped in addition to visually being flipped (like drawing it right-to-left instead of left-to-right).

I shouldn't say too much about it yet (oops, too late :D ). I'm going to post those details later in their own thread. :wink:

_________________
Image


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Wed Dec 16, 2009 9:44 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Jan 02, 2007 8:16 pm
Posts: 4328
Location: Cypress TX
FAN-Frooping-TASTIC!!!! Great work Jared! 8)

I just wish I could somehow set loop length internally! and notes random lngth of time each!

Still playing with it though maybe you can

_________________
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Thu Dec 17, 2009 8:25 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 2488
Location: New Zealand
great


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Thu Dec 17, 2009 9:13 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 2242
Location: Italy
Interesting, I saw this technique used in some programs before and thinked about implementing something similar a day or another... thank you for sharing it. :)

_________________
[ Home ] [ My PC ] [ New to PB ? ]


Top
 Profile  
 
 Post subject: Re: PBSpotFX_Demivec v1.5
PostPosted: Fri Apr 30, 2010 2:47 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Aug 31, 2005 4:49 pm
Posts: 132
I'm in the process of editing your code in order to be able to make into something similar to PJ's code where you can enter the values from a procedure call so that it can make sounds live from within a program.

It will eventually be split into 2 programs.. first one similar to this that can also display the call and values needed to generate the wave .. the other to be a procedure to play it in your program.

the difference i'm hoping to achieve is that instead of in PJ's case where they put in a random seed .. that you'll be able to use your export and use your .sfs data into end program or by adding that data to a procedure call

thus making it a similar command to those of the retro languages.

in doing so i've noticed that when you press random that at least some of the sliders that you have set up for only posative adjustments are at times displaying Negative values.

is this correct.. or are they actually or should they be converted to Posatives or ignored(IE: set to 0) when creating/playing the sound

eg: attacktime , decay time , vibrato depth

I hope you can follow what i'm attempting to do. (yeah i know i'm jumping in at the deep end again)
any help in this project of mine would greatfully be accepted


you can d/load a copy of my edited file from here
http://www.codingmonkeys.com/index.php?action=tpmod;dl=item272

remember its still a work in progress and things WILL DEFINATLY change

changes so far .
Displays Values of the settings beside the sliders
added use of consolas ( size 8 ) font
touched up layout of screen
added SELECT/COPY/PASTE box (hopefully to be used later.. already generating sample syntax with correct values.. order of which WILL change)
made displayed waveform on play larger

Comments and Edits (to tidy up my code) appreciated

_________________
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic


Last edited by Blue Steel on Sun May 02, 2010 11:54 am, edited 2 times in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye