byulparan / cl-collider

A SuperCollider client for CommonLisp
Other
218 stars 23 forks source link

Sample loading on windows #139

Closed MarcRohrer closed 3 months ago

MarcRohrer commented 3 months ago

Hi Sungmin,

I started going through the tutorial. I guess yet another windows problem? When I want to load a sample from its original location, it is not found. But when I copy it to the project-directory it is loaded fine...

ANSSET> (defvar *bd* (buffer-read "F:\\Samples\\bassdrum vinyl\\Kick14.wav"))
; Debugger entered on #<SIMPLE-ERROR "File does not exist: ~a" {237B6EE9}>
[1] ANSSET> 
; Evaluation aborted on #<SIMPLE-ERROR "File does not exist: ~a" {237B6EE9}>
ANSSET> (defvar *bd* (buffer-read "Kick14.wav"))
*BD*
ANSSET> 

Thank you very much for your attention!

Marc

defaultxr commented 3 months ago

I don't use Windows either, but it's possible that SBCL (or whatever Lisp compiler you're using) represents Windows paths in a different way. I know some programming languages use forward slash for directory separators even on Windows, so it may be that SBCL does similar. If that is the case, you'd need to use (buffer-read "F:/Samples/bassdrum vinyl/Kick14.wav") instead (i.e. / instead of \\).

Since you're on Windows, *win-sc-dir* should be defined and set to the directory that contains the SC binary. So that variable should give you an indication of the pathname format SBCL might be expecting. If you type cl-collider::*win-sc-dir* into the REPL, it should show you the path it generated.

MarcRohrer commented 3 months ago

Hi,

thanx a lot! Unfortunately, none of those works...

ANSSET> (buffer-read "F:/Samples/bassdrum vinyl/Kick14.wav")
; Debugger entered on #<SIMPLE-ERROR "File does not exist: ~a" {23ECC421}>
[1] ANSSET> cl-collider::*win-sc-dir*
#P""
[1] ANSSET>

Marc

ntrocado commented 3 months ago

I believe the problem was introduced (for Windows) with this commit: https://github.com/byulparan/cl-collider/pull/131/commits/74b5a8ea64e470a47ffbf04aa1b962cb8bac4d7d In Windows ? is reserved, so there won't be any filenames with those characters anyway.

I will submit a PR: can you test if it works for you?

ntrocado commented 3 months ago

[1] ANSSET> cl-collider::win-sc-dir

P""

This is weird...

MarcRohrer commented 3 months ago

Hi,

yes of course, I can test it. I am not that experienced with the workings though. What exactly do I have to do to test, if it works?

Thank you!

Marc

MarcRohrer commented 3 months ago

Hi,

i just upgraded via ocicl and it works now! Thank you very much!

Marc