[Csnd-dev] File access troubles in Windows

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd-dev] File access troubles in Windows

Mauro Giubileo

Hi, I'm having some troubles on Windows with opcodes that read files or directories. I'm using the last Csound beta release from appveyor (file "csound-windows-x64-6.12.0-beta-2041.zip").

For example, this simple snippet of code to me doesn't work anymore (the "directory" opcodes now returns always an array of 0 elements):

instr 1
    iCnt           init      0
    SFilenames[]   directory "."
    iNumberOfFiles lenarray  SFilenames
                   print     iNumberOfFiles

    until (iCnt >= iNumberOfFiles) do
             printf_i "Filename = %s \n", 1, SFilenames[iCnt]
        iCnt =        iCnt+1
    od
endin

If I use the Csound 6.11 downloaded from here: https://github.com/csound/csound/releases/download/6.11.0/Csound6.11.0-Windows_x64-installer.exe the snippet above works without problems...


Best Regards,
Mauro


Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

jpff
What is the date or commit nuber of
csound-windows-x64-6.12.0-beta-2041.zip?  As far as  can see te onlt
change in the fie defining te directory opcode was recet,  28, 29 and 30
Sep


On Sun, 30 Sep 2018, Mauro Giubileo wrote:

>
> Hi, I'm having some troubles on Windows with opcodes that read files or
> directories. I'm using the last Csound beta release from appveyor (file
> "csound-windows-x64-6.12.0-beta-2041.zip").
>
> For example, this simple snippet of code to me doesn't work anymore (the
> "directory" opcodes now returns always an array of 0 elements):
>
> instr 1
>     iCnt           init      0
>     SFilenames[]   directory "."
>     iNumberOfFiles lenarray  SFilenames
>                    print     iNumberOfFiles
>
>     until (iCnt >= iNumberOfFiles) do
>              printf_i "Filename = %s \n", 1, SFilenames[iCnt]
>         iCnt =        iCnt+1
>     od
> endin
>
> If I use the Csound 6.11 downloaded from here:https://github.com/csound/csound/releases/download/6.11.0/Csound6.11.0-Window
> s_x64-installer.exe the snippet above works without problems...
>
>
> Best Regards,
> Mauro
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

jpff
PS Works ok in Linux so looks like a MSVC atifact.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

rorywalsh
If the recent tabensure changes have caused an MSVC here, shouldn't we be concerned that problems will also appear elsewhere? It seems to me that tabensure is used across the entire code base.

On Sun, 30 Sep 2018 at 20:34, jpff <[hidden email]> wrote:
PS Works ok in Linux so looks like a MSVC atifact.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

jpff
Rory, can you test on the latest code in github?  I cannot see how te
change which is running everywhere else could cause the empty list,
especially as it runs on Linux and is simple code.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

rorywalsh
Hi John. I no longer have a windows dev environment but I will try setting one up to test this. Might take me a day or two. Leave it with me. I can't see anything that might be causing this problem.

On Sun, 30 Sep 2018 at 20:53, jpff <[hidden email]> wrote:
Rory, can you test on the latest code in github?  I cannot see how te
change which is running everywhere else could cause the empty list,
especially as it runs on Linux and is simple code.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

rorywalsh
FYI, I just tried the latest AppVeyor build and I get:

c:\Users\rory\Desktop>csound test.csd
time resolution is 353.919 ns
0dBFS level = 32768.0
--Csound version 6.12 beta (double samples) Sep 30 2018
[commit: 917df8f0fd8ff4af2a828d6a958f05cbaf043680]
libsndfile-1.0.29pre1
UnifiedCSD:  test.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score

error: syntax error, unexpected T_IDENT, expecting T_OPCODE or T_FUNCTION or ',' or '='  (token "directory") from file test.csd (1)
 line 10:
>>>    SFilenames[]   directory  <<<
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.008s, CPU: 0.008s
no sound written to disk

c:\Users\rory\Desktop>

ftsamplebank.dll is included, but Csound doesn't find the opcode? Odd Mauro that you get a different result? I'm using the build from 5 hours ago.

On Sun, 30 Sep 2018 at 21:12, Rory Walsh <[hidden email]> wrote:
Hi John. I no longer have a windows dev environment but I will try setting one up to test this. Might take me a day or two. Leave it with me. I can't see anything that might be causing this problem.

On Sun, 30 Sep 2018 at 20:53, jpff <[hidden email]> wrote:
Rory, can you test on the latest code in github?  I cannot see how te
change which is running everywhere else could cause the empty list,
especially as it runs on Linux and is simple code.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

jpff
Oh dear; that suggests the ftsamplebnk.dll is not loadable?  I suppose I
could have made a typing error....  I will see if I can think of any such.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

rorywalsh
I'll try to set up a new Windows build system in any case. They appear to be quite scarce at the moment.


On Sun, 30 Sep 2018 at 21:23, jpff <[hidden email]> wrote:
Oh dear; that suggests the ftsamplebnk.dll is not loadable?  I suppose I
could have made a typing error....  I will see if I can think of any such.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

Mauro Giubileo
In reply to this post by jpff

It's not related to the last changes, because I just tried with a previous Csound beta I had, dated 2 september (csound-windows-x64-6.11.0-beta-1937) and it doesn't work.



Il 2018-09-30 21:22 jpff ha scritto:

What is the date or commit nuber of csound-windows-x64-6.12.0-beta-2041.zip?  As far as  can see te onlt change in the fie defining te directory opcode was recet,  28, 29 and 30 Sep


On Sun, 30 Sep 2018, Mauro Giubileo wrote:


Hi, I'm having some troubles on Windows with opcodes that read files or
directories. I'm using the last Csound beta release from appveyor (file
"csound-windows-x64-6.12.0-beta-2041.zip").

For example, this simple snippet of code to me doesn't work anymore (the
"directory" opcodes now returns always an array of 0 elements):

instr 1
    iCnt           init      0
    SFilenames[]   directory "."
    iNumberOfFiles lenarray  SFilenames
                   print     iNumberOfFiles

    until (iCnt >= iNumberOfFiles) do
             printf_i "Filename = %s \n", 1, SFilenames[iCnt]
        iCnt =        iCnt+1
    od
endin

If I use the Csound 6.11 downloaded from here:https://github.com/csound/csound/releases/download/6.11.0/Csound6.11.0-Window
s_x64-installer.exe the snippet above works without problems...


Best Regards,
Mauro


Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

Mauro Giubileo

I tried to download the full installer of the last beta version, instead of the zip version, and now the opcodes that access to files/directories work!!

The problem was that I simply copied all the contents of the zip file to the bin directory of my Csound installation ("C:\Program Files\Csound6_x64\bin"), but this doesn't work, because some of those files had to be placed inside the bin folder, others in the plugins64 folder. Strangely, the zip version has all the files mixed in just one directory (apart from the "include" folder), so you don't know which file goes in which directory...

I'm very sorry guys for wasting your time... It was a stupid mistake on my part... :'-(


Il 2018-09-30 23:06 Mauro Giubileo ha scritto:

It's not related to the last changes, because I just tried with a previous Csound beta I had, dated 2 september (csound-windows-x64-6.11.0-beta-1937) and it doesn't work.



Il 2018-09-30 21:22 jpff ha scritto:

What is the date or commit nuber of csound-windows-x64-6.12.0-beta-2041.zip?  As far as  can see te onlt change in the fie defining te directory opcode was recet,  28, 29 and 30 Sep


On Sun, 30 Sep 2018, Mauro Giubileo wrote:


Hi, I'm having some troubles on Windows with opcodes that read files or
directories. I'm using the last Csound beta release from appveyor (file
"csound-windows-x64-6.12.0-beta-2041.zip").

For example, this simple snippet of code to me doesn't work anymore (the
"directory" opcodes now returns always an array of 0 elements):

instr 1
    iCnt           init      0
    SFilenames[]   directory "."
    iNumberOfFiles lenarray  SFilenames
                   print     iNumberOfFiles

    until (iCnt >= iNumberOfFiles) do
             printf_i "Filename = %s \n", 1, SFilenames[iCnt]
        iCnt =        iCnt+1
    od
endin

If I use the Csound 6.11 downloaded from here:https://github.com/csound/csound/releases/download/6.11.0/Csound6.11.0-Window
s_x64-installer.exe the snippet above works without problems...


Best Regards,
Mauro

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

Mauro Giubileo
In reply to this post by rorywalsh

Hi Rory, what are the contents of your test.csd file?

This is the file I tried in Cabbage:

<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1

    iCnt            init        0
    SFilenames[]    directory   "."
    iNumberOfFiles  lenarray    SFilenames
                    print       iNumberOfFiles
                    
    until (iCnt >= iNumberOfFiles) do
                printf_i    "Filename = %s \n", 1, SFilenames[iCnt]
        iCnt    =           iCnt + 1
    od
    
    Swd pwd
        printf  "Current path: %s\n", 1, Swd    

endin

</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>

It works well with the installer downloaded from appveyor "Csound6_x64-6.12.0-beta-2041.exe".


Il 2018-09-30 22:17 Rory Walsh ha scritto:

FYI, I just tried the latest AppVeyor build and I get:
 
c:\Users\rory\Desktop>csound test.csd
time resolution is 353.919 ns
0dBFS level = 32768.0
--Csound version 6.12 beta (double samples) Sep 30 2018
[commit: 917df8f0fd8ff4af2a828d6a958f05cbaf043680]
libsndfile-1.0.29pre1
UnifiedCSD:  test.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score

error: syntax error, unexpected T_IDENT, expecting T_OPCODE or T_FUNCTION or ',' or '='  (token "directory") from file test.csd (1)
 line 10:
>>>    SFilenames[]   directory  <<<
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.008s, CPU: 0.008s
no sound written to disk

c:\Users\rory\Desktop>
 
ftsamplebank.dll is included, but Csound doesn't find the opcode? Odd Mauro that you get a different result? I'm using the build from 5 hours ago.

On Sun, 30 Sep 2018 at 21:12, Rory Walsh <[hidden email]> wrote:
Hi John. I no longer have a windows dev environment but I will try setting one up to test this. Might take me a day or two. Leave it with me. I can't see anything that might be causing this problem.

On Sun, 30 Sep 2018 at 20:53, jpff <[hidden email]> wrote:
Rory, can you test on the latest code in github?  I cannot see how te
change which is running everywhere else could cause the empty list,
especially as it runs on Linux and is simple code.
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] File access troubles in Windows

rorywalsh
Mauro you're right. Sorry John, this looks like a non-issue. I restarted my machine after installing some VS tools and now it's all working fine for me too. On the flip side, I'm now close to having a full local build environment for windows ;)

On Sun, 30 Sep 2018 at 22:55, Mauro Giubileo <[hidden email]> wrote:

Hi Rory, what are the contents of your test.csd file?

This is the file I tried in Cabbage:

<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1

    iCnt            init        0
    SFilenames[]    directory   "."
    iNumberOfFiles  lenarray    SFilenames
                    print       iNumberOfFiles
                    
    until (iCnt >= iNumberOfFiles) do
                printf_i    "Filename = %s \n", 1, SFilenames[iCnt]
        iCnt    =           iCnt + 1
    od
    
    Swd pwd
        printf  "Current path: %s\n", 1, Swd    

endin

</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>

It works well with the installer downloaded from appveyor "Csound6_x64-6.12.0-beta-2041.exe".


Il 2018-09-30 22:17 Rory Walsh ha scritto:

FYI, I just tried the latest AppVeyor build and I get:
 
c:\Users\rory\Desktop>csound test.csd
time resolution is 353.919 ns
0dBFS level = 32768.0
--Csound version 6.12 beta (double samples) Sep 30 2018
[commit: 917df8f0fd8ff4af2a828d6a958f05cbaf043680]
libsndfile-1.0.29pre1
UnifiedCSD:  test.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score

error: syntax error, unexpected T_IDENT, expecting T_OPCODE or T_FUNCTION or ',' or '='  (token "directory") from file test.csd (1)
 line 10:
>>>    SFilenames[]   directory  <<<
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra
end of score.              overall amps:      0.0
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.008s, CPU: 0.008s
no sound written to disk

c:\Users\rory\Desktop>
 
ftsamplebank.dll is included, but Csound doesn't find the opcode? Odd Mauro that you get a different result? I'm using the build from 5 hours ago.

On Sun, 30 Sep 2018 at 21:12, Rory Walsh <[hidden email]> wrote:
Hi John. I no longer have a windows dev environment but I will try setting one up to test this. Might take me a day or two. Leave it with me. I can't see anything that might be causing this problem.

On Sun, 30 Sep 2018 at 20:53, jpff <[hidden email]> wrote:
Rory, can you test on the latest code in github?  I cannot see how te
change which is running everywhere else could cause the empty list,
especially as it runs on Linux and is simple code.