Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/server/ruby/lib/sonicpi/lang/sound.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@ def sample_loaded?(*args)
doc name: :sample_loaded?,
introduced: Version.new(2,2,0),
summary: "Test if sample was pre-loaded",
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` file, returns `true` if the sample has already been loaded.",
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` file, returns `true` if the sample has already been loaded.",
args: [[:path, :string]],
opts: nil,
accepts_block: false,
Expand All @@ -2132,7 +2132,7 @@ def load_sample(*args)
doc name: :load_sample,
introduced: Version.new(2,0,0),
summary: "Pre-load first matching sample",
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` file, pre-loads the sample into memory.
doc: "Given a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` file, pre-loads the sample into memory.

You may also specify the same set of source and filter pre-args available to `sample` itself. `load_sample` will then load all matching samples. See `sample`'s docs for more information." ,
args: [[:path, :string]],
Expand Down Expand Up @@ -2162,7 +2162,7 @@ def load_samples(*args)
doc name: :load_samples,
introduced: Version.new(2,0,0),
summary: "Pre-load all matching samples",
doc: "Given a directory containing multiple `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` files, pre-loads all the samples into memory.
doc: "Given a directory containing multiple `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` files, pre-loads all the samples into memory.

You may also specify the same set of source and filter pre-args available to `sample` itself. `load_sample` will load all matching samples (not just the sample `sample` would play given the same opts) - see `sample`'s docs for more information." ,
args: [[:paths, :list]],
Expand Down Expand Up @@ -2278,7 +2278,7 @@ def sample_duration(*args)
doc name: :sample_duration,
introduced: Version.new(2,0,0),
summary: "Get duration of sample in beats",
doc: "Given the name of a loaded sample, or a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` file returns the length of time in beats that the sample would play for. `sample_duration` understands and accounts for all the opts you can pass to `sample` which have an effect on the playback duration such as `rate:`. The time returned is scaled to the current BPM.
doc: "Given the name of a loaded sample, or a path to a `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` file returns the length of time in beats that the sample would play for. `sample_duration` understands and accounts for all the opts you can pass to `sample` which have an effect on the playback duration such as `rate:`. The time returned is scaled to the current BPM.

*Note:* avoid using `sample_duration` to set the sleep time in `live_loop`s, prefer stretching the sample with the `beat_stretch:` opt or changing the BPM instead. See the examples below for details.",
args: [[:path, :string]],
Expand Down Expand Up @@ -2528,7 +2528,7 @@ def sample(*args, &blk)
doc name: :sample,
introduced: Version.new(2,0,0),
summary: "Trigger sample",
doc: "Play back a recorded sound file (sample). Sonic Pi comes with lots of great samples included (see the section under help) but you can also load and play `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga` or `.flac` files from anywhere on your computer too. To play a built-in sample use the corresponding keyword such as `sample :bd_haus`. To play any file on your computer use a full path such as `sample \"/path/to/sample.wav\"`.
doc: "Play back a recorded sound file (sample). Sonic Pi comes with lots of great samples included (see the section under help) but you can also load and play `.wav`, `.wave`, `.aif`, `.aiff`, `.ogg`, `.oga`, `.flac` or `.mp3` files from anywhere on your computer too. To play a built-in sample use the corresponding keyword such as `sample :bd_haus`. To play any file on your computer use a full path such as `sample \"/path/to/sample.wav\"`.

There are many opts for manipulating the playback. For example, the `rate:` opt affects both the speed and the pitch of the playback. To control the rate of the sample in a pitch-meaningful way take a look at the `rpitch:` opt.

Expand Down Expand Up @@ -3452,7 +3452,7 @@ def normalise_args!(args_h, defaults={})

# TODO - this method doesn't seem to be used
def find_sample_with_path(path)
["wav", "wave", "aif", "aiff","flac", "ogg", "oga"].each do |ext|
["wav", "wave", "aif", "aiff","flac", "ogg", "oga", "mp3"].each do |ext|
full = "#{path}.#{ext}"
return full if File.exist?(full)
end
Expand Down
2 changes: 1 addition & 1 deletion etc/doc/tutorial/03.6-External-Samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ something to consider.

## Local Samples

So how do you play any arbitrary WAV, AIFF, OGG, OGA or FLAC file on your computer?
So how do you play any arbitrary WAV, AIFF, OGG, OGA, FLAC or MP3 file on your computer?
All you need to do is pass the path of that file to `sample`:

```
Expand Down
2 changes: 1 addition & 1 deletion etc/doc/tutorial/03.7-Sample-Packs.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ of potential candidates. A source can take two forms:
The `sample` fn will first gather all sources and use them to create a
large list of candidates. This list is constructed by first adding all
valid paths and then by adding all the valid `.flac`, `.aif`, `.aiff`,
`.wav`, `.wave` files contained within the directories.
`.wav`, `.wave`, `.mp3` files contained within the directories.

For example, take a look at the following code:

Expand Down
Loading