Shuriken is an open source beat slicer which harnesses the power of aubio's onset detection algorithms and Rubber Band's time stretching capabilities. A simple Qt interface makes it easy to slice up drum loops, assign individual drum hits to MIDI keys, and change the tempo of loops in real-time. The JUCE library takes care of handling audio and MIDI behind the scenes.
For more info on aubio, Rubber Band, and JUCE please see:
http://www.breakfastquay.com/rubberband
To get started with Shuriken, first import an audio file. Audio samples are loaded into RAM before editing so the original files always remain untouched.
Shuriken calls on the abilities of libsndfile when importing audio files. For full details of supported file formats please see: http://www.mega-nerd.com/libsndfile/#Features
Shuriken also comes with sndlib statically built in. sndlib can read the following file formats:
For more info on sndlib please see: https://ccrma.stanford.edu/software/snd/sndlib/
Once an audio file has been imported, its waveform is displayed in the main window. Selecting “Onsets” and clicking “Find” will place a slice point at the start of every drum hit or note. Selecting “Beats” and clicking “Find” will insert a slice point at the beginning of every beat of the bar.
When searching for onsets or beats, you have the option to automatically adjust the position of each slice point by moving it to the closest, next, or previous zero-crossing. These options can be selected from the “Zero-X” drop-down list. The default setting is to ignore zero-crossings.
To add additional slice points, hover the mouse over the waveform and press the Insert key on the keyboard. To delete a slice point, select it and press Delete.
Though aubio does a good job of detecting onsets, you'll still probably want to adjust the position of the slice points manually before clicking “Slice”. Right-clicking on a slice point will reveal a context menu which allows you to move the slice point to the next or previous zero-crossing. Clicking on the waveform between slice points will allow you to audition each section of audio before slicing.
Once the waveform has been sliced, each audio slice is automatically assigned to a separate MIDI key starting from middle C (C4) and ascending chromatically. You can drag an audio slice left or right to assign it to a different key. Slices can be reordered then joined together by toggling the “Slice” button. To select multiple slices, click “Multi Select” on the toolbar then drag the mouse over the waveform.
“Detection Method”, “Window Size”, “Hop Size”, and “Threshold” affect the accuracy of aubio's onset and beat detection routines. The default settings should give good results in many, though not all, situations. Experimenting with the settings may produce better results in some instances.
The “Time Signature” and “Length” widgets allow you to specify the length of an audio loop in bars or beats. Shuriken then does the appropriate maths to calculate the BPM once the “Calc” button is clicked.
The Rubber Band library takes care of time stretching duties within Shuriken and provides two modes of operation: offline and real-time. To switch between offline and real-time mode, open the options dialogue and click the appropriate radio button under the “Time Stretch” tab.
Hint: if you find that JACK's DSP load is too high when time stretching in real-time mode, try setting “Window Size” to “Short”.
Global time stretching allows you to stretch/squeeze the entire audio loop.
In offline mode, first click the “Calc” button (or manually enter the current BPM in the “Original BPM” box) then enter the desired BPM in the “New BPM” box and click “Apply”.
In real-time mode, enter values into the “Original BPM” and “New BPM” boxes as before, but now the tempo of the audio can be changed on the fly. Try clicking the up and down arrows on the “New BPM” box.
Selective time stretching allows you to stretch/squeeze individual audio slices. You must be in real-time mode and the waveform must be sliced before the “Selective Time Stretch” button is enabled. Toggling this button will display markers between each audio slice. Simply drag a marker to stretch/squeeze the audio either side of it. Markers can be snapped to beats or divisions of a beat by selecting the desired setting from the “Snap” combo box (BPM must be set first). Toggle the “Selective Time Stretch” button again to leave this mode.
Note that un-slicing the waveform or switching to offline mode after working in selective time stretch mode causes any stretches to be rendered offline.
Options to fine-tune Rubber Band's operation are available as follows (taken from the Rubber Band documentation):
If “Audio Back-end” has been set to JACK (under the “Audio Setup” tab) then the “JACK Sync” option will also be made available. Use this option to synchronise the BPM of the audio with tempo changes in a sequencer. For this to work, you need to ensure that the sequencer is actually sending tempo change information via JACK (e.g. in Ardour 3 click the “external positional sync” button to change its text from “Internal” to “JACK”). “Original BPM” has to be fairly accurate for this to work well, so you may need to adjust it manually.
The JACK Outputs dialogue becomes available when “JACK” is selected as the audio back-end. The dialogue displays a grid which allows you to route any audio slice to any of Shuriken's outputs. The number of outputs can be increased up to a maximum of 16 stereo outputs.
Shuriken allows audio slices to be exported as individual audio files in WAV, AIFF, AU, FLAC or Ogg format, with options for encoding (e.g. 16-bit PCM) and sample rate. There are also options for exporting a Hydrogen drumkit, SFZ, or Akai .pgm file. A standard MIDI file may be exported either on its own or along with the audio files. When exporting a MIDI file, you will be asked to confirm the BPM and time signature in case one or the other has not yet been set in the main window. Note that MIDI files store tempo in terms of quarter notes rather than beats per minute, so a drum loop at 140 BPM where the beat is an eighth note would have a tempo of 70 quarter notes per minute.
Shuriken has full support for Non Session Management. It is possible to import an existing project into a NSM session as well as export a project from a session.
Shuriken also has support for LADISH L1 session management. On receiving the SIGUSR1 Unix signal, Shuriken will save the current project. On receiving the SIGTERM signal, Shuriken will ask the user if any unsaved changes should be saved, then exit cleanly. Shuriken can deal with these signals being sent in quick succession and in any order; any save operation will complete before the application shuts down.
To allow LADISH to open a saved project, the file path of the project can be given as an argument when starting Shuriken from the command line, e.g.:
shuriken '/home/user/project.shuriken'
When using Shuriken in a LADISH session, make sure “Audio Back-end” is set to JACK in the Options dialogue otherwise Shuriken will terminate when you try to save the session!
Add slice point | Insert |
Delete slice point | Delete |
Move slice point to next zero-crossing | N |
Move slice point to previous zero-crossing | P |
Slice waveform | Return |
Toggle monophonic mode | M |
Reverse audio | R |
Apply gain | G |
Apply gain ramp | Shift + G |
Delete audio slice | Delete |
Select next audio slice | Z |
Play selected audio slice | A |
Select previous audio slice | Q |
Play all audio slices in sequence | Spacebar |
Select/move | 1 |
Multi select | 2 |
Audition | 3 |
Scroll waveform left | Left cursor key |
Scroll waveform right | Right cursor key |
Zoom in | Ctrl + + (see note below for UK keyboard layouts) |
Zoom out | Ctrl + - |
Zoom original | Ctrl + 0 |
Note: on a UK keyboard you'll need to use the + key on the keypad if you want to avoid pressing Ctrl + Shift + +