Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Create sounds - with no media.

Author
Message
Darkbasic MADPSP
18
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 16th Aug 2005 19:53
ric can i edit your original then repost it?

Love games go to http://www.freewebs.com/halorc
or
http://www.freewebs.com/gamersmad
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 17th Aug 2005 02:05
@ Xtom: That's great - good work!

Couple of suggestions for extending/improving if you are interested in taking this further: Firstly, making it so that clicking on the up and down arrows make increments/decrements of values smaller than one (for some of the variables) would be useful - for example, on the bend variable, it would be better to go up and down in 0.1's than 1's.

Secondly, for user-friendliness, an 'export code' feature would be really useful for people who want to incorporate their sound(s) and the create sound function into their program, rather than having to trawl this thread for the relevant bits of code, and then having to merge the dbs file with the code. (They could of course use the save as wav and load that into their program, but that defeats the object of the whole media-free sound principle!)

@DBmad: Of course - you can play around with the original code however you like.



Darkbasic MADPSP
18
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 17th Aug 2005 13:44
Thanks ric i've got a post on music visuals would you be able to help with that thanks

heres the link

http://forum.thegamecreators.com/?m=forum_view&t=59166&b=1

Love games go to http://www.freewebs.com/halorc
or
http://www.freewebs.com/gamersmad
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 18th Aug 2005 19:27 Edited at: 18th Aug 2005 19:32
Ric, I've made some of the up/down buttons move in 0.01 amounts and I included a dba file with the download which contains the create sound function. When you save a .dbs sound file the last line in the file is the function call which you can copy and paste into the dba file or your own program etc.

I also added the attack code you had a couple of posts back, which wasn't in the first version even though it had the field. So many code snippets I missed it.


I updated the download in my first post.

And here's the version of code I'm using for create_sound(), it's also included with the program.



Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Aug 2005 15:37
<Update>

As this project has grown, with thanks to the community here, it's become difficult for new people to the thread to find the latest working version, and understand how to use it (according to the people that emailed me, anyway!)

So, please check out the first post in this thread for the latest version, a link to Xtoms editor, and easy to follow instructions for use!


@Xtom: Thanks for your work on the editor. Just a couple of things - could you alter the fields for decay and attack, so that they can take values up to 10, please? You'll notice a couple of the example sounds in the first post need values higher than the permitted value of one. Also, could you change the initial value for decay from 0 (which produces silence) to 1, so that it produces a simple sound to begin with? Cheers.

xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 20th Aug 2005 18:06
Decay and attack can now be increased to 10 and I increased bend up to 20 too. I noticed some of the bend values are minus values on some of the sound effects but the same positive values seem to give identical sounds so I left it 0-20

I updated the download, same link as before.

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Aug 2005 18:58 Edited at: 20th Aug 2005 19:55
Thanks Xtom - couple of snags still, though:

The attack seems to be saving values of zero regardless of what shows in the field. Also, negative values of bend are necessary, as for small values it gives very different results from positive values - eg bomb drop: negative bend, power up: positive bent.

Now, here's the next suggestion for you if you haven't had enough yet!! Notice a couple of the demo sounds I made, like the vibrato chord and the cowbell, are made up of more than one sound played simultaneously? The gui at the moment allows for creation and saving of only one 'channel'. How easy/hard would it be to add another couple of 'channels' to the gui, (each the same as the one you already have) and give each one a tick box to enable/disable that channel when the 'play' button is clicked? And then to save the ticked channels, with all the createsound() function calls, to a single file? Would it be much more than a copy and paste job to do this? I'm thinking that a three-band oscillator should be a pretty powerful synthesiser.

Cheers,

Ric.

(p.s. - or, if you're sick of this yet(!) you could email me the gui (rainbow file?) and source code, and I'll pick up from where you've got to. )

xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 20th Aug 2005 20:48
I fixed the attack value not saving. And I think the reason I couldn't tell the difference between the minus and positvie bend is because of the rounding function I'm using, I think it screws up with minus values so I'm going to have to fix it. I have added a generate random sound button now too which is working well. I'll upload a new version when I get it all sorted.

I see what you mean with the different channels. Would it be possible to save the combination of all sounds as a wav file too? If so how would I do that or can someone post the code to do it. Also how many channels would be best?

xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 20th Aug 2005 22:56
OK I've uploaded the program again and updated the screenshot above. Same link again. It now has a random button to generate random sounds and I fixed the things you mentioned Ric.

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Aug 2005 23:22 Edited at: 21st Aug 2005 01:08
Thanks! I've updated the first post with a link to the latest editor. Like the random sound feature too. Playing around with the attack and decay values, though, didn't produce the sounds I expected. They're doing something - but I'm going to have to go back and look at the code again and do some tweaking. As for mixing channels to a single wav - it's possible, but I'll have to think about it! I'll let you know as soon as I know. I think 3 channels would be good, btw.

Cheers.

NoteJam
19
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 22nd Aug 2005 19:06
I have been reading about the program acoustic mirror. They some way play a sound, and record a sound, and get the accoustic effects from the difference of the played sound, and the recorded sound.
Then thay can apply those acoustics to any wave.

So think this might work for you to get the wave right. Instead of messing with a parameter, which might not vary enough, try making a wave without reverb or what ever. Then use a program like sound forge or a vst reverb to add reverb. Then take the difference between these two waves and find out what really goes on in such a wave. Then you have what you need to know to add it as an effect, I think, Hopefully its not more complicated than that to do what the acoustic mirror program did.
But you also will likely gain other abilitys too, like be able to model the wave as played from different amps, etc. You might need a team for this. Send them a wave, have them play it through their amp and record it. Then they send it back to you.

I think we all most likely have computers fast enough for this method, as it says acoustic mirror works on 200 mhz machines but 400 mhz is recommended.
Be real cool if you or someone can get it to work.
Krimzon DestinE
18
Years of Service
User Offline
Joined: 18th Sep 2005
Location:
Posted: 27th Sep 2005 02:13
Is this only for DBC or something because as soon as it runs in DBPro, it closes.

Login to post a reply

Server time is: 2024-05-08 03:13:20
Your offset time is: 2024-05-08 03:13:20