You can do that at the top of the buffer or in your init.rb, which resides in the directory .sonic-pi (under Linux this is in your home directory, not sure where to look for it under Windows). This file will get loaded anytime you start SP and the contained variables will get initialized.
Furthermore have a look at the chapter 3.6 and 3.7 to see how you can reference samples on your harddisk (keywords: indexing and filtering samples).
So Sam calls a directory via ebit_pad and filters the contained sample filenames via two strings “120” and “Cm”.
Thanks for your answer it’s very helpful!
I know how to add a sample as a variable but it was odd for my to watch Sam writing directly the sample’s name without noticing any variables on the top of buffer.