Csound Csound-dev Csound-tekno Search About

[Csnd] Problem with printf

Date2008-07-31 20:21
FromMark Van Peteghem
Subject[Csnd] Problem with printf
Hi,

I just tried the printf opcode, but it doesn't work as I expected. When 
I try to print a-rate variables, it gives an error message saying that 
it expects U. I suppose that the documentation mistakenly mentions xarg1 
etc, because with k-rate variables it works fine. It is not mentioned in 
the documentation that a-rate variables are not allowed.

For printf_i it is mentioned that only i-rate variables are allowed, but 
xarg1 etc. is also use to describe the arguments.

-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.


Date2008-08-01 19:54
FromTobiah
Subject[Csnd] Re: Problem with printf
Mark Van Peteghem wrote:
> Hi,
> 
> I just tried the printf opcode, but it doesn't work as I expected. 

The docs may need to be fixed, but I'm curious as to why you
would want to print out a a-rate variable.

You could always write the signal out to a file and view it
with a soundfile editor.

Date2008-08-01 20:58
FromMark Van Peteghem
Subject[Csnd] Re: Re: Problem with printf
Tobiah schreef:
> Mark Van Peteghem wrote:
>> Hi,
>>
>> I just tried the printf opcode, but it doesn't work as I expected. 
>
> The docs may need to be fixed, but I'm curious as to why you
> would want to print out a a-rate variable.
>
> You could always write the signal out to a file and view it
> with a soundfile editor.

I hadn't thought of that yet, thanks. I remember opcodes that write an 
a-rate signal to a file, but at the time I didn't see the need for it.

I tried downsamp and printed the k-rate variable, but because the result 
was not what I expected, I didn't trust downsamp entirely - but in the 
end the problem was actually something else. For the curious, I thought 
that apos = apos + astep would be updated at the a-rate, but it is 
actually done at the k-rate.

-- 
  Mark
  _________________________________________
  When you get lemons, you make lemonade.
  When you get hardware, you make software.