Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] fl graphics on mac + rtaudio

Date2005-12-26 16:33
FromVictor Lazzarini
SubjectRe: [Cs-dev] fl graphics on mac + rtaudio
I have had some experience with the FLTK problem, as
I have looked closely into it. The FLTK is not guaranteed to
work on a second thread, although it works on OSX 10.3,
Linux and Windows.

With it running on the same thread it seems to work, but
its interaction with the rest of the system might cause
problems
(as you mentioned with Cocoa). However, I seem to have it
working here.

I have also been playing with a Carbon-based simple GUI
frontend for Csound5, which enables FLTK graphics to be
used.
There seems to be a problem somewhere, because FLTK
trips up the event loop. I have hacked my way round it by
putting the event  loop call in a loop.

I am using a timer to fire up calls to csoundPerformBuffer,
so
I can have transport controls. FLTK widgets and graphics can
be used.

With Carbon it seems to be possible to do it  and my app has
worked
with FLTK graphics and widget opcodes. Since I don't know
and am too lazy to Objective-C, I never tested Cocoa.

With regards to audio IO, I would suggest you use the same
system you had with MacCsound, which seems to be fast
enough.
The only thing that does not work with it is Digidesign IO
(at
least on a 10.4 with the digi 002).

Somehow they seem to implement non-interleaved IO, but when
you query the device, it does not seem to say so. Portaudio
seems
to adjust itself; my Coreaudio module has a parameter that
can be
used to set the type of output to non-interleaved.

Victor

> OK Thanks Istvan:
>
> > It is a known limitation of FLTK on OS X that you must
> > run it in the main thread, and it is not safe to access
> > the GUI from other threads at the same time.
>
> well even in the application thread FLTK takes over my
> application's menus and other GUI items -- not too useable
> for me.
>
> > To disable the FLTK graph displays, call
> > csoundSetIsGraphable() with a setting of true between
> > csoundPreCompile() and csoundCompile(), for example:
>
> that worked, thanks [ i wasn't calling precompile ]
>
>
> >   CSOUND *csound = csoundCreate(NULL);
> >   if (csoundPreCompile(csound) != 0)
> >     error();    /* fail in some way */
> >   csoundSetIsGraphable(csound, 1);
> >   /* set your MakeGraph etc. callbacks here if there are
> >   any */ /* ... */
> >   if (csoundCompile(csound, argc, argv) != 0)
> >     error();    /* fail in some way */
> >   /* ... */
> >
> > The FLTK plugin will not register callbacks for drawing
> > graphs if it is already graphable. Note that it will set
> > a yield callback if any FLTK functionality (graphs or
> > opcodes) is used, overriding your yield callback
> > function if there is any.
>
> oh that's another point against FLTK --
> i use Yield to tell csound to quit in the middle of a
> render...
>
>
> i seem to get coreaudio working but not portaudio.
> the internal coreaudio is working fine, except seems to
> not like multiple renders running simultaneously.
>
> i'll probably add my own coreaudio routines in this
> frontend and add it to the cvs in the next couple of
> days..
>
> Matt;
> ________________________
>            matt  ingalls
> http://sonomatics.com
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files for problems?  Stop!  Download the new
> AJAX search engine that makes searching your log files as
> easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-12-26 19:03
Frommatt ingalls
SubjectRe: [Cs-dev] fl graphics on mac + rtaudio
On Dec 26, 2005, at 8:33 AM, Victor Lazzarini wrote:
>
> With it running on the same thread it seems to work, but
> its interaction with the rest of the system might cause
> problems
> (as you mentioned with Cocoa). However, I seem to have it
> working here.

well it is pretty unacceptable for what i want to do.  -- i never liked
FLTK and this is not winning me over :)
>
>
> I am using a timer to fire up calls to csoundPerformBuffer,
> so
> I can have transport controls. FLTK widgets and graphics can
> be used.
>
> With Carbon it seems to be possible to do it  and my app has
> worked

and your app's menus etc are not hijacked by fltk?

> with FLTK graphics and widget opcodes. Since I don't know
> and am too lazy to Objective-C, I never tested Cocoa.

i'm fairly new to it myself [ maccsound is carbon/powerplant ]

> With regards to audio IO, I would suggest you use the same
> system you had with MacCsound, which seems to be fast
> enough.
> The only thing that does not work with it is Digidesign IO
> (at
> least on a 10.4 with the digi 002).

there is a bug in maccsound's audio io with tiger that i need to fix,  
which might
be the problem with the digi device.
>

-m
___________________
matt ingalls
development@gvox.com





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net