Csound Csound-dev Csound-tekno Search About

[Csnd] ftsave & ftload Float/Double incompatibility when writing binary files

Date2009-12-02 20:24
FromPeiman Khosravi
Subject[Csnd] ftsave & ftload Float/Double incompatibility when writing binary files
Hello,

Is there anyway to write a table to a binary file with ftsave (flag =  
0) using the float version of Csound and then read it with ftload  
using the Double version?

It doesn't seem to load properly at the moment so I am forced to use a  
text-file with the ftload $ ftsave flags set to 1, which is not great  
as some of the very small values are not stored correctly (I don't  
know why).

Any suggestion?

Thanks very much

Peiman


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-12-03 20:06
FromPeiman Khosravi
Subject[Csnd] Re: ftsave & ftload Float/Double incompatibility when writing binary files
Hello,

I've been playing around with this but still can't find a solution.

Is it a bug or does it make sense that binary files written to file  
with the float version of Csound cannot be read with the double version?

Thanks

Peiman

On 2 Dec 2009, at 20:24, Peiman Khosravi wrote:

> Hello,
>
> Is there anyway to write a table to a binary file with ftsave (flag  
> = 0) using the float version of Csound and then read it with ftload  
> using the Double version?
>
> It doesn't seem to load properly at the moment so I am forced to use  
> a text-file with the ftload $ ftsave flags set to 1, which is not  
> great as some of the very small values are not stored correctly (I  
> don't know why).
>
> Any suggestion?
>
> Thanks very much
>
> Peiman



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-12-03 20:25
FromMichael Gogins
Subject[Csnd] Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files

It is not a bug. It would be easy to write plugins to read or write specific formats.

MKG from cell phone

On Dec 3, 2009 3:07 PM, "Peiman Khosravi" <peimankhosravi@gmail.com> wrote:

Hello,

I've been playing around with this but still can't find a solution.

Is it a bug or does it make sense that binary files written to file with the float version of Csound cannot be read with the double version?

Thanks

Peiman

On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is there anyway to write a table to ...


Date2009-12-03 20:33
FromPeiman Khosravi
Subject[Csnd] Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
I see thanks very much.

It would be great if someone could write one :-) Else how would I go about writing one? I don't know any C unfortunately. 

Unless there is another way to write a table's data to file?

Best

Peiman 

On 3 Dec 2009, at 20:25, Michael Gogins wrote:

It is not a bug. It would be easy to write plugins to read or write specific formats.

MKG from cell phone


On Dec 3, 2009 3:07 PM, "Peiman Khosravi" <peimankhosravi@gmail.com> wrote:

Hello,

I've been playing around with this but still can't find a solution.

Is it a bug or does it make sense that binary files written to file with the float version of Csound cannot be read with the double version?

Thanks

Peiman

On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is there anyway to write a table to ...




Date2009-12-03 20:37
FromMichael Gogins
Subject[Csnd] Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
You could do it in Csound code using the Python opcodes. There may
even be a way to do it in pure Csound code, I will look at the manual.

Regards,
Mike

On 12/3/09, Peiman Khosravi  wrote:
> I see thanks very much.
>
> It would be great if someone could write one :-) Else how would I go
> about writing one? I don't know any C unfortunately.
>
> Unless there is another way to write a table's data to file?
>
> Best
>
> Peiman
>
> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>
>> It is not a bug. It would be easy to write plugins to read or write
>> specific formats.
>>
>> MKG from cell phone
>>
>>
>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>  wrote:
>>>
>>> Hello,
>>>
>>> I've been playing around with this but still can't find a solution.
>>>
>>> Is it a bug or does it make sense that binary files written to file
>>> with the float version of Csound cannot be read with the double
>>> version?
>>>
>>> Thanks
>>>
>>> Peiman
>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>> there anyway to write a table to ...
>>>
>>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"

Date2009-12-03 20:41
FromPeiman Khosravi
Subject[Csnd] Re: Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
Ah great! doing it all in Csound sounds great.

OK so I'm off revising my python :-)

Best

Peiman

On 3 Dec 2009, at 20:37, Michael Gogins wrote:

> You could do it in Csound code using the Python opcodes. There may
> even be a way to do it in pure Csound code, I will look at the manual.
>
> Regards,
> Mike
>
> On 12/3/09, Peiman Khosravi  wrote:
>> I see thanks very much.
>>
>> It would be great if someone could write one :-) Else how would I go
>> about writing one? I don't know any C unfortunately.
>>
>> Unless there is another way to write a table's data to file?
>>
>> Best
>>
>> Peiman
>>
>> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>>
>>> It is not a bug. It would be easy to write plugins to read or write
>>> specific formats.
>>>
>>> MKG from cell phone
>>>
>>>
>>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>>  wrote:
>>>>
>>>> Hello,
>>>>
>>>> I've been playing around with this but still can't find a solution.
>>>>
>>>> Is it a bug or does it make sense that binary files written to file
>>>> with the float version of Csound cannot be read with the double
>>>> version?
>>>>
>>>> Thanks
>>>>
>>>> Peiman
>>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>>> there anyway to write a table to ...
>>>>
>>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>
>
> -- 
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-12-03 20:50
FromMichael Gogins
Subject[Csnd] Re: Re: Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
I don't see how to do it in pure Csound. I think you would need to use
either to use text storage, for which you could use the fprints
opcode, or to use Python.

Possibly the table writing and reading opcodes could be changed to
take an optional parameter for format.

Regards,
Mike

On 12/3/09, Peiman Khosravi  wrote:
> Ah great! doing it all in Csound sounds great.
>
> OK so I'm off revising my python :-)
>
> Best
>
> Peiman
>
> On 3 Dec 2009, at 20:37, Michael Gogins wrote:
>
>> You could do it in Csound code using the Python opcodes. There may
>> even be a way to do it in pure Csound code, I will look at the manual.
>>
>> Regards,
>> Mike
>>
>> On 12/3/09, Peiman Khosravi  wrote:
>>> I see thanks very much.
>>>
>>> It would be great if someone could write one :-) Else how would I go
>>> about writing one? I don't know any C unfortunately.
>>>
>>> Unless there is another way to write a table's data to file?
>>>
>>> Best
>>>
>>> Peiman
>>>
>>> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>>>
>>>> It is not a bug. It would be easy to write plugins to read or write
>>>> specific formats.
>>>>
>>>> MKG from cell phone
>>>>
>>>>
>>>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>>>  wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I've been playing around with this but still can't find a solution.
>>>>>
>>>>> Is it a bug or does it make sense that binary files written to file
>>>>> with the float version of Csound cannot be read with the double
>>>>> version?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Peiman
>>>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>>>> there anyway to write a table to ...
>>>>>
>>>>
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> "unsubscribe
>>> csound"
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> "unsubscribe csound"
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>

Date2009-12-03 20:59
FromPeiman Khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
AttachmentsPicture 4.png  Picture 5.png  
Thanks Michael,

It's gonna take me a while to write the python script but I'll try :-)  
What I can't understand is why when the flag of ftsave is set to 1 (to  
write to text file) I loose quite a bit of precision in the file. Like  
values are being rounded-up or something.

Here is the original table visualized in maxmsp:

Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


And here is the same table imported from a text-file written by ftsave:


You can see obvious distortion there.

But it is identical when imported from a binary file written by ftsave.

Thanks

Peiman

On 3 Dec 2009, at 20:50, Michael Gogins wrote:

> I don't see how to do it in pure Csound. I think you would need to use
> either to use text storage, for which you could use the fprints
> opcode, or to use Python.
>
> Possibly the table writing and reading opcodes could be changed to
> take an optional parameter for format.
>
> Regards,
> Mike
>
> On 12/3/09, Peiman Khosravi  wrote:
>> Ah great! doing it all in Csound sounds great.
>>
>> OK so I'm off revising my python :-)
>>
>> Best
>>
>> Peiman
>>
>> On 3 Dec 2009, at 20:37, Michael Gogins wrote:
>>
>>> You could do it in Csound code using the Python opcodes. There may
>>> even be a way to do it in pure Csound code, I will look at the  
>>> manual.
>>>
>>> Regards,
>>> Mike
>>>
>>> On 12/3/09, Peiman Khosravi  wrote:
>>>> I see thanks very much.
>>>>
>>>> It would be great if someone could write one :-) Else how would I  
>>>> go
>>>> about writing one? I don't know any C unfortunately.
>>>>
>>>> Unless there is another way to write a table's data to file?
>>>>
>>>> Best
>>>>
>>>> Peiman
>>>>
>>>> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>>>>
>>>>> It is not a bug. It would be easy to write plugins to read or  
>>>>> write
>>>>> specific formats.
>>>>>
>>>>> MKG from cell phone
>>>>>
>>>>>
>>>>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>>>>  wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I've been playing around with this but still can't find a  
>>>>>> solution.
>>>>>>
>>>>>> Is it a bug or does it make sense that binary files written to  
>>>>>> file
>>>>>> with the float version of Csound cannot be read with the double
>>>>>> version?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Peiman
>>>>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>>>>> there anyway to write a table to ...
>>>>>>
>>>>>
>>>>
>>>>
>>>> Send bugs reports to this list.
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>> "unsubscribe
>>>> csound"
>>>
>>>
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> "unsubscribe csound"
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>>
>
>
> -- 
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"


Date2009-12-03 21:03
FromAndres Cabrera
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
Hi,
I think that text files in csound use something like 5 or 6 decimal
places, so you lose everything after that, but that should be around
-100 dB FS for 5 decimal places if you are using 0dbfs= 1, so I'm not
sure this is really the problem here...

Cheers,
Andrés

On Thu, Dec 3, 2009 at 8:59 PM, Peiman Khosravi
 wrote:
> Thanks Michael,
>
> It's gonna take me a while to write the python script but I'll try :-) What
> I can't understand is why when the flag of ftsave is set to 1 (to write to
> text file) I loose quite a bit of precision in the file. Like values are
> being rounded-up or something.
>
> Here is the original table visualized in maxmsp:
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
> And here is the same table imported from a text-file written by ftsave:
>
>
>
> You can see obvious distortion there.
>
> But it is identical when imported from a binary file written by ftsave.
>
> Thanks
>
> Peiman
>
> On 3 Dec 2009, at 20:50, Michael Gogins wrote:
>
>> I don't see how to do it in pure Csound. I think you would need to use
>> either to use text storage, for which you could use the fprints
>> opcode, or to use Python.
>>
>> Possibly the table writing and reading opcodes could be changed to
>> take an optional parameter for format.
>>
>> Regards,
>> Mike
>>
>> On 12/3/09, Peiman Khosravi  wrote:
>>>
>>> Ah great! doing it all in Csound sounds great.
>>>
>>> OK so I'm off revising my python :-)
>>>
>>> Best
>>>
>>> Peiman
>>>
>>> On 3 Dec 2009, at 20:37, Michael Gogins wrote:
>>>
>>>> You could do it in Csound code using the Python opcodes. There may
>>>> even be a way to do it in pure Csound code, I will look at the manual.
>>>>
>>>> Regards,
>>>> Mike
>>>>
>>>> On 12/3/09, Peiman Khosravi  wrote:
>>>>>
>>>>> I see thanks very much.
>>>>>
>>>>> It would be great if someone could write one :-) Else how would I go
>>>>> about writing one? I don't know any C unfortunately.
>>>>>
>>>>> Unless there is another way to write a table's data to file?
>>>>>
>>>>> Best
>>>>>
>>>>> Peiman
>>>>>
>>>>> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>>>>>
>>>>>> It is not a bug. It would be easy to write plugins to read or write
>>>>>> specific formats.
>>>>>>
>>>>>> MKG from cell phone
>>>>>>
>>>>>>
>>>>>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>>>>>  wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I've been playing around with this but still can't find a solution.
>>>>>>>
>>>>>>> Is it a bug or does it make sense that binary files written to file
>>>>>>> with the float version of Csound cannot be read with the double
>>>>>>> version?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Peiman
>>>>>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>>>>>> there anyway to write a table to ...
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> Send bugs reports to this list.
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe
>>>>> csound"
>>>>
>>>>
>>>> --
>>>> Michael Gogins
>>>> Irreducible Productions
>>>> http://www.michael-gogins.com
>>>> Michael dot Gogins at gmail dot com
>>>>
>>>>
>>>> Send bugs reports to this list.
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>> "unsubscribe csound"
>>>
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>
>
>



-- 


Andrés


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-12-03 21:08
FromPeiman Khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
Yes that makes sense. The table is actually reading noise print from a  
f-signal which is at a very low level. So I could loose the 0dbfs=1  
(to avoid floats) and it should be OK?

Thanks for that Andres. Maybe my problem is solved!

Best,

Peiman

On 3 Dec 2009, at 21:03, Andres Cabrera wrote:

> Hi,
> I think that text files in csound use something like 5 or 6 decimal
> places, so you lose everything after that, but that should be around
> -100 dB FS for 5 decimal places if you are using 0dbfs= 1, so I'm not
> sure this is really the problem here...
>
> Cheers,
> Andrés
>
> On Thu, Dec 3, 2009 at 8:59 PM, Peiman Khosravi
>  wrote:
>> Thanks Michael,
>>
>> It's gonna take me a while to write the python script but I'll  
>> try :-) What
>> I can't understand is why when the flag of ftsave is set to 1 (to  
>> write to
>> text file) I loose quite a bit of precision in the file. Like  
>> values are
>> being rounded-up or something.
>>
>> Here is the original table visualized in maxmsp:
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>>
>>
>>
>> And here is the same table imported from a text-file written by  
>> ftsave:
>>
>>
>>
>> You can see obvious distortion there.
>>
>> But it is identical when imported from a binary file written by  
>> ftsave.
>>
>> Thanks
>>
>> Peiman
>>
>> On 3 Dec 2009, at 20:50, Michael Gogins wrote:
>>
>>> I don't see how to do it in pure Csound. I think you would need to  
>>> use
>>> either to use text storage, for which you could use the fprints
>>> opcode, or to use Python.
>>>
>>> Possibly the table writing and reading opcodes could be changed to
>>> take an optional parameter for format.
>>>
>>> Regards,
>>> Mike
>>>
>>> On 12/3/09, Peiman Khosravi  wrote:
>>>>
>>>> Ah great! doing it all in Csound sounds great.
>>>>
>>>> OK so I'm off revising my python :-)
>>>>
>>>> Best
>>>>
>>>> Peiman
>>>>
>>>> On 3 Dec 2009, at 20:37, Michael Gogins wrote:
>>>>
>>>>> You could do it in Csound code using the Python opcodes. There may
>>>>> even be a way to do it in pure Csound code, I will look at the  
>>>>> manual.
>>>>>
>>>>> Regards,
>>>>> Mike
>>>>>
>>>>> On 12/3/09, Peiman Khosravi  wrote:
>>>>>>
>>>>>> I see thanks very much.
>>>>>>
>>>>>> It would be great if someone could write one :-) Else how would  
>>>>>> I go
>>>>>> about writing one? I don't know any C unfortunately.
>>>>>>
>>>>>> Unless there is another way to write a table's data to file?
>>>>>>
>>>>>> Best
>>>>>>
>>>>>> Peiman
>>>>>>
>>>>>> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>>>>>>
>>>>>>> It is not a bug. It would be easy to write plugins to read or  
>>>>>>> write
>>>>>>> specific formats.
>>>>>>>
>>>>>>> MKG from cell phone
>>>>>>>
>>>>>>>
>>>>>>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>>>>>>  wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I've been playing around with this but still can't find a  
>>>>>>>> solution.
>>>>>>>>
>>>>>>>> Is it a bug or does it make sense that binary files written  
>>>>>>>> to file
>>>>>>>> with the float version of Csound cannot be read with the double
>>>>>>>> version?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Peiman
>>>>>>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>>>>>>> there anyway to write a table to ...
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Send bugs reports to this list.
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe
>>>>>> csound"
>>>>>
>>>>>
>>>>> --
>>>>> Michael Gogins
>>>>> Irreducible Productions
>>>>> http://www.michael-gogins.com
>>>>> Michael dot Gogins at gmail dot com
>>>>>
>>>>>
>>>>> Send bugs reports to this list.
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>
>>>>
>>>>
>>>> Send bugs reports to this list.
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>>>> "unsubscribe
>>>> csound"
>>>>
>>>
>>>
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>>> "unsubscribe
>>> csound"
>>
>>
>>
>
>
>
> -- 
>
>
> Andrés
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-12-03 21:18
FromPeiman Khosravi
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
Just to say that did the trick. I deleted the 0dbfs=1 statement and it  
work fine now.

Thanks!

Peiman

On 3 Dec 2009, at 21:03, Andres Cabrera wrote:

> Hi,
> I think that text files in csound use something like 5 or 6 decimal
> places, so you lose everything after that, but that should be around
> -100 dB FS for 5 decimal places if you are using 0dbfs= 1, so I'm not
> sure this is really the problem here...
>
> Cheers,
> Andrés
>
> On Thu, Dec 3, 2009 at 8:59 PM, Peiman Khosravi
>  wrote:
>> Thanks Michael,
>>
>> It's gonna take me a while to write the python script but I'll  
>> try :-) What
>> I can't understand is why when the flag of ftsave is set to 1 (to  
>> write to
>> text file) I loose quite a bit of precision in the file. Like  
>> values are
>> being rounded-up or something.
>>
>> Here is the original table visualized in maxmsp:
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>>
>>
>>
>> And here is the same table imported from a text-file written by  
>> ftsave:
>>
>>
>>
>> You can see obvious distortion there.
>>
>> But it is identical when imported from a binary file written by  
>> ftsave.
>>
>> Thanks
>>
>> Peiman
>>
>> On 3 Dec 2009, at 20:50, Michael Gogins wrote:
>>
>>> I don't see how to do it in pure Csound. I think you would need to  
>>> use
>>> either to use text storage, for which you could use the fprints
>>> opcode, or to use Python.
>>>
>>> Possibly the table writing and reading opcodes could be changed to
>>> take an optional parameter for format.
>>>
>>> Regards,
>>> Mike
>>>
>>> On 12/3/09, Peiman Khosravi  wrote:
>>>>
>>>> Ah great! doing it all in Csound sounds great.
>>>>
>>>> OK so I'm off revising my python :-)
>>>>
>>>> Best
>>>>
>>>> Peiman
>>>>
>>>> On 3 Dec 2009, at 20:37, Michael Gogins wrote:
>>>>
>>>>> You could do it in Csound code using the Python opcodes. There may
>>>>> even be a way to do it in pure Csound code, I will look at the  
>>>>> manual.
>>>>>
>>>>> Regards,
>>>>> Mike
>>>>>
>>>>> On 12/3/09, Peiman Khosravi  wrote:
>>>>>>
>>>>>> I see thanks very much.
>>>>>>
>>>>>> It would be great if someone could write one :-) Else how would  
>>>>>> I go
>>>>>> about writing one? I don't know any C unfortunately.
>>>>>>
>>>>>> Unless there is another way to write a table's data to file?
>>>>>>
>>>>>> Best
>>>>>>
>>>>>> Peiman
>>>>>>
>>>>>> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>>>>>>
>>>>>>> It is not a bug. It would be easy to write plugins to read or  
>>>>>>> write
>>>>>>> specific formats.
>>>>>>>
>>>>>>> MKG from cell phone
>>>>>>>
>>>>>>>
>>>>>>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"
>>>>>>>>  wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I've been playing around with this but still can't find a  
>>>>>>>> solution.
>>>>>>>>
>>>>>>>> Is it a bug or does it make sense that binary files written  
>>>>>>>> to file
>>>>>>>> with the float version of Csound cannot be read with the double
>>>>>>>> version?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Peiman
>>>>>>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is
>>>>>>>> there anyway to write a table to ...
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Send bugs reports to this list.
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe
>>>>>> csound"
>>>>>
>>>>>
>>>>> --
>>>>> Michael Gogins
>>>>> Irreducible Productions
>>>>> http://www.michael-gogins.com
>>>>> Michael dot Gogins at gmail dot com
>>>>>
>>>>>
>>>>> Send bugs reports to this list.
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>
>>>>
>>>>
>>>> Send bugs reports to this list.
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>>>> "unsubscribe
>>>> csound"
>>>>
>>>
>>>
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>>> "unsubscribe
>>> csound"
>>
>>
>>
>
>
>
> -- 
>
>
> Andrés
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-12-06 23:27
Fromjoachim heintz
Subject[Csnd] Re: Re: Re: Re: ftsave & ftload Float/Double incompatibility when writing binary files
Perhaps this can also be useful for you:
http://www.csounds.com/udo/displayOpcode.php?opcode_id=86

Ciao -

	joachim


Am 03.12.2009 um 21:33 schrieb Peiman Khosravi:

> I see thanks very much.
>
> It would be great if someone could write one :-) Else how would I go  
> about writing one? I don't know any C unfortunately.
>
> Unless there is another way to write a table's data to file?
>
> Best
>
> Peiman
>
> On 3 Dec 2009, at 20:25, Michael Gogins wrote:
>
>> It is not a bug. It would be easy to write plugins to read or write  
>> specific formats.
>>
>> MKG from cell phone
>>
>>
>>> On Dec 3, 2009 3:07 PM, "Peiman Khosravi"  
>>>  wrote:
>>>
>>> Hello,
>>>
>>> I've been playing around with this but still can't find a solution.
>>>
>>> Is it a bug or does it make sense that binary files written to  
>>> file with the float version of Csound cannot be read with the  
>>> double version?
>>>
>>> Thanks
>>>
>>> Peiman
>>> On 2 Dec 2009, at 20:24, Peiman Khosravi wrote: > Hello, > > Is  
>>> there anyway to write a table to ...
>>>
>>
>



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"