musikinformatik / SuperDirt

Tidal Audio Engine
GNU General Public License v2.0
519 stars 75 forks source link

ERROR: Primitive '_FilePos' failed when using SimpleMIDIFile.read(pathName) #217

Closed BroCorra closed 3 years ago

BroCorra commented 3 years ago

Hi everyone, I'm using Supercollider 11.2 in Windows 10. I have the right extensions required form the official documentation, in the following folder: ...\AppData\Local\SuperCollider\Extensions\SC3plugins

Every time I call the SimpleMIDIFile class I get the following error:

`ERROR: Primitive '_FilePos' failed.
Failed.
RECEIVER:
Instance of File {    (000001FCE7C4EB08, gc=A8, fmt=00, flg=00, set=02)
  instance variables [1]
    fileptr : nil
}
CALL STACK:
    MethodError:reportError
        arg this = <instance of PrimitiveFailedError>
    Nil:handleError
        arg this = nil
        arg error = <instance of PrimitiveFailedError>
    Thread:handleError
        arg this = <instance of Thread>
        arg error = <instance of PrimitiveFailedError>
    Object:throw
        arg this = <instance of PrimitiveFailedError>
    Object:primitiveFailed
        arg this = <instance of File>
    SimpleMIDIFile:read
        arg this = <instance of SimpleMIDIFile>
        var file = <instance of File>
        var time = nil
    < closed FunctionDef >  (no arguments or variables)
    Interpreter:interpretPrintCmdLine
        arg this = <instance of Interpreter>
        var res = nil
        var func = <instance of Function>
        var code = "m = SimpleMIDIFile.read("C:/..."
        var doc = nil
        var ideClass = <instance of Meta_ScIDE>
    Process:interpretPrintCmdLine
        arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Primitive '_FilePos' failed.
Failed.
RECEIVER: a File`

What could be the problem?

telephon commented 3 years ago

can you check if your file exists?

File.exists("your\path\to\the\file")

BroCorra commented 3 years ago

Thanks for this, actually the probem was related by the fact that the file was somehow unaccessible. I suggest the ones who have this issue to check the file permissions.

thanks @telephon

telephon commented 3 years ago

welcome!