Csound Csound-dev Csound-tekno Search About

[Cs-dev] french accents and sndinfo

Date2009-10-22 16:52
FromOlivier Bélanger
Subject[Cs-dev] french accents and sndinfo
AttachmentsNone  None  
Hi,

I've got a strange error on WIndows XP. SNDINFO could not found my 'french' sound. Same thing works perfectly on OS X...

util sndinfo:
C:\Documents and Settings\olipetwin\svn\ounk\files\snds\ounkmaster.aif:
C:\Documents and Settings\olipetwin\svn\ounk\files\snds\ounkmaster.aif:
    srate 44100, stereo, 16 bit AIFF, 11.924 seconds
    srate 44100, stereo, 16 bit AIFF, 11.924 seconds
    (525850 sample frames)
    (525850 sample frames)
C:\Documents and Settings\olipetwin\svn\ounk\files\snds\ôunkmaster.aif:
    could not find
C:\Documents and Settings\olipetwin\svn\ounk\files\snds\ôunkmaster.aif:
    could not find

DO I missed something?

Olivier


Date2009-10-22 16:58
FromPeiman Khosravi
SubjectRe: [Cs-dev] french accents and sndinfo
I think it could have something to do with the character "ô".

Best,

Peiman

On 22 Oct 2009, at 16:52, Olivier Bélanger wrote:

> Hi,
>
> I've got a strange error on WIndows XP. SNDINFO could not found my  
> 'french' sound. Same thing works perfectly on OS X...
>
> util sndinfo:
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds 
> \ounkmaster.aif:
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds 
> \ounkmaster.aif:
>     srate 44100, stereo, 16 bit AIFF, 11.924 seconds
>     srate 44100, stereo, 16 bit AIFF, 11.924 seconds
>     (525850 sample frames)
>     (525850 sample frames)
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds 
> \ôunkmaster.aif:
>     could not find
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds 
> \ôunkmaster.aif:
>     could not find
>
> DO I missed something?
>
> Olivier
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-10-22 17:08
FromOlivier Bélanger
SubjectRe: [Cs-dev] french accents and sndinfo
AttachmentsNone  None  
For sure! But this works:

<CsoundSynthesizer>

<CsOptions>
-d --format=short:aiff -b 1024 -B 2048 -o devaudio1 -+rtaudio=PortAudio
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
nchnls = 2

instr    1  
a1, a2 diskin2 "C:/Documents and Settings/olipetwin/svn/ounk/files/snds/ôunkmaster.aif", 1
outs a1, a2
endin

</CsInstruments>
<CsScore>
i1 0 12

</CsScore>
</CsoundSynthesizer>

So the question is: Why SNDINFO doesn't accept french accents?

Olivier

2009/10/22 Peiman Khosravi <peimankhosravi@gmail.com>
I think it could have something to do with the character "ô".

Best,

Peiman

On 22 Oct 2009, at 16:52, Olivier Bélanger wrote:

> Hi,
>
> I've got a strange error on WIndows XP. SNDINFO could not found my
> 'french' sound. Same thing works perfectly on OS X...
>
> util sndinfo:
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ounkmaster.aif:
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ounkmaster.aif:
>     srate 44100, stereo, 16 bit AIFF, 11.924 seconds
>     srate 44100, stereo, 16 bit AIFF, 11.924 seconds
>     (525850 sample frames)
>     (525850 sample frames)
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ôunkmaster.aif:
>     could not find
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ôunkmaster.aif:
>     could not find
>
> DO I missed something?
>
> Olivier
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2009-10-22 17:25
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] french accents and sndinfo
Some musing rather than solutions.

diskin2 uses

    fd = csound->FileOpen2(csound, &(p->sf), CSFILE_SND_R, name, &sfinfo,
                                  "SFDIR;SSDIR", CSFTYPE_UNKNOWN_AUDIO, 0);

to open the file while sndinfo uses

      fname = csound->FindInputFile(csound, infilnam, "SFDIR;SSDIR");

Thsi suggests that we shoudl be looking at these two functions and how
they differ.

csound->FileOpen2 is really csoundFileOpenWithType in envar.c
If the type is CSFILE_STD then fopen is used; otherwise open

So in the case of diskin2 it is really open

In the case of FindInputFile it always uses open, but there is a great
deal of processing requarding the file name.  As it works on OSX and not
windows (and I have neither system at present) I leave it to experts.

==John ff


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-10-22 17:36
FromOlivier Bélanger
SubjectRe: [Cs-dev] french accents and sndinfo
AttachmentsNone  None  
OK, sorry, the problem is elsewhere... If I ask SNDINFO directly in a Command Prompt, it works. I got the bug when sending a command from a python script. I guess it's a python string/unicode encoding problem.

Olivier


2009/10/22 <jpff@cs.bath.ac.uk>
Some musing rather than solutions.

diskin2 uses

   fd = csound->FileOpen2(csound, &(p->sf), CSFILE_SND_R, name, &sfinfo,
                                 "SFDIR;SSDIR", CSFTYPE_UNKNOWN_AUDIO, 0);

to open the file while sndinfo uses

     fname = csound->FindInputFile(csound, infilnam, "SFDIR;SSDIR");

Thsi suggests that we shoudl be looking at these two functions and how
they differ.

csound->FileOpen2 is really csoundFileOpenWithType in envar.c
If the type is CSFILE_STD then fopen is used; otherwise open

So in the case of diskin2 it is really open

In the case of FindInputFile it always uses open, but there is a great
deal of processing requarding the file name.  As it works on OSX and not
windows (and I have neither system at present) I leave it to experts.

==John ff


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2009-10-22 17:47
FromPeiman Khosravi
SubjectRe: [Cs-dev] french accents and sndinfo
AttachmentsNone  None  
haha sorry! I didn't read your post properly! You had already mentioned the French accent!!!
On 22 Oct 2009, at 17:08, Olivier Bélanger wrote:

For sure! But this works:

<CsoundSynthesizer>

<CsOptions>
-d --format=short:aiff -b 1024 -B 2048 -o devaudio1 -+rtaudio=PortAudio
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
nchnls = 2

instr    1  
a1, a2 diskin2 "C:/Documents and Settings/olipetwin/svn/ounk/files/snds/ôunkmaster.aif", 1
outs a1, a2
endin

</CsInstruments>
<CsScore>
i1 0 12

</CsScore>
</CsoundSynthesizer>

So the question is: Why SNDINFO doesn't accept french accents?

Olivier

2009/10/22 Peiman Khosravi <peimankhosravi@gmail.com>
I think it could have something to do with the character "ô".

Best,

Peiman

On 22 Oct 2009, at 16:52, Olivier Bélanger wrote:

> Hi,
>
> I've got a strange error on WIndows XP. SNDINFO could not found my
> 'french' sound. Same thing works perfectly on OS X...
>
> util sndinfo:
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ounkmaster.aif:
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ounkmaster.aif:
>     srate 44100, stereo, 16 bit AIFF, 11.924 seconds
>     srate 44100, stereo, 16 bit AIFF, 11.924 seconds
>     (525850 sample frames)
>     (525850 sample frames)
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ôunkmaster.aif:
>     could not find
> C:\Documents and Settings\olipetwin\svn\ounk\files\snds
> \ôunkmaster.aif:
>     could not find
>
> DO I missed something?
>
> Olivier
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2009-10-23 10:19
FromVictor Lazzarini
SubjectRe: [Cs-dev] french accents and sndinfo
Isn't it just the case of changing FindInputFile() for FileOpen2(), as  
the
latter seems to work better?

Victor
On 22 Oct 2009, at 17:25, jpff@cs.bath.ac.uk wrote:

> Some musing rather than solutions.
>
> diskin2 uses
>
>    fd = csound->FileOpen2(csound, &(p->sf), CSFILE_SND_R, name,  
> &sfinfo,
>                                  "SFDIR;SSDIR",  
> CSFTYPE_UNKNOWN_AUDIO, 0);
>
> to open the file while sndinfo uses
>
>      fname = csound->FindInputFile(csound, infilnam, "SFDIR;SSDIR");
>
> Thsi suggests that we shoudl be looking at these two functions and how
> they differ.
>
> csound->FileOpen2 is really csoundFileOpenWithType in envar.c
> If the type is CSFILE_STD then fopen is used; otherwise open
>
> So in the case of diskin2 it is really open
>
> In the case of FindInputFile it always uses open, but there is a great
> deal of processing requarding the file name.  As it works on OSX and  
> not
> windows (and I have neither system at present) I leave it to experts.
>
> ==John ff
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-10-23 13:58
FromOlivier Bélanger
SubjectRe: [Cs-dev] french accents and sndinfo
AttachmentsNone  None  
There is something with text encoding on Windows... In a command prompt, encoding is 'cp1252' and it's work correctly, but inside Python, with subprocess or os.system, I can't send a command with right encoding. Also, the .csd file I sent yesterday was working because I wrote it in notepad with the default encoding ('cp1252'), the same .csd with 'utf-8' encoding doesn't work, french accents are not correctly interpreted. In Cecilia, I can create a .csd file with platform specific encoding but I can't do the same with command line. If there is something you can do...

Thanks!

Olivier

2009/10/23 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Isn't it just the case of changing FindInputFile() for FileOpen2(), as
the
latter seems to work better?

Victor
On 22 Oct 2009, at 17:25, jpff@cs.bath.ac.uk wrote:

> Some musing rather than solutions.
>
> diskin2 uses
>
>    fd = csound->FileOpen2(csound, &(p->sf), CSFILE_SND_R, name,
> &sfinfo,
>                                  "SFDIR;SSDIR",
> CSFTYPE_UNKNOWN_AUDIO, 0);
>
> to open the file while sndinfo uses
>
>      fname = csound->FindInputFile(csound, infilnam, "SFDIR;SSDIR");
>
> Thsi suggests that we shoudl be looking at these two functions and how
> they differ.
>
> csound->FileOpen2 is really csoundFileOpenWithType in envar.c
> If the type is CSFILE_STD then fopen is used; otherwise open
>
> So in the case of diskin2 it is really open
>
> In the case of FindInputFile it always uses open, but there is a great
> deal of processing requarding the file name.  As it works on OSX and
> not
> windows (and I have neither system at present) I leave it to experts.
>
> ==John ff
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2009-10-23 18:27
FromFelipe Sateler
SubjectRe: [Cs-dev] french accents and sndinfo
AttachmentsNone  None  
On Fri, 2009-10-23 at 08:58 -0400, Olivier Bélanger wrote:
> There is something with text encoding on Windows... In a command
> prompt, encoding is 'cp1252' and it's work correctly, but inside
> Python, with subprocess or os.system, I can't send a command with
> right encoding. Also, the .csd file I sent yesterday was working
> because I wrote it in notepad with the default encoding ('cp1252'),
> the same .csd with 'utf-8' encoding doesn't work, french accents are
> not correctly interpreted. In Cecilia, I can create a .csd file with
> platform specific encoding but I can't do the same with command line.
> If there is something you can do...

Does python include iconv? IF so, you could use that to convert between
the encodings.


-- 
Saludos,
Felipe Sateler

Date2009-10-23 18:54
FromOlivier Bélanger
SubjectRe: [Cs-dev] french accents and sndinfo
AttachmentsNone  None  


2009/10/23 Felipe Sateler <fsateler@gmail.com>
On Fri, 2009-10-23 at 08:58 -0400, Olivier Bélanger wrote:
> There is something with text encoding on Windows... In a command
> prompt, encoding is 'cp1252' and it's work correctly, but inside
> Python, with subprocess or os.system, I can't send a command with
> right encoding. Also, the .csd file I sent yesterday was working
> because I wrote it in notepad with the default encoding ('cp1252'),
> the same .csd with 'utf-8' encoding doesn't work, french accents are
> not correctly interpreted. In Cecilia, I can create a .csd file with
> platform specific encoding but I can't do the same with command line.
> If there is something you can do...

Does python include iconv? IF so, you could use that to convert between
the encodings.


There is an external module pyiconv (I try to limit external depencies!) but it's not my problem... I have all needed encoding with the codecs module. The problem seems to be in the modules to interact with the system (subprocess or os.system). Even if I convert my string before sending a command, I don't get the expected result... like if it's internally converted to ascii or utf8.

Very strange!

Olivier
 
--
Saludos,
Felipe Sateler

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel