Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Initial preview of the Sample Drawer

Jacek Konieczny edited this page Aug 12, 2020 · 4 revisions

Proof of Concept / Request for Comments

Why am I doing this?

Whenever I tried to play with audio samples, or even IR response files I had a feeling I am getting lost. Even with just a few .wav files – how to name them? Where to keep them? How do I find the one I want to use?

Previously, when I was thinking about this I was looking for an existing tool and didn't find anything that would satisfy my (imaginary?) needs and the last time… I didn't even look, just started making my own.

With some general idea in mind I began hacking some simple proof-of-concept prototype of the Sample Drawer. That took more time than I have anticipated.

General idea

Sample Drawer allows you to browse and play audio files directly from the filesystem and to import them to a library with any metadata one can imagine. It is supposed to be able to handle thousands of small audio files and make it easy to find the sample one needs at a moment.

There could be ways to batch processing of the samples for future use – like converting file formats, normalization, etc. Some metadata could be extracted/computed from the actual audio.

screenshot

The main window is split into six parts:

  • Media player – for playback of the currently selected item
  • File browser – for browsing local files
  • Library items – lists library items matching current query
  • Tag list – for restricting search to specific tags
  • Workplace – place for temporary collection of samples and for destructive edits (normalization, resampling, pitch shifting, etc.)
  • Metadata list – shows know metadata for the selected item(s)

Current state

It is still a prototype / work in progress. But it is a good time to try it and provide some feedback.

Installation

Currently this has been designed for and tested only on Ubuntu 20.04 based systems. To run it here:

Install the dependencies:

sudo apt update
sudo apt install git pyside2-tools python3-pyside2.qtcore python3-pyside2.qtgui \
            python3-pyside2.qtmultimedia python3-pyside2.qtuitools python3-pyside2.qtwidgets \
            python3-appdirs python3-cffi python3-soundfile make qtbase5-dev-tools

Get the code:

git clone https://github.com/Jajcus/sampledrawer.git

Build the resources:

cd sampledrawer
make

Installation should not be harder or any other modern Linux distribution. Python older than 3.8 and Qt older than 5.12 might not work, though. The code was written with cross-platform portability in mind but making it actually work on Windows or Mac will probably require some extra work.

Usage

Sample Drawer can be started straight from the repository by running:

./sampledrawer

To check a file in your filesystem just find and select in the left area. A waveform will be displayed and 'play' button will start the playback. Unless the file type is not recognized.

You can than drag and drop the file in other application, in the library (by putting it in the 'Library items' or 'Tags' boxes) or into the workplace area (middle bottom area). When importing into the library there is a chance to attach own tags and later it will be possible to set other custom metadata there. Program tries guess the right name and tags for the samples from the file path (try importing a directory or multiple files).

To quickly build the library from samples already on your disk, use the command-line interface, e.g.:

./sampledrawer --import /usr/share/sounds --tag system
./sampledrawer --import /usr/share/gx_head --tag guitarix
./sampledrawer --import /usr/share/hydrogen/data --tag hydrogen

Note: every sample in the library can have a single name, multiple tags and any amount of other metadata information (currently can only be set via command-line with the --set option). The names are not unique, but the samples are. One sample (specific file contents) cannot be imported twice into the library – so there are never exact duplicates there. The same sample can still be stored in a different file format or sample rate.

Sample Drawer automatically extracts some metadata from the imported files (currently: file format, duration, peak level).

All metadata can be searched. Just entering words in the search bar would invoke full text search on the names and metadata.

Tags can be hierarchical (e.g.: '/drums', '/drums/snares', '/drums/cymbals', '/drums/cymbals/crash', or free-floating, e.g. 'shotgun'). Selecting tags in the 'Tags' widget limits items shown, as the search bar.

Only 100 first matches will be shown. Add more keywords or select tags to refine the search.

Some special queries are also possible:

  • '+tag': Requires given tag on the items (all the tags listed wit '+' are required)
  • '?tag': Includes given tag in the list (items matching any of the tags will be selected)
  • '-tag': Excludes given tag
  • 'key=value': Exact match for given metadata value

Sample Drawer can be used to browse just a specific part of the file system with the --root option:

./sampledrawer --root /usr/share/sounds

Unwanted UI widgets can be hidden with F2-F7 keys (not permanently yet), to get just a simple directory browser.

Request for comments or other feedback

At this moment I would like to know if what I do makes sense, if I should continue and which way should I go from here.

My main question for you are:

  • Do you think you need such a tool?
  • If you are already working with many small audio files:
    • What is your current workflow?
    • What kind of meta-data is important for you?
    • How do you find the file you need for a specific project?
  • Is there any specific file processing useful before importing files to a library
  • Is there any specific file processing useful before using samples in a project (before pasting them to a DAW)?
  • Are there any serious errors in my current idea?

There lots of bugs and missing functionality I know about, but feel free to open GitHub issues with bug reports or feature requests. Keeping track of those won't hurt.