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.

Work in Progress / Dark Basic Music Synthesizer

Author
Message
Rapidrory
14
Years of Service
User Offline
Joined: 21st Aug 2009
Location:
Posted: 18th May 2010 23:39 Edited at: 19th May 2010 20:10
Ok, so its not nearly finished yet, but I've been working on a music synthesizer in Dark basic pro, where you enter music in a .txt file, and get an 8-Bit style .Wav file.

I have the basic compiler working, and the music can be in sine wave or sawtooth wave. I have added simple harmonics, and you can have up to 6 notes playing at once.

I plan on finishing off the harmonics so you get varied instrument sounds rather than different tones, adding a few more features like tempo and pitch variables, and adding a proper interface, so it is easier to use.

It also has a glitch atm that causes the .wav file to become corrupt at the very end of the song. I know what is causing this error, but i haven't found out how to correct it as of yet. The music still plays, just stops just at the end with an error in windows media player.

I'll explain roughly how the music works, here's a sample:





The E and G part tells you what note it is, the # and . tells you if its sharp or not. The 1 and 2 tells you what octave it is (the octaves go 2,1,0,9,8 with 2 being the highest and 8 the lowest). The 1,4 and 3 on the line below is the length of the note, with 4 being one whole beat. 000 just means a rest, and the bit saying B1 just above is just a Rem line, where bar numbers can be put. the bit saying 'Music' is the name that's given to the .Wav file.

I have included a few examples, so have a play around and see what you think.

There is no such thing as "Too Fast!"

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th May 2010 15:32
Cool, I'm hoping it's something like the sound effect generator I used on my game "Iridium"!! Downloading!

BearCDP
14
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 20th May 2010 21:41
Sweet! Are you actually writing individual samples to a memblock with the math functions and creating the .wav out of that?

Check out this WIP flash game from the Global Game Jam!
Rapidrory
14
Years of Service
User Offline
Joined: 21st Aug 2009
Location:
Posted: 20th May 2010 23:48 Edited at: 20th May 2010 23:49
No, just using a standard "open to read" command to open a .wav and then writing in the relevant data using the usual commands (i am yet to master memblocks) . The variable that's causing the file to corrupt is the one that defines the length of the .wav, which i have yet to calculate accurately. Hopefully work it out soon though (my maths is some what trial and error )

There is no such thing as "Too Fast!"
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th May 2010 09:09
Length = samples * channels * (bitsPerSample / 8).
Good luck

Login to post a reply

Server time is: 2024-04-20 00:21:27
Your offset time is: 2024-04-20 00:21:27