Sample arguments

Hi everyone,
Not sure if this website is still looked at, but I thought I would post my question anyway - in some of Sam Aaron’s live coding videos (e.g. Outrun) he uses the syntax:

sample ebit_bass, "120","Cm",1, lpf: 100,amp: 5

I was wondering what all the arguments were? I understand lpf and amp but I didn’t know you could have other arguments for samples.
I assume these are special samples, but could I take my own samples that could take args like this?

Thanks for reading and helping me out

1 Like

Hello @TheDragonsApprentice,
This forum is definitely still active! :slightly_smiling_face:

There’s nothing extraordinary about the samples that Sam was playing with - just a collection that he had on his computer.
The same functionality has been available in Sonic Pi since version 2.10 - so you can definitely do a similar thing with your own samples.

The syntax you see is explained in section 3.7 of the built in tutorial - (or see
Basically, it’s a way to select a collection of samples that you might have on your computer, and filter this, to play from a potentially narrowed down range of them, even playing a sample at a specific index in the resulting list.


Wow that was quick!

Thank you, I never read that bit in the instructions (I probably should have looked before I commented here :upside_down_face:).

Hi @TheDragonsApprentice,

oh yes, this website is definitely looked at!

(@ethancrawford was faster :wink: but I’ll post anyway, might be helpfull in addition)

you can reference external samples in different ways. E. g. you can specifiy a path like so at the top of your buffer:

ebit_bass = "/path/on/my/harddrive/"

If the folder harddrive contains samples e. g. named like

bass_120_Cm.wav # 1, note: this is index 0!
bass_120_Cm_long.wav # 2
bass_90_CM.wav # 3

you can than specify the second sample via string values and an index like:

sample ebit_bass, "120","Cm",1 # path, substring1 in filename, substring2 in filename, index

Thank you! I now realise how un-inactive this site is :slight_smile: That helps a lot

Yes, well, sometimes it is rather quiet for a week or so and then again loads of postings. But you can be sure that what you write will be noticed! And, according to my experience, most questions will finally be answered even if it takes some time…