This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using GCC for "real-time" compilation in audio engine development


Hello

I would like to implement a sort of graphical programming environment
for audio engines, where signals from various sources (e.g soundcard
input, sampled data, MIDI controlled software oscillators) can be routed
through various kinds of simple functions and logic (which could make up
frequency filters, effects like reverb/chorus, etc.), and end up at a
destination (e.g soundcard, WAV file). This would in many ways be
similar to the concept of modular analogue synthesizers.

The simple functions/logic could be converted to assembly code by
interfacing with GCC's back-end, assembled, linked, and the resulting
.so file loaded into memory and executed for real-time usage and/or
testing. This would give fast code, both because of GCC's tree
optimization and the fact that the code is native rather than
interpreted. At the same time the program would be portable, because of
the number of platforms GCC can generate code for. In addition, the code
could be cross-"compiled" (cross-generated?) for embedded/signal
processors supported by GCC now or in the future, after the user is
satisfied with how the audio engine works on his/her computer. (For this
step, only generating assembly code would probably be sufficient.)

Ideally, most of this would happen in the background as the user designs
the audio engine, so that at any time the signal structure is valid, the
user can experiment/test by playing keys on a MIDI controller or
whatever is prefered. Cross-compiling would of course be done manually
in the end.

The big question is, can this be done using GCC in it's current form,
without altering big parts of the code? Could support for different
architectures (for cross-compilation) be loaded dynamically, or coexist
in the same executable? I have read some documentation on the internals
and experimented with treelang, but so far most of it seems to be geared
towards supporting one platform (and for that matter one language) in
each executable.

Last but not least, what documentation and/or examples should i start
reading? Treelang only shows how to use parts of the back-end (and in a
funny way), and relies on code borrowed from the C front-end for the
rest. (Which I have trouble following, it's hard enough to figure out
what's going in treelang with a text parser in the way.)

Hopefully this description is accurate enough, but please ask if
something is unclear. Any help/tips/pointers to docs/code/anything
relevant is most welcome.

Best regards
Torgeir


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]