Quote:
> Help/advice please...
> A musician friend of mine has asked me if I can
> write a program
> "to read and analyse soundcard input signal
> data to calculate the 'beats per minute'."
> Oh and I would like to be able to port the finished application to
> the mac as my friend uses one (I have a pc)
> (but if I could get even half way to solving this I'd be happy!)
Hi "Steve Rollings",
You are confonted with a very difficult and almost impossible problem.
I would guess that the complexity of the problem is much higher then
you have extimated.
Standard C has the advantage of portability, but to maintain this
portability, it does not caontain system specific extensions.
Specifically there is *no* support for acessing sound cards in standard
C. You will have to use special compiler and/or operating system
extensions to do this. These extensions are however in no way portable
between different systems, ie. PC and MAC.
It is not possibly (AFAIK) to access sound hardware the same way on
PC and MAC, short of using some kind of emulator.
The professional approach would be to seperate the program into two
parts: the portable code containing everything which can be done in
ANSI-C and the system dependant stuff, which has to be different for
each system you port your program to. In your case you would need two
different implementations for the system specific functions: one for
PC and one for MAC.
But this is only an idealised top level approach. It gets much more
compilcated when you get down to the details. One important rule is
to find out and avoid anything which can't be done on one of the
target systems. When trying to use system specific extension on
multiply target systems, this often proves to be the most difficult
if not impossible to solve problem.
Stephan
(self appointed member of the campaign against grumpiness in c.l.c)
Quote:
> I guess there must be several programs like this available as shareware,
> If I can find one, can I convert the .exe back to 'c' code? How?
> (I bet that's a silly question and I should know the answer already...)