[sdiy] New to list - and DSP development
Kenneth Elhardt
elhardt at worldnet.att.net
Sun Dec 12 06:20:26 CET 2004
I'm way behind on e-mail, but I wanted to thank those for responding.
Ryan Williams writes:
>>I have a small amount of experience writing soft synths for a PC but I
think it should be about the same on the mac. I use PortAudio for C<<
I downloaded PortAudio a few weeks ago. I'll have to take a closer look. I
was hoping not to have to use somebody elses library that hides me from the
underlying workings, but perhaps it will still work for me. Usually those
libraries are more convoluted than just doing things myself with standard OS
calls. I just wish I knew what OS functions they were using.
Andreas Gaunitz writes:
>>The number refers to the communication rate between the MIDI interface and
the computer. The actual midi signal (after the i/F) is still midi standard
rate.<<
That's what I've always thought, but was thrown off when Inside Mac only
showed the serial ports going up to about 57K Buad. That's quite far off
from 2MHz. Perhaps there's another way to set the port speed I've missed.
KA4HJH writes:
>>OS 9--possibly but you'd be re-inventing the wheel. Almost all MIDI apps
are using OMS or FreeMIDI already so you might as well support them. I
remember some older apps having direct access to the MIDI port but they were
probably written back in the 7.5.x days.<<
I was thinking about OMS, but sometimes it's more of a pain to use somebody
elses bloated and complex library when all I need is to read in a stream if
Midi data and that's all. It's only for prototyping my algorithms for later
use on DSP hardware, not as a shipping software product, so I don't need to
be compatible with anything else. Direct MIDI port access is what I'd
really like. The Inside Mac series talks about Midi, but it's all about
Midi from a file, not an input port.
>>And remember that no Mac made in over five years even has a serial port in
this classic sense--you'll have to use USB or FireWire, or rely on a USB to
"serial" adapter.<<
Both of my external Midi interfaces use the serial port. I do have a modem
port to serial interface on my G4 so no problem there.
Brightboy writes:
>>Sounds like you need to join the Music-DSP mailing list....<<
Thanks for the tip. I'll check it out.
Paul Maddox writes:
>>well, thats the hard part, thats what aliasing in softsynths/VAs is all
about. You can write the data to an output buffer at whatever speed you
want, but if theres too much in there you get harmonic frequency inversion,
or aliasing..<<
Actually, aliasing shouldn't have anything to with what I'm talking about.
No matter what, I'll only be calculating and outputting data at 44.1KHz.
It's just that if I want to process one sample at a time and then output it,
I was just wondering about how I know when the last sample has already been
sent to the DAC so I can load up a new sample. When looking at the
Chameleon developer kit, they had one example that just takes a sample from
the audio input then sends it right out to the output with only a one sample
delay. Just not sure how to do a similar thing on a PC.
ASSI writes:
>>You would use at least three buffers: one that is currently playing, one
that is queued for swap with the one that is currently playing when
it's played back to the end and the third that you fill. Size and
number of the buffers depend on the interrupt rate the OS allows you to
use and how much variance you have in the interrupt latency for the
sound producer thread. The buffer swapping needs to be a very tight and
high priority interrupt routine, <<
Thanks for the more technically oriented info. On the Mac or PC I'll have
plenty of free time where the processor it just waiting so I don't want to
have to resort to interrupts. I just plan on polling whatever I need until
a buffer is done playing. I guess that will limit the speed of my code to
the audio throughput rate needed. I just hope the OS will let me know when
one buffer is finished so it can be swapped before the next stream of
samples is needed, or whether it can start the queued sound on its own, or
whether I specifically need a callback function to do it. Since nobody
really knows for sure I guess I'll have to experiment on my own.
-Elhardt
More information about the Synth-diy
mailing list