Slash or backslash

In the help of Sonic-Pi in French (congratulations for this great work!), I noticed an error in the chapter: “Echantillons Externes”. Windows paths are made with backslashes. User: \ and no User: /, as in linux. It is little but we understand better anyway!

Merci pour ce merveilleux instrument de musique.



would it be possible to link to the equivalent path in the English tutorial here:

It might be a bug or possibly a translation error. However, finding the English version will help us get to the bottom of this.

bonjour @jean31270

peux-tu copier-coller ce que tu penses être une erreur car même sous windows les slashs marchent parfaitement.

yourSamplesPath = "D:/audio/mesSamples/" 

Bonjour, j’en étais resté à l’époque où Windows ne supportait pas le slash. Au temps pour moi!

Alors comment faire pour jouer n’importe quel fichier WAV, AIFF ou FLAC sur votre ordinateur ? Tout ce dont vous avez besoin est de passer le chemin de ce fichier à sample :

Raspberry Pi, Mac, Linux

sample “/Users/sam/Desktop/my-sound.wav”


sample “C:/Users/sam/Desktop/my-sound.wav”

Raspberry Pi, Mac, Linux

sample “/Users/sam/Desktop/my-sound.wav”, rate: 0.5, amp: 0.3


sample “C:/Users/sam/Desktop/my-sound.wav”, rate: 0.5, amp: 0.3

Apologies, I don’t speak French, so I hope an English answer is OK.

In the host language, Ruby, the backslash has a special meaning in strings - it “escapes” characters. This makes it more cumbersome to use when describing file paths.

Ruby therefore allows you to use / in paths to all operating systems and converts it automatically to \ on Windows. The only major difference between the two forms of OS is that Windows needs a disk prefix such as C: and the others start with a simple /.

I hope that this helps.