Sample mode

BoxyLady user manual

There are several commands available in sample mode to load and save samples.

Loading samples from disc: patch(@SLOT format(FORMAT) file(FILENAME) instrument). Loads FILENAME into SLOT, assuming the file type given by FORMAT. This can be wav where the file is a RIFF-WAV file, or raw for headerless audio data. instrument is optional: if set, the corresponding flag is set in the instrument, intending its use as a looping instrument sample. "Instrument" patches are designed to be short, and are looped while producing a longer note, as opposed to longer, unlooped patches whose note length is limited by the length of the patch.

Copying samples in memory: copy(SLOT NEWSLOT) makes a duplicate of SLOT as NEWSLOT. Slot names must be unique.

Saving to disc: output(@SLOT format(TYPE) file(FILENAME)). As above, TYPE can be wav or raw.

Renaming slots: rename(SLOT NEWSLOT).

Repeating slots (multiple times): repeat(@SLOT n=COUNT) replicates SLOT COUNT times, where COUNT is an integer.

Creating a new silent voice in a slot: create(@SLOT type(FORMAT) channels=CHANNELS len(T-TIME P-TIME)). FORMAT, T-TIME and P-TIME (seconds) are explained earlier. CHANNELS should be 1 for mono and 2 for stereo.

Deleting slots: delete(LIST OF SLOTS). Multiple slot names can be specified. delete(*) deletes all slots.

Resizing voices: resize(@SLOT TYPE len(T-TIME P-TIME). TYPE can be absolute or relative (additions) to the current times, in seconds.

flags SLOT(LIST_OF_FLAGS): if the list contains instrument, instrument is set for this slot. patch turns it off.

A range of music functions can be applied to a voice in memory in a slot, from sample mode.

Volume functions

amp(@SLOT mode=vol a(A)): multiply the volume of SLOT by factor A (can be 0, <0, <1, or >1).

amp(@SLOT mode=lr a(STEREO)): as above, but using the multiplication factors in STEREO on a stereo channel. Here and below, STEREO should be a pair of the form (L R).

amp(@SLOT mode=stereo a(STEREO) x(STEREO-R)): Multi-purpose function using two STEREO parameter blocks. The channels are not only multiplied by STEREO, but in addition have added the signal with the channels swapped and multiplied by STEREO-R. Can be used to invert stereo, widen stereo, cancel central signal, and so on.

amp(@SLOT mode=inverse): invert the signal for SLOT.

fade(@SLOT mode=OP): OP can be one of the following: fade_in, fade_out, linear_fade_in, linear_fade_out, pan_swap, pan_centre, pan_edge, manual. fade_in and _out perform logarithmic fading. In all cases, fading occurs over the whole sample. pan_swap, pan_centre, and pan_edge do not fade as such, but attempt to change the perceived stereo position.

fade(@SLOT mode=manual start_a(STEREO) end_a(STEREO) start_x(STEREO) end_x(STEREO)): Performs a time-varying equivalent to amp(@SLOT mode=stereo ...) where start_a and start_x specify the initial multiplication factors, and end_a and end_x are those to be reached by the end of the sample.

crossfade(@NEWSLOT start=SLOT1 end=SLOT2): Fades out a copy of SLOT1, fades in a copy of SLOT2, and puts the superimposed result in NEWSLOT.

envelope(@SLOT e(ENVELOPE)): Applies a sound envelope to SLOT. The format of ENVELOPE is explained earlier.


tremolo(@SLOT wave=(FREQ AMP OFFSET)): performs a tremolo on the voice given by SLOT using the parameters in WAVE. Strength of tremolo (0-1) is given by the wave amplitude AMP.

ringmod(@SLOT f=FREQ): performs ring modulation with frequency FREQ. Can also be used to give a tremolo effect.

distort(@SLOT pow=POWER): adds distortion to the voice by raising all unsigned values to the power POWER.

chorus(@SLOT n=NUM offset=OFFSET): creates a chorus effect of NUM voices, within an approximate time interval of OFFSET (s).

flange(@SLOT f=FREQ a=AMP): adds a flanging effect with two voices, one subject to vibrato at frequency FREQ and amplitude AMP.

bitcrusher(@SLOT bits=BITS): distorts the voice by downsampling to BITS bits. The signal remains 16-bit, internally.

lowpass(@SLOT r=X): performs a low-pass filter using the parameter X.

highpass(@SLOT r=X): as above.

Special effects

reverb(@SLOT delay=DELAY a=AMP n=NUM) adds NUM echoes to SLOT, offset each in turn by time DELAY (s) and of downward volume step of AMP (0 to 1).

reverse(@SLOT) reverses (i.e. so it plays backwards) the sample.