CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How to import BTc sound data into CCS?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

How to import BTc sound data into CCS?
PostPosted: Sun Aug 22, 2010 12:14 pm     Reply with quote

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.
ratgod wrote:
I have created a small program to convert the MikroC C files that are exported from BTc to C file that you can just #include into your code

http://home.cogeco.ca/~ratgod/BTC2CCS.exe


_________________
The search for better is endless. Instead simply find very good and get the job done.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Aug 22, 2010 1:33 pm     Reply with quote

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.
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 10:46 am     Reply with quote

I have that program !! PM me your e-mail, i will send it to you , it is only 350K
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 1:52 am     Reply with quote

I also have it, so pm if needed
RoGuE_StreaK



Joined: 02 Feb 2010
Posts: 73

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 5:47 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group