OP-1 / OP-Z / PO-33 sample packer

The OP-1 / OP-Z / PO-33 sample packer, is a command line interface ("CLI") utility, which generates sample packs for the Teenage Engineering OP-1, OP-Z synthesisers and PO-33 sampler.

Features at a glance

  • Makes samples always fit in memory, by seamlessly downsampling and re-pitching of all content.
  • Automatic variation patch generation for unused slots for maximum sonic bang-for-your-buck.
  • Automatic chromatic multi-sample assignment.
  • Chord generation.
  • Sophisticated editing via simple file name manipulation.
  • Dedicated OP-1/OP-Z and PO-33 modes.
  • Automatic conversion of 8-bit, 16-bit, 24-bit and/or stereo channel WAV files.
  • High quality downsampling anti-aliasing filter.
  • Fully standalone, without reliance additional frameworks or VST hosts.
  • Native cross-platform executables for Windows, macOS and Linux.

Usage

Though the application is invoked through the command line, its operation primarily involves using your operating system's native file manager to change file names.


Basic operation

Basic operation

Create a new directory on your system.
Add all samples in the form of WAV files to the directory.
Invoke OP-1/Z Sample Packer like so;

macOS
$ ./op1zsamplepacker-macos "<WAV files directory location>"
Linux
$ ./op1zsamplepacker-linux64 "<WAV files directory location>"
Windows
op1zsamplepacker-win64.exe "<WAV files directory location>"

Upon exection, the packer will compile the samples into a file named samplepack.aif. This file nominated <WAV files directory location>. Please note that any previous file named samplepack.aif in that directory will be overwritten. Absolute and relative paths for the <WAV files directory location> are supported.


OP-1/OP-Z mode vs PO-33 mode

The OP-1/OP-Z sampling engine and PO-33 (and variants) sampler are obviously rather different beasts. The OP-1/OP-Z is able to import new sample packs over USB, while new samples for the PO-33 can only be added by sampling them live via the line-in.

As such, sample packs for the PO-33 have no concept of one-shots, loops or chromatic multisampling. The dynamic downsampling feature, however, still applies. The chord generation feature too can be quite useful on the PO-33.

The application will always downsample to the nearest semi-tone (e.g 12 per octave), so that it is possible to restore the original pitch of the samples by jumping semitones, rather than some other, more difficult to achieve measure.

Using the application in PO-33 mode

The amount of available sample space per pack is fixed on the OP-1/OP-Z (12 seconds at 44kHz). However available free sample space (40 seconds in total, ~23 seconds with factory samples loaded) on the PO-33 may vary depending on what other samples are already present on your device. Therefore, the application requires you to specify the sample pack length in seconds in PO-33 mode.

To activate PO-33 mode for a collection of samples, append a space, followed by 'PO-33.', followed by the amount of seconds to the name of the directory that contains your samples. For example 'Drumkit PO-33.7' will launch the application in PO-33 mode and will squeeze all samples in that folder into 7 seconds.

For your convenience PO-33 sample packs will have their samples separated by 200ms seconds of silence.

Please note that, because the PO-33 pitch correction does not go beyond one octave, the dynamic downsampling feature will issue a warning if it is forced to downsample more than one octave (since the pitch difference can no longer be compensated for on the PO-33 by changing the sample's pitch playback). It may still be possible to achieve the correct pitch by using FX 8 ("ocd").

A PO-33 sample pack is preceded by a 200ms pulse which is tuned to 440Hz (A) at its corrected pitch. This pulse serves three purposes;

  • It will cause the PO-33 to start sampling without the first sample needing to reach a threshold (potentially cutting off the first sample).
  • It serves as an audio cue for the user
  • Most importantly, it serves a a calibration tone for easy calibration of the pitch to the original samples' pitch.

To restore sped-up samples to their original pitch, it is highly recommended to have a reference 440Hz tone handy. Since the PO-33 does not provide a precise readout of the pitch correction on its display, calibrating the 200ms pulse against a 440Hz reference tone is an easy way to ensure all samples will play at their originally intended pitch. To change the pitch of your samples, press the FX button until the display says 'ton', then change control knob A to match the pitch

Alternatively, you can try calibrating by ear; make note of the semitone value that the application outputs for each sample, by carefully changing control knob A, you can jump semitones, where fully turned left corresponds with a semitone value of -12. When dealing with a sample (for example a drum loop) where pitch is harder to establish, you may wish to create a pattern that plays the full drumloop at the original BPM in a loop. Adjust the sample's pitch until the loop is playing back seamlessly.

Using the application in OP-1/OP-Z mode

The application operates in OP-1/OP-Z mode by default and no special modifications need to be made to the directory name.


Sample attributes

List of file names and their sizes.
Some simple file name manipulation turns 4 large separate piano samples (C sharp 5, F3, F sharp 4, C 4) into a playable instrument that first perfectly onto your OP-1/OP-Z.

Various attributes can be set to change the way the samples are played back, or even to pre-process the samples themselves. Setting these attributes is done by adding one or more parameters to the file name. For example, by extending a file named 'Piano C4.wav' to 'Piano C4 Oneshot ChromaticMultiSample,0.wav' will turn the sample into a one-shot (e.g. always make it play to the end regardless of lifting your finger), and will make all keys play the sample, however pitched according to their keys. In other words, this simple change in file name will make the bare piano sample behave as a true piano once imported into your OP-1/OP-Z.

Oneshot

This will cause the sample to play to the end, regardless of whether you lifted your finger from the key. To set this attribute, change any file name to include the word "oneshot", either at the end ('funky drum oneshot.wav'), before the '.wav' extension or somewhere in the middle ('funky oneshot drum .wav') by flanking the word with spaces, e.g. " oneshot ".

Loop

This will cause the sample to loop continuously as long as the key remains pressed. To set this attribute, change any file name to include a the word "loop", either at the end ('funky drum loop.wav'), before the '.wav' extension or somewhere in the middle ('funky loop 120BPM.wav') by flanking the word with spaces, e.g. " loop ".

ChromaticMultiSample

This powerful feature automatically creates multi-sampled, playable instruments from one or more samples. The resulting instrument is fully playable across two octaves and can sound rather more realistic than the single-sample 'instrument' sampling engine.

To set this attribute, change any file name to include a the word "ChromaticMultiSample" at the end ('piano c#4 chromaticmultisample,-1.wav'), before the '.wav' extension. Following the the word "ChromaticMultiSample", you should add a comma and the root note in semitones of the sample, relative to middle-C (e.g. the 8th key on the OP-1/OP-Z). For example, if your sound is from striking a C sharp piano key, that number should be 1 (it is one key up from middle-C). Another example, if your sound is from striking an F piano key and you want to use that for the lower octave on your OP-1/OP-Z, then the number should be -7 (it is 7 keys down from middle-C). Because the application will automatically pitch up/down to the correct note pitch, you can use source samples that are outside the range of the OP-1/OP-Z's keyboard. For example a very low E would correspond to the number -8 (it is 8 keys down from middle-C, one key beyond the lowest key on the OP-1/OP-Z keyboard).

A list of file names.
Generating four 'pre-baked' chord samples from a single A-note piano sample.

Samples are automatically allocated to the 24 keys, based on their original pitch and proximities on the scale, ensuring optimal keyswitching and sonic fidelity. This means you do not need samples for every key; samples are automatically re-used and pitched up or down as needed for you. The latter behavior is done by the OP-1/OP-Z, so no extra sample space is used. For example, you may well find that you only need 4 samples to re-create a realistic sounding piano, rather than having 24 individual samples for all notes.

Of course, on top of all automatic re-pitching and re-mapping of samples, sits the automatic re-sampling; no matter how many real samples you use or how long they are, the application will always make them fit by seamlessly trading off final sample quality for space as needed.

Chord

This feature creates chords from single samples. Particularly when polyphony is at a premium (as is the case on the OP-1/OP-Z and PO-33 devices), 'pre-baking' some chord samples may be the way to go. To use the feature simply add the word "Chord" at the end ('piano Chord,0,Bbdim.wav') before the '.wav' extension. Following the word Chord, add a comma, then the root note relative to C, and add the note, an optional note type character (flat 'b' or sharp '#') immediately followed by the chord type.

The following chord types are supported; 'm', 'maj' (equivalent to can omitting a chord type entirely as well), 'maj6', 'dom7', maj7', 'aug', 'aug7', 'maj7+', 'dom9', 'min' (equivalent to 'm'), 'min6', 'min7', 'minmaj7', 'dim', 'dim7', 'm7b5', and 'dimmaj7'.

ChordSemitones

This feature is largely similar to the Chord feature, except that here, the notes of the chord can be specified in semitones relative to the sample. To use the feature, simply add the word "ChordSemitones" at the end ('piano ChordSemitones,-3,0,4.wav') before the '.wav' extension. Following the word ChordSemitones, add a comma and add the note and chord type. The note type can be flat 'b' or sharp '#'.


Automatic variation generation

When keys remain unoccupied, the application will populate them with automatically generated, musically useful playback variations. The way these variations are generated depends on their sample attributes.

For loops

Variations for samples with the 'loop' attribute set, will alternate between rhythmically useful pitch frequency multiples. This includes, for example, 2x speed ups, 2x slow downs and their reversed variants.

Overlaying the variants over their original samples, can yield interesting drones and novel rythmical patterns. Overlaying higher pitched variants can further mask any loss in high frequencies in case of severe downsampling.

For all other types

Variations for all other samples will alternate between slightly pitched up and pitched down variants. This also includes their reversed variants.


Examples

Three examples are included in the application's ZIP file.

Chromatic Multi Sample

This example creates a multi-sampled, playable piano instrument out of 4 separate piano samples pitched at F3, C4, F#4 and C#5.

Notice the extra output when building the sample pack;

Sample allocation
[ 2][ 2][ 2][ 2][ 0][ 0][ 0][ 0][ 0][ 0][ 1][ 1][ 1][ 1][ 1][ 1][ 1][ 3][ 3][ 3][ 3][ 3][ 3][ 3]
Sample pitch
[-1][ 0][ 1][ 2][-4][-3][-2][-1][ 0][ 1][-4][-3][-2][-1][ 0][ 1][ 2][-4][-3][-2][-1][ 0][ 1][ 2]

The output above shows which sample (first sample is #0) is allocate to which of the 24 keys ("sample allocation"), and how that sample was pitched.

PO-33.12

This example builds a sample pack for the PO-33, consisting of 2 long loops (8 seconds each), squeezed into 12 seconds (as denoted by the ".12" part of the folder name). Playing back the sample you will hear a calibration tone followed by the sped up samples. Once recorded on the PO-33, pitch down the calibration tone until it is playing at 440Hz (A).

Chord

This example creates 4 different chords (A# major, D minor, F major, G minor) out of 4 identical, single-note piano samples.


WAV file compatibility

The application is currently compatible with WAV files recorded in 8-bit, 16-bit and 24-bit, stereo or mono. If you have WAV files that are not compliant with any of the above, please use a utility like Audacity to batch convert them first.


License / Legal

You are free to use this software for personal use. You may not host it elsewhere, included it in some bundle or sell it. All rights reserved. The author does not accept any responsibility or legal liability for any bugs, misuse or misapplication of this software, nor for any loss of data as a result of using this software. Use at your own risk. The author, nor this software is associated with the Teenage Engineering company. Any samples included in the application download as part of the examples, have been licensed under Creative Commons 0 license by their creators.


Omnivore
SiliconFields