Skip to content

Suggested addition to the sound.rb file to find sample names #2030

Open
@rbnpi

Description

@rbnpi

I have found the need to know the sample name matched by path,n and would find it useful to have a function like this added. Just returns first single match.

define :findSampleName do |path,num|
  #returns matched sample name if any for given path and offset
  filts_and_sources,_ = sample_split_filts_and_opts [path,num]
  if sample_find_candidates(filts_and_sources).length > 0
    return sample_find_candidates(filts_and_sources)[0]
  else return "none found"
  end
end

could return nil instead for no match.
It seems to work ok when run in a SP buffer.
EDIT (of course changed to Ruby def format to go in sound.rb file)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions