Re: Thunderbolt port audio programmability

2020-03-21 Thread Jens Alfke via Cocoa-dev

> On Mar 20, 2020, at 8:00 PM, Carl Hoefs  
> wrote:
> 
> when the AU subsystem renders this data, it ignores the offset and generates 
> a "corrected" X-axis-centered audio signal anyway

Interesting ... I guess there’s filtering or normalization going on at some 
stage (in software or in the DAC hardware itself.) But this is way out of my 
depth.

I’d ask on the coreaudio-dev list, if it still exists, or the equivalent area 
of Apple’s dev forum.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-20 Thread Carl Hoefs via Cocoa-dev
Thanks for all the helpful insights and links.

At this point, I'm using Audio Units in my iOS test app. I can generate signals 
of specific type, frequency and amplitude. That was the easy part...

However, a hard requirement is that the app must generate what amounts to 
'DC-offset' signals (fully offset from the X-axis). Specifically, for a set 
period of time, the signal needs to be offset fully above the X-axis (a fully 
'positive' signal), and then for a set period of time be offset fully below the 
X-axis (fully 'negative'). This cyclic pattern repeats indefinitely. (Yes, 
strictly speaking, these aren't 'audio' signals any longer; they're actually 
biological stem-cell stimulation signals.)

I generate the AU waveform data according to:
  sample = (sin(theta) * amplitude/2) + amplitude/2; // e.g., sine wave offset 
positive
  sample = (sin(theta) * amplitude/2) - amplitude/2; // e.g., sine wave offset 
negative
...and I've verified that this results in the correct offset values in the AU 
buffer. But when the AU subsystem renders this data, it ignores the offset and 
generates a "corrected" X-axis-centered audio signal anyway, which is useless 
for my purpose.

Is this sort of thing possible to do with Audio Units? AVFoundation?

-Carl


> On Mar 17, 2020, at 10:19 PM, Jens Alfke  wrote:
> 
> If you want to make more than sine waves, there are a bunch of open source 
> audio libraries/programs for generating arbitrarily fancy waveforms — CSound, 
> Pure Data, Max, Supercollider... These are usually used for music synthesis, 
> but most of them let you do general purpose DSP type stuff. And of course 
> they handle the audio output too.
> 
> https://en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments 
> 
> 
> —Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-17 Thread Jens Alfke via Cocoa-dev
If you want to make more than sine waves, there are a bunch of open source 
audio libraries/programs for generating arbitrarily fancy waveforms — CSound, 
Pure Data, Max, Supercollider... These are usually used for music synthesis, 
but most of them let you do general purpose DSP type stuff. And of course they 
handle the audio output too.

https://en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments 


—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-17 Thread Daniel Waylonis via Cocoa-dev
I think AVFoundation is probably the easiest way to get started.

There’s a pretty good sample on how to do it:

https://developer.apple.com/documentation/avfoundation/audio_track_engineering/building_a_signal_generator
 


Dan
-
Dan Waylonis | nekotech.com
650.887.3711



> On Mar 13, 2020, at 3:51 PM, Jens Alfke via Cocoa-dev 
>  wrote:
> 
> 
> 
>> On Mar 12, 2020, at 5:31 PM, Carl Hoefs  
>> wrote:
>> 
>> In iOS, what is the current way to generate precise audio tones? 
>> AVFoundation? CoreAudio? AudioUnits?
> 
> AudioUnits. It's been a long time since I worked with that API, but I'm 
> pretty sure I recall some sample code showing a generator AU that emits a 
> sine wave.
> 
> —Jens
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/danw%40nekotech.com
> 
> This email sent to d...@nekotech.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-13 Thread Jens Alfke via Cocoa-dev


> On Mar 12, 2020, at 5:31 PM, Carl Hoefs  
> wrote:
> 
> In iOS, what is the current way to generate precise audio tones? 
> AVFoundation? CoreAudio? AudioUnits?

AudioUnits. It's been a long time since I worked with that API, but I'm pretty 
sure I recall some sample code showing a generator AU that emits a sine wave.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-13 Thread Gerald Henriksen via Cocoa-dev
On Thu, 12 Mar 2020 10:27:25 -0700, you wrote:

>I'm looking at creating an iPhone/iPad app that acts as a dual-channel 
>waveform generator. 
>
>I see two options for the output signal medium: 
> (a) using the audio jack (on suitable devices), or 
> (b) using the Thunderbolt port

As already noted in other messages, there is no Thunderbolt port (at
least not yet).

But you can't assume a lightning connector/port either, as the iPad
Pro's use a USB-C connector/port.

So depending on the use you envision, you might be best going with
whateaver audio is available whether it is an audio device connected
through the lightning/USB-C ports or via Bluetooth.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-12 Thread Carl Hoefs via Cocoa-dev

> On Mar 12, 2020, at 11:13 AM, Jens Alfke  wrote:
> 
> 
>> On Mar 12, 2020, at 10:27 AM, Carl Hoefs via Cocoa-dev 
>> mailto:cocoa-dev@lists.apple.com>> wrote:
>> 
>> I'm looking at creating an iPhone/iPad app that acts as a dual-channel 
>> waveform generator. 
>> 
>> I see two options for the output signal medium: 
>> (a) using the audio jack (on suitable devices), or 
>> (b) using the Thunderbolt port
> 
> Wait … you mean Lightning, right? That's the dock connector on iOS devices. 
> Thunderbolt is a super-high-speed data connection on Macs.
> 
> On devices without a headphone jack, you can use the $10 dongle that plugs 
> into the Lightning connector and has a headphone jack on the other end.

[Yes, I meant Lightning. But since it's a serial digital bus, it won't be able 
to issue the generated waveform signals directly, so the audio port would seem 
to be the way to go.]

In iOS, what is the current way to generate precise audio tones? AVFoundation? 
CoreAudio? AudioUnits?

-Carl


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thunderbolt port audio programmability

2020-03-12 Thread Jens Alfke via Cocoa-dev


> On Mar 12, 2020, at 10:27 AM, Carl Hoefs via Cocoa-dev 
>  wrote:
> 
> I'm looking at creating an iPhone/iPad app that acts as a dual-channel 
> waveform generator. 
> 
> I see two options for the output signal medium: 
> (a) using the audio jack (on suitable devices), or 
> (b) using the Thunderbolt port

Wait … you mean Lightning, right? That's the dock connector on iOS devices. 
Thunderbolt is a super-high-speed data connection on Macs.

On devices without a headphone jack, you can use the $10 dongle that plugs into 
the Lightning connector and has a headphone jack on the other end.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Thunderbolt port audio programmability

2020-03-12 Thread Carl Hoefs via Cocoa-dev
I'm looking at creating an iPhone/iPad app that acts as a dual-channel waveform 
generator. 

I see two options for the output signal medium: 
 (a) using the audio jack (on suitable devices), or 
 (b) using the Thunderbolt port

Q: Is there a Cocoa framework for programming the Thunderbolt port? Can it 
output raw frequencies or does it function as a serial data port only?

Q: Is there a Cocoa framework for generating sine/square/triangle waves at 
precise frequencies and output currents (0.1-1000Hz, 50-500ua)?

Thx!
-Carl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com