Csound Csound-dev Csound-tekno Search About

[Cs-dev] corrupt text output

Date2008-02-05 14:41
FromAlex Weiss
Subject[Cs-dev] corrupt text output
Hi

I'm working on my first Mac application that uses the Csound API. So far,
everything is working just fine, but Csound's console output is giving me
headaches. Most of the output appears correctly, but some is just cryptic
"garbage". E.g.:
Csound Command ERROR:	insufficient arguments


I tried implementing a message callback function that passes all arguments
to a printf(), but funnily enough, that makes the output even more jumbled.

Any ideas?

Thanks,
Alex
-- 
View this message in context: http://www.nabble.com/corrupt-text-output-tp15291024p15291024.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-02-05 14:51
FromVictor Lazzarini
SubjectRe: [Cs-dev] corrupt text output
Can you show us your callback?

At 14:41 05/02/2008, you wrote:

>Hi
>
>I'm working on my first Mac application that uses the Csound API. So far,
>everything is working just fine, but Csound's console output is giving me
>headaches. Most of the output appears correctly, but some is just cryptic
>"garbage". E.g.:
>Csound Command ERROR:   [minsufficient arguments[m
>[m
>
>I tried implementing a message callback function that passes all arguments
>to a printf(), but funnily enough, that makes the output even more jumbled.
>
>Any ideas?
>
>Thanks,
>Alex
>--
>View this message in context: 
>http://www.nabble.com/corrupt-text-output-tp15291024p15291024.html
>Sent from the Csound - Dev mailing list archive at Nabble.com.
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-02-05 14:58
FromAndres Cabrera
SubjectRe: [Cs-dev] corrupt text output
Hi,
It may have to do with color test for the console. Can you try setting
the flag -+msg_color=false?

Cheers,
Andrés

El mar, 05-02-2008 a las 06:41 -0800, Alex Weiss escribió:
> Hi
> 
> I'm working on my first Mac application that uses the Csound API. So far,
> everything is working just fine, but Csound's console output is giving me
> headaches. Most of the output appears correctly, but some is just cryptic
> "garbage". E.g.:
> Csound Command ERROR:	insufficient arguments
> 
> 
> I tried implementing a message callback function that passes all arguments
> to a printf(), but funnily enough, that makes the output even more jumbled.
> 
> Any ideas?
> 
> Thanks,
> Alex


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-de

Date2008-02-05 20:19
FromAlex Weiss
SubjectRe: [Cs-dev] corrupt text output

Victor.Lazzarini wrote:
> 
> Can you show us your callback?
> 

Well, it's really rather trivial, it was only meant as a test:

void messageCallback(CSOUND *csound, int attr, const char *format, va_list
valist)
{
	printf(format, valist);
}

Like I said, this makes the output even weirder. Here are the last few
lines, for example:

flag defaults: csound -s -otest -b-1073743960 -B-52408343 -m2627803
\364#)insufficient arguments

Note that "Csound Command ERROR" disappeared completely.


Andres Cabrera wrote:
> 
> Hi,
> It may have to do with color test for the console. Can you try setting
> the flag -+msg_color=false?
> 
Thanks. Unfortunately, that didn't help, either.

The csound executable runs without any problems in the terminal. But that
should mean that both the terminal and the csound framework are fine, right?
So what else can cause this?
Oh, by the way: I'm on a Intel machine with Tiger and Xcode 2.4. Framework
version is 5.07.

-- 
View this message in context: http://www.nabble.com/corrupt-text-output-tp15291024p15298703.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-02-05 20:57
FromAlex Weiss
SubjectRe: [Cs-dev] corrupt text output

Alex Weiss wrote:
> 
> 
> Andres Cabrera wrote:
>> 
>> Hi,
>> It may have to do with color test for the console. Can you try setting
>> the flag -+msg_color=false?
>> 
> Thanks. Unfortunately, that didn't help, either.
Oh, my mistake: I misspelled the flag. As long as I don't use my callback
function, the text is displayed correctly now. But the callback function
still yields weird output. Shouldn't I use *printf, did you use non-standard
formatting specifiers? Eventually, I'd like to use sprintf (or rather a
Cocoa equivalent) to put all csound messages into a string that can be
displayed by my GUI.
-- 
View this message in context: http://www.nabble.com/corrupt-text-output-tp15291024p15299356.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-02-05 21:38
FromAnthony Kozar
SubjectRe: [Cs-dev] corrupt text output
You cannot pass the va_list directly to printf().  You must do something
like this instead:

void messageCallback(CSOUND *csound, int attr, const char *format, va_list
valist)
{
   vfprintf(stdout, format, valist);
}


Alex Weiss wrote on 2/5/08 3:19 PM:

> void messageCallback(CSOUND *csound, int attr, const char *format, va_list
> valist)
> {
> printf(format, valist);
> }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-02-05 21:51
FromAlex Weiss
SubjectRe: [Cs-dev] corrupt text output
Oh gosh. This is embarrassing. I was using printf() when I should be using
v(f)printf(). So much for my old C skills... Sorry for all the confusion,
everything is great now.
-- 
View this message in context: http://www.nabble.com/corrupt-text-output-tp15291024p15299814.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net