Would Jackit be suitable for this?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Would Jackit be suitable for this?

Shiv Jairam
Hey all,

I plan on writing a audio program under linux using C. The program should read a continuous input sound stream, and output that very stream, but with a slight delay (delayed auditory feedback).

I have done quite a lot of program under linux and I'm very well acquainted with C. I can use file descriptors and the like. But I'm still at a loss as how to approach this. Maybe its because I've never done any sound programming before.

I've been doing some research and came across Jackit. Would this API suffice for my needs?

Can anyone offer some tips, tutorials, etc? Any guidance is welcome. Maybe even some example code :)


Thanks.
--
Shiv Jairam

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Would Jackit be suitable for this?

Daniel James-2
Hi Shiv,

> I plan on writing a audio program under linux using C. The program should
> read a continuous input sound stream, and output that very stream, but with
> a slight delay (delayed auditory feedback).

I suggest checking out the LV2 plugin standard, which you could use as a
starting point for your own efforts:

http://lv2plug.in/

There are several delay plugins available in the SWH set:

http://plugin.org.uk/lv2/

Personally, I use the Tape Delay Simulation plugin with good results. I
use this with Ardour and JACK, but you could try a simpler JACK host
such as JACK Rack:

http://jack-rack.sourceforge.net/

Cheers!

Daniel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Would Jackit be suitable for this?

Fons Adriaensen-2
In reply to this post by Shiv Jairam
On Tue, Jan 08, 2008 at 10:32:25PM -0500, Shiv Jairam wrote:

> I plan on writing a audio program under linux using C. The program should
> read a continuous input sound stream, and output that very stream, but with
> a slight delay (delayed auditory feedback).
>
> I have done quite a lot of program under linux and I'm very well acquainted
> with C. I can use file descriptors and the like. But I'm still at a loss as
> how to approach this. Maybe its because I've never done any sound
> programming before.

It's not clear what exactly you want: fixed delay or variable, single
channel or multi, GUI required or not, etc. etc.

Anyway, there are lots of programs that will do this without
requiring any C programming. This includes all the EA-music
composition tools (SuperCollider, Pd, Csound), various
soft synths, and various plugin hosts.

> I've been doing some research and came across Jackit. Would this API suffice
> for my needs?

It's sufficient for all 'serious' audio on Linux, including some
*very* complex applications. So probably the answer is 'Yes'.

> Can anyone offer some tips, tutorials, etc? Any guidance is welcome. Maybe
> even some example code :)

The main things to know when programming for JACK are

- all audio processing is done in callback function that you
  have to write,

- each call to this function receives a fixed number of input
  samples for each input, and has to produce the same number
  of samples for each output,

- the callback is done from a real-time thread created by JACK
  and runing within your application's process, and you must not
  do anything that could block it,

- ergo any non real-time safe operations must be done in separate
  threads that you create,  

- depending on the application, you may require some communication
  between these threads and the one created by JACK, and these
  interactions again should never block the audio thread.


Consult the example programs that come with the JACK source
for some simple examples.

--
FA

Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Lascia la spina, cogli la rosa.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Would Jackit be suitable for this?

Shiv Jairam
Hello everyone,

Thanks for all the replies.

As Fons pointed out, I wasn't too explicit about my intentions. So I'll take a moment to clear it up.

The program I hope to build will work on the principle of delayed auditory feedback (DAF). This is basically a technique that is used in speech therapy for stuttering/stammering. It works by playing back what the user has spoken, but it works because the played back audio is delayed.

This delay is variable. In clinical tests, delays were anywhere from 10ms to 800ms; with 80-120 ms being the most efficient. The program should be able to work anywhere within the aforementioned delay ranges. Thats is, the user chooses their desired delay.

It is my intention to start out small - just make the "audio engine" which runs from the terminal. After this is done. I want to add a GUI frontend for the engine. I plan on using the GTK+ toolkit. I was not aware that the choice of a GUI made a difference.

Regards.
--
Shiv Jairam
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Would Jackit be suitable for this?

Patrick Shirkey
Hi,

You don't have to write anything to do this.

Just hook up jack-rack and one of the delays from the swh plugins and
connect it to the rec in and audio out.


Cheers.



On Wed, 2008-01-09 at 15:48 -0500, Shiv Jairam wrote:

> Hello everyone,
>
> Thanks for all the replies.
>
> As Fons pointed out, I wasn't too explicit about my intentions. So
> I'll take a moment to clear it up.
>
> The program I hope to build will work on the principle of delayed
> auditory feedback (DAF). This is basically a technique that is used in
> speech therapy for stuttering/stammering. It works by playing back
> what the user has spoken, but it works because the played back audio
> is delayed.
>
> This delay is variable. In clinical tests, delays were anywhere from
> 10ms to 800ms; with 80-120 ms being the most efficient. The program
> should be able to work anywhere within the aforementioned delay
> ranges. Thats is, the user chooses their desired delay.
>
> It is my intention to start out small - just make the "audio engine"
> which runs from the terminal. After this is done. I want to add a GUI
> frontend for the engine. I plan on using the GTK+ toolkit. I was not
> aware that the choice of a GUI made a difference.
>
> Regards.
> --
> Shiv Jairam
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________ Jackit-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/jackit-devel
--
Patrick Shirkey
Boost Hardware Ltd.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Would Jackit be suitable for this?

Shiv Jairam
Hi Patrick,

That seems like good solution. But unfortunately the nature of the program prohibits the use of such a "rack". The only deps I want for the lightweight "sound engine" would be JACK. And besides it will take the fun out of programming :)

Regards.

On 1/9/08, Patrick Shirkey <[hidden email]> wrote:
Hi,

You don't have to write anything to do this.

Just hook up jack-rack and one of the delays from the swh plugins and
connect it to the rec in and audio out.


Cheers.



On Wed, 2008-01-09 at 15:48 -0500, Shiv Jairam wrote:

> Hello everyone,
>
> Thanks for all the replies.
>
> As Fons pointed out, I wasn't too explicit about my intentions. So
> I'll take a moment to clear it up.
>
> The program I hope to build will work on the principle of delayed
> auditory feedback (DAF). This is basically a technique that is used in
> speech therapy for stuttering/stammering. It works by playing back
> what the user has spoken, but it works because the played back audio
> is delayed.
>
> This delay is variable. In clinical tests, delays were anywhere from
> 10ms to 800ms; with 80-120 ms being the most efficient. The program
> should be able to work anywhere within the aforementioned delay
> ranges. Thats is, the user chooses their desired delay.
>
> It is my intention to start out small - just make the "audio engine"
> which runs from the terminal. After this is done. I want to add a GUI
> frontend for the engine. I plan on using the GTK+ toolkit. I was not
> aware that the choice of a GUI made a difference.
>
> Regards.
> --
> Shiv Jairam
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________ Jackit-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/jackit-devel
--
Patrick Shirkey
Boost Hardware Ltd.




--
Shiv Jairam
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Would Jackit be suitable for this?

Patrick Shirkey
Hi,

In that case jackeq is a pretty lightweight gtk2 app which has most of
the code you need to use. It wouldn't take long to strip it down to just
a single i/o and add a delay plugin in place of the 3 band eq.

Cheers.

On Wed, 2008-01-09 at 23:25 -0500, Shiv Jairam wrote:

> Hi Patrick,
>
> That seems like good solution. But unfortunately the nature of the
> program prohibits the use of such a "rack". The only deps I want for
> the lightweight "sound engine" would be JACK. And besides it will take
> the fun out of programming :)
>
> Regards.
>
> On 1/9/08, Patrick Shirkey <[hidden email]> wrote:
>         Hi,
>        
>         You don't have to write anything to do this.
>        
>         Just hook up jack-rack and one of the delays from the swh
>         plugins and
>         connect it to the rec in and audio out.
>        
>        
>         Cheers.
>        
>        
>        
>         On Wed, 2008-01-09 at 15:48 -0500, Shiv Jairam wrote:
>         > Hello everyone,
>         >
>         > Thanks for all the replies.
>         >
>         > As Fons pointed out, I wasn't too explicit about my
>         intentions. So
>         > I'll take a moment to clear it up.
>         >
>         > The program I hope to build will work on the principle of
>         delayed
>         > auditory feedback (DAF). This is basically a technique that
>         is used in
>         > speech therapy for stuttering/stammering. It works by
>         playing back
>         > what the user has spoken, but it works because the played
>         back audio
>         > is delayed.
>         >
>         > This delay is variable. In clinical tests, delays were
>         anywhere from
>         > 10ms to 800ms; with 80-120 ms being the most efficient. The
>         program
>         > should be able to work anywhere within the aforementioned
>         delay
>         > ranges. Thats is, the user chooses their desired delay.
>         >
>         > It is my intention to start out small - just make the "audio
>         engine"
>         > which runs from the terminal. After this is done. I want to
>         add a GUI
>         > frontend for the engine. I plan on using the GTK+ toolkit. I
>         was not
>         > aware that the choice of a GUI made a difference.
>         >
>         > Regards.
>         > --
>         > Shiv Jairam
>         >
>         -------------------------------------------------------------------------
>         > Check out the new SourceForge.net Marketplace.
>         > It's the best place to buy or sell services for
>         > just about anything Open Source.
>         >
>         http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
>         > _______________________________________________ Jackit-devel
>         mailing list [hidden email]
>         https://lists.sourceforge.net/lists/listinfo/jackit-devel
>         --
>         Patrick Shirkey
>         Boost Hardware Ltd.
>        
>
>
>
> --
> Shiv Jairam
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________ Jackit-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/jackit-devel
--
Patrick Shirkey
Boost Hardware Ltd.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel