View previous topic :: View next topic |
Author |
Message |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
How to import BTc sound data into CCS? |
Posted: Sun Aug 22, 2010 12:14 pm |
|
|
Does anyone have a good way to import sound files such as those created by Roman Black's BTc 1 bit Sound Encoder into a CCS program? Roman show an example with 16 sound samples, but I need to use a few hundred samples.
This 2 year old link from the code library is broken.
_________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Aug 22, 2010 1:33 pm |
|
|
A search with Google shows that ratgod has been active on the Sparkfun,
Instructables, and Avrfreaks forums as late as July 2010. You could try
to contact him there. |
|
![](templates/subSilver/images/spacer.gif) |
mindstorm88
Joined: 06 Dec 2006 Posts: 102 Location: Montreal , Canada
|
|
Posted: Mon Aug 23, 2010 10:46 am |
|
|
I have that program !! PM me your e-mail, i will send it to you , it is only 350K |
|
![](templates/subSilver/images/spacer.gif) |
MikeW
Joined: 15 Sep 2003 Posts: 184 Location: Warrington UK
|
|
Posted: Fri Aug 27, 2010 1:52 am |
|
|
I also have it, so pm if needed |
|
![](templates/subSilver/images/spacer.gif) |
RoGuE_StreaK
Joined: 02 Feb 2010 Posts: 73
|
|
Posted: Fri Aug 27, 2010 5:47 am |
|
|
What kind of sound are you trying to produce? I'm doing 8bit PWM stuff, have it working at 16kHz nicely on an 18F2620@20Mhz non-PLL, so a lower frequency is even more doable, doing it interrupt-driven so you can do other stuff without interfering with the playback frequency, biggest sample I'm currently using is a couple of thousand samples long and I'm only using about 20% of the memory. Sound output is quite good quality.
I'm taking the samples into CCS as multi-dimensional arrays, just down-sampled my synthesized audio to 8bit 16kHz using any old audio editor, then got the hex data by using a special text editor, can't remember which programme exactly at the moment as it's on another machine, essentially you just have to find and delete the header and footer data, all the rest is your audio data ready to copy and paste after some search and replace (adding "0x" leaders, delineating commas, line breaks, etc).
I'm doing mixing of samples, so have have to shift the samples up/down x amount and do division/multiplication etc to get the volume mix right. But mostly doing static 50/50 mixing of two samples, so you can save the processing required and just incorporate the volume and baseline shift into your original samples and do a straight addition (ie. samples range from 00 to 128, with the baseline located at 64; the two micing samples add together to give a volume range of 0 to 255, with the baseline at 128).
System is still a work in progress, trying to dynamically change the mixing based on other inputs, but have hit some bumps in trying to figure out what kind of data those inputs are going to be giving. |
|
![](templates/subSilver/images/spacer.gif) |
|