Re: [linux-audio-dev] Using Jack for Control Volt continued

2003-11-10 Thread Fred Gleason
On Sunday 09 November 2003 03:11, Paul Winkler wrote:

 Most audio circuits include coupling capacitors that block
 DC voltages. Transformers work too.  I would be amazed if any soundcard
 will pass a DC voltage.

I know of at least one manufacturer (Digital Audio Labs, 
http://www.digitalaudiolabs.com/) that makes cards capable of this, although 
even there you need to set an internal jumper to enable it (default=DC 
blocked).  I'm told that this is because their products are frequently used 
in general-purpose instrumentation setups, as well as strictly audio 
applications.

Cheers!


|-|
| Frederick F. Gleason, Jr. | Director of Broadcast Software Development  |
|   | Salem Radio Labs|
|-|
|  Some people say a front-engine car handles best.  Some people say a|
|  rear-engine car handles best.  I say a rented car handles best.|
|  --P.J. O'Rourke|
|-|



Re: [linux-audio-dev] Using Jack for Control Volt continued

2003-11-10 Thread Iain Duncan
Thanks for the all the interesting responses. I did some thinking and a few
experiments, and I think the best way to do it would be to use an amplitude
modulated sine ( actually triangle ) wave at one have the nyquist, precisely
1/4 of sample rate. Here's why I think this:

At half nyquist, we have exactly four samples always per full wave. This
means any sample is either a peak ( our desired data ), or a zero. It also
means sine wave and triangles look exactly identical, and geometric
production of the wave as a triangle will work perfectly, while production
of the wave as a sine will get forced into a triangle shape. At the nyquist,
the wave is either all peaks or all zeros, so that's no good because most
digitial synthesis wave generators will start at 0 phase, meaning we get all
zeros and no data! We could force everyone to use nyquist with phase 90%,
but I think that makes things needlessly difficult to generate and
represent.

At frequencies other than half nyquist, we get long range distortions if a
sine wave is used, ( try it out, I never realized just *how* lame 48khz is
until trying this! )  but at half nyquist sines and tris are the exact same
so it should be easy for any app to generate these perfectly. The same holds
true for quarter nyquist, eight, etc, which could be optional for lower res
signals, but I can't think of any advantage to using lower than 1/4 sr. Pipe
up if you can please. I think the recomendation should be: Use a triangle
if you are not absolutely positive the frequency calculation is perfect. If
you know it is precisely 1/4 sr, use a sine or a tri.

At half nyquist, it should also thus take only 2 samples to get the data,
and it seems to me ( though I'm no DSP programming expert by *any* stretch )
that this should make demodulating very simple. The needed control data can
be reached by a two sample sample-and-hold, or a conditional evaluation that
just checks whether the data is not 0, or an averaging equation on any power
of 2 samples range ( ie the average amp of four samples multiplied by two
gives us the control data. )

Our peak control rate is thus 1/4 sample rate, which is high enough for nice
sounding amplitude envelopes, and if less is needed the same frequency wave
can be either modulated or demodulated at a lower resolution. As long as the
window is a multiple of 2, we should get good accuracy.

Further, this would I think allow easy hardware integration as standard
sound cards can be used, again demodulation should be straightforward for
outboard gear ( easy microcontroller programming again with the 2 sample
sample and hold for example ) and we don't have to worry about telling
people to be careful with potentially dangerous DC signal.

And . . . we already have a plethora of gear and software that at the very
least allows automation of volume. This way that facility can be bastardized
to become whatever we want. This also looks nice in standard wave views, a
nice graphic view of the data is clear as a block of solid colour in most
viewers.

I am interested to hear any and all feedback of course.
Thanks,
Iain Duncan



Re: [linux-audio-dev] Using Jack for Control Volt continued

2003-11-10 Thread Jack O'Quin
Iain Duncan [EMAIL PROTECTED] writes:

 Thanks for the all the interesting responses. I did some thinking and a few
 experiments, and I think the best way to do it would be to use an amplitude
 modulated sine ( actually triangle ) wave at one have the nyquist, precisely
 1/4 of sample rate. 

Why modulate at all?  

You can represent the voltages directly or proportionally.

Note that making everything a function of the Nyquist frequency causes
a shift when running at different sample rates.
-- 
  joq


Re: [linux-audio-dev] Using Jack for Control Volt continued

2003-11-09 Thread Paul Winkler
On Sat, Nov 08, 2003 at 07:50:22PM -0800, [EMAIL PROTECTED] wrote:
 Sorry, forgot to ask a couple of things. 
 
 Will Jack or other similar APIs allow passing of DC signal?

jack doesn't care what kind of signals pass through it.

 If so, do we have 
 to worry about speakers blowing up or do soundcards protect against DC? 

Most audio circuits include coupling capacitors that block
DC voltages. Transformers work too.  I would be amazed if any soundcard
will pass a DC voltage.

 If not, can anyone tell me what the most CPU efficient way of 
 modulating/demodulating a control signal might be? It occured to me that one 
 could just use a very high frequency signal

remember that nyquist theorem limits the frequency to half the 
sampling rate.

 

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's ANCIENT COWARD!
(random hero from isometric.spaceninja.com)


Re: [linux-audio-dev] Using Jack for Control Volt continued

2003-11-09 Thread David Olofson
On Sunday 09 November 2003 09.11, Paul Winkler wrote:
[...]
 remember that nyquist theorem limits the frequency to half the
 sampling rate.

OTOH, if there's only one control per channel, one could just modulate 
with a sine at Nyqvist, and demodulate using fabs(sample). For two 
signals at half the sample rate, use the sign to determine the signal 
subchannel when demodulating.

However, as long as you stay digital, there should be no need for 
modulation of control signals. AFAIK, JACK doesn't process the audio 
data in any way in between clients.

You most probably *do* need to modulate if you need to go analog, 
unless you use modified sound cards or industrial AD/DA boards for 
the I/O. You'll have to use lower frequency carriers for analog I/O, 
as anything at Nyqvist will probably (should!) be totally eliminated 
by the converters.


//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality ---.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`--- http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---