- [ av~ ]
- [ gme~ ]
- [ ntof ]
- [ arp ]
- [ rand ]
- [ rind ]
- [ flenc ]
- [ radix ]
- [ sly ]
- [ is ]
- [ has ]
- [ paq ]
- [ tabread2~ ]
- [ chrono ]
- [ delp ]
- [ linp ]
- [ same ]
- [ sesom ]
An implementation of FFmpeg for audio playback of almost any media format.
[avr~] is a variant that uses the RubberBand time-stretching algorithm to change tempo.
When building, the FFmpeg libraries are dynamically linked by default, which means that you'll need a local installation of these libraries in order for the external to work.
Includes the following features:
-
play/pause and seek functionality.
-
changing the speed of playback.
-
reading and iterating through m3u playlists.
- It reads pseudo m3u playlists. Each line in the m3u should be just the file name, preceded by a path relative to the location of the m3u if they don't reside in the same folder.
-
opening files from http urls.
-
retrieving metadata.
- float
-
The channel layout. Defaults to stereo if no args given.
-
Channel layout is a 64-bit integer with a bit set for every channel (1 << channel). A full list of available channels can be found here: https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/channel_layout.h
-
-
bang - Play/pause the currently loaded track.
- Sends
play (1|0)through the last outlet to indicate whether it's playing or paused.
float - (Re)start playback of a given track number
- Zero will stop playback.
anything - Look for matching metadata
- If metadata is found, it will be sent through the right-most outlet.
- Sends
- A file must be successfully opened for any of these to work
- signal - Change the playback speed.
-
speed can be a factor between 16 and 1/16th.
-
speed can also be altered by sending the message
[speed $1(to the 1st inlet.
-
-
signal - Left channel
-
signal - Right channel
- How many signal outlets there are depends on the first creation arg (channel layout), with the default being stereo.
-
list - Outputs various messages including information regarding whether a file was successfully opened, whether a track is currently playing, track metadata, etc. Usually in
key: valueform.
-
[print $.. (- Prints metadata info.-
If no args given, it will print general info. Otherwise, it will print custom info.
-
metadata needs to be surrounded with percent signs.
- Example
[print %artist% - %title% (
- Example
-
-
[send $1 (- Sends the value of a key in metadata through the last outlet. -
[open $1 (- Attempts to open a file.- Sends
open (1|0)through the last outlet to indicate success or failure.
- Sends
-
[seek $1 (- Seek to a track position. -
[speed $1 (- Set the playback speed. -
[play [$1] (- Set playback state to either playing or paused.- Acts as a toggle when no args are given.
- When an arg is given, state is forced to playing(1) or paused(0).
-
[conv $1 (- Change the interpolation algorithm.- Options include:
- Sinc (good | medium | fast)
- Zero-order hold
- Linear (the default)
- Options include:
-
[stop (- An alias for[0 (. -
[pos (- Returns the track position.
A Pd interface for the Game Music Emu library, created by Shay Green and maintained by Michael Pyne at https://bitbucket.org/mpyne/game-music-emu
Compatible formats include: AY, GBS, GYM, HES, KSS, NSF/NSFE, SAP, SPC, VGM/VGZ
[gmes~] is a multi-channel variant. Not all formats will work properly with this external.
[gmer~] is a variant that uses the RubberBand time-stretching algorithm to change tempo.
- float
- channel muting bit mask. Default is 0 (all channels unmuted).
-
bang - Play/pause the currently loaded track.
- Sends a 1 or 0 through the last outlet to indicate whether it's playing or paused.
float - (Re)start playback of a given track number
- Zero will stop playback.
anything - Look for matching metadata
- If metadata is found, it will be sent through the right-most outlet.
- A file must be successfully opened for either of these to work
-
signal - Change the playback speed.
- speed can be a factor between 16 and 1/16th.
- speed can also be altered by sending the message
[speed $1 (to the 1st inlet.
-
signal - Change the tempo (rate of emulation).
- tempo can be a factor between 4 and 0.02.
- tempo can also be altered by sending the message
[tempo $1 (to the 1st inlet.
-
signal - Left channel
-
signal - Right channel
-
list - Outputs various messages including information regarding whether a file was successfully opened, whether a track is currently playing, track metadata, etc.
[gmes~] works with 16 signal outlets, one left and one right channel for 8 distinct voices.
-
[print $.. (- Prints metadata info.-
If no args given, it will print general info. Otherwise, it will print custom info.
-
metadata needs to be surrounded with percent signs.
- Example
[print %game% - %song% (
- Example
-
Acceptable metadata terms include:
- system, game, song, author, copyright, comment, dumper, path, length, fade, tracks
-
-
[send $.. (- Sends metadata info through the last outlet. -
[mute $.. (- Mute/unmute a set of channels.-
Zero unmutes all channels.
-
The same channel repeated toggles it on and off.
-
Muting is cumulative. New calls add to the mask's current state.
-
-
[solo $.. (- Solo/unsolo a set of channels.-
Zero unmutes all channels.
-
Soloing is not cumulative. New calls start with every channel muted and only the channels specified will become unmuted. However, if the resulting mask ends up being exactly the same as before, then the mask as a whole will act like a toggle and unmute all channels.
-
-
[mask $1 (- Assign directly to the mute mask.- Acts as a setter when an arg is given and a getter when it isn't. Sends the value through the last outlet.
-
[open $1 (- Attempts to open a file.- Responds with
open (1|0)through the last outlet to indicate success or failure.
- Responds with
-
[seek $1 (- Seek to a track position. -
[speed $1 (- Set the playback speed. -
[tempo $1 (- Set the tempo.-
Not to be confused with speed. Tempo changes the rate of emulation, while speed changes the rate of playback via resampling.
-
Speed and tempo together can pitch-shift very effectively.
-
-
[conv $1 (- Change the interpolation algorithm.- Options include:
- Sinc (good | medium | fast)
- Zero-order hold
- Linear (the default)
- Options include:
-
[play [$1] (- Set playback state to either playing or paused.- Acts as a toggle when no args are given.
- When an arg is given, state is forced to playing(1) or paused(0).
-
[stop (- An alias for[0 (. -
[time (- Returns the track's duration or -1 if unknown. -
[fade (- Returns the track's fade duration or -1 if unknown.
And [fton]
Similar to pd's [mtof] and [ftom] objects but with modifiable reference pitch and number of tones in equal temperament.
-
float - Reference pitch
-
float - Number of tones in equal temperament
-
float
[ntof]- MIDI note[fton]- frequency
-
float - Reference pitch
-
float - Number of tones in equal temperament
- float
[ntof]- frequency[fton]- MIDI note
-
[ref $1 (- Set the reference pitch. -
[tet $1 (- Set the number of tones. -
[set $1 $2 (- Set the reference pitch and number of tones respectively.- A numeric list also does this.
Creates a musical scale and uses various messages to quickly change the structure of the scale.
Based on creation args, the list that [arp] works with can be either internal or external.
- numeric list
-
The first arg acts as the root note.
-
All args that follow act as intervals relative to the root note.
-
The calculation for determining notes is essentially:
root_note + interval + octave * (interval_index / scale_size)
-
- symbol
- The name of an existing garray.
-
float - A scale index
- Indexes smaller or larger than the scale's size will rotate to lower or higher octaves.
list - To reassign the root + intervals with
- The size of the scale will also be changed based on the size of the list, unless strict mode is turned on.
- The inlets that follow will match the number of creation args and be associated with a specific interval or root.
-
float - The midi note of the scale index
-
list - Slices and alterations of scales
-
[print (- Print the current state of the scale.- A label is optional to help determine where the print request came from.
-
[n $1 (- Set the size of the scale.- When the requested size is bigger than the array's allocated size, the array will be resized and the inlets' float slots will be re-associated with the new addresses.
- Arrays have a resizing cap of 1024 floats.
- When the requested size is bigger than the array's allocated size, the array will be resized and the inlets' float slots will be re-associated with the new addresses.
-
[ref $1 (- Set the reference pitch. -
[tet $1 (- Set the number of tones per octave. -
[oct $1 (- Set the number of semitone steps per octave. -
[send $.. (- Send an alteration of the scale through the 2nd outlet without actually changing the internal scale.- No args sends the unaltered scale.
-
[#$1 $.. (- Reassign with a list, starting from a given index ( $1 ).- If no index is specified, the offset will default to zero.
-
Non-whole numbers will return a note between two intervals.
-
A float followed by an operator and another float (without spaces between them), Ex:
[1+2 (, will interpret the 1st float as the scale index, and the 2nd float as a last-minute adjustment to the value at that index in semitones.-
This will not reassign the value at that index.
-
The example given would return the 1st interval, raised by 2 semitones.
-
-
Non-numeric args will be skipped.
-
An operator (
+,-,*,/) followed by a number will perform this operation on the current value at a given index.- the operator just on its own will default to calculating with 1 .
-
An operator repeated (
--,++,**,//) will perform the same operation for every index that follows.-
A number before the operator acts as an iterator, such that the operation will only be performed for that many intervals. This may also implicitly change the scale size if strict mode is off, or if the list itself is not strict.
-
A number after the operator acts as the amount. If none is specified, the operator will default to calculating with 1.
-
Example:
[foo 2++4 (skips the root note and raises the first 2 intervals by 4 semitones. -
If the iterator is negative, the size of the scale is added to it to make it work in reverse.
-
-
<,>,<<,>>are inversion operators.-
Similar to the double operators, a number before them specifies the iterator, and a number after them specifies the amount.
-
<and>will invert the scale without moving the root note (or whichever note is at its starting point).- Ex:
[> (sent to a major scale would change it to Dorian mode, while[>2 (would change it to Phrygian mode.
- Ex:
-
-
An ampersand followed by a number is a reference to the note at that index.
- Example:
[#1 &2 &1 (would swap the 1st and 2nd intervals.
- Example:
A random number generator that seeds with the current time so that the seed is always different even after restarting pd.
For 1 arg:
- float - Max
For 2 or no args:
-
float - Min
-
float - Max
- More accurately, these are start and stop values. This means that the difference between
maxandminwill always equal the correct range.-
We can also allow non-whole numbers to make fringe values less likely to occur.
-
Example:
[rand 2.8 5.2]will mostly output 3's and 4's, but there will also be the occasional 2's and 5's.
-
For 3 or more args (or a symbol):
-
numeric list
- The random number's range will be the size of the list and the result will be used as an index to output one of the list's items.
- You can also make a small list using a
f-s-fpattern of args. Example:[rand 2 or 5]will output either 2 or 5 .
-
symbol - The name of an existing garray.
- bang - Trigger a new random number
- The inlets that follow will reflect the creation args.
- float - Random number
-
[seed $1 (- Set the state with a new seed.- If no args are given, the state will be determined by the current time.
-
[state $1 (- Print the current state.- A label is optional to help determine where it came from.
-
[nop $1 (- Turn on/off No-Repeat mode.-
Prevents repeat values by decreasing the range by 1 and starting from the previous value, plus 1.
-
nop's value is also interpreted as the maximum number of times a number can occur in a row.
-
-
[mode $1 (- Force list mode or range mode.-
Range mode - The first two numbers are treated like min/max values and range is determined by their difference.
-
List mode - The range is derived from the size of the list and the result will be used as an index to output one of the list's items.
-
-
[size $1 (- Set the size of the float list.- When the requested size is bigger than the array's allocated size, the array will be resized and the inlets' float slots will be re-associated with the new addresses.
- Arrays have a resizing cap of 1024 floats.
- When the requested size is bigger than the array's allocated size, the array will be resized and the inlets' float slots will be re-associated with the new addresses.
A high-precision random number generator. Allows for a max value, or min and max values to be specified.
For 1 arg:
- float - Max
For 2 or no args:
-
float - Min
-
float - Max
- bang - Trigger a new random number
- The inlets that follow will reflect the creation args.
- float - Random number
-
[seed $1 (- Set the state with a new seed.- If no args are given, the state will be determined by the current time.
-
[state $1 (- Print the current state.- A label is optional to help determine where it came from.
float-encode & float-decode ([fldec])
[flenc] - Joins the mantissa, exponent, and sign to create a new float.
[fldec] - Splits a float into its sign, exponent, and mantissa.
-
float - Mantissa
-
float - Exponent
-
float - Sign
- float - The float to be split
The oulets of these externals are the same as the inlets of the other.
-
[m $1 (- Set the mantissa. -
[e $1 (- Set the exponent. -
[s $1 (- Set the sign. -
[f $1 (- Set the float. -
[u $1 (- Set an unsigned int whose bits are unified with that of the float's.
A gui number box that uses a custom number base between 2 and 64.
-
float - Base
-
float - Precision level
- Max value is
ceil(mant_digits / log2(base))withmant_digitsbeing mantissa bits + 1 for the implied extra digit. - Zero sets to the default precision for the given base. Default is not the same as max.
- Max value is
-
float - Lower limit
- Can effectively be set to null with a symbol, which will skip the limit check.
-
float - Upper limit
- Can effectively be set to null with a symbol, which will skip the limit check.
-
float - Pixels per step (X axis)
- Higher value lowers sensitivity of dragging. Zero disables the axis.
-
float - Pixels per step (Y axis)
- Higher value lowers sensitivity of dragging. Zero disables the axis.
-
float - Character width
- Default: zero.
-
float - Font size
- Default: auto
-
symbol - Receive symbol
-
symbol - Send symbol
-
symbol - Label
-
float - Label position
- float
- float
- Works exactly the same as any number box. The main difference is how the number is displayed
-
[base $1 [$2] (- Set the base, and optionally the precision. -
[prec $1 (- Set the precision level. -
[set $1 (- Set the value without outputting it. -
[read $1 (- Parse a float written in the current base. -
[b$1 $2 (- Parse a float written in the specified base. -
[param $.. (- Set all parameters.- Intended more for the dialog's response.
And [slx]
Slope objects.
These can be thought of as sliders without the gui interface. They use the line equation in slope-intercept form with either a linear or logarithmic method.
[sly] - Solves for y (y = m * x + b).
[slx] - Solves for x (x = (y - b) / m).
Only, for these objects, we use a slightly altered equation with min and max values:
m = (max - min) / run
y = m * x + min
x = (y - min) / m
-
float - Min
-
float - Max
-
float - Run
- float
[sly]receives x[slx]receives y
- The inlets that follow are the same as the creation args.
- float
[sly]outputs the solution for y[slx]outputs the solution for x
-
[min $1 (- Set the min. -
[max $1 (- Set the max. -
[run $1 (- Set the run.
Checks an atom's type or message.
- symbol - The type or message to check for.
b,f,s,l, andpcan be used as shorthand forbang,float,symbol,list, andpointerrespectively.
-
atom - The atom whose type will be checked
-
atom - The type to check for
- Will accept either a message or an atom of the type.
- float - 1 for true or 0 for false
[set $1 (- Set the type to check for.
Checks if a list contains a specific atom value.
- atom - The atom to check for
-
list - The list whose contents will be checked
-
atom - The atom to check for
- float - 1 for true or 0 for false
[set $1 (- Set the atom to check for.
And [unpaq]
Similar to pd's [pack] and [unpack] objects but with special 'lazy' inlets/outlets that allow anything to pass through them.
-
As with pack/unpack, creation args will determine how many inlets or outlets there are.
-
f,s, orpwill create strict type-checking inlets/outlets of float, symbol, or pointer types respectively. -
aor a number creates a lazy type. -
bturns into a lazybang. -
Unrecognized symbols become lazy types with the symbol as the initial value.
-
[. $1 (- Skip an inlet.-
Multiple dots (with spaces between them) will skip multiple inlets.
-
This works for any inlet. The inlet it gets sent to will act as an offset for the inlets that follow.
-
-
[mute $1 (- Set the error-muting bit-mask.- A bit mask of 0 will unmute all inlets/outlets, while a bit mask of -1 will mute all of them.
And [tabosc2~]
Table reader/oscillator that uses linear interpolation
Much like [tabread4~] and [tabosc4~], these objects work best with tables whose size is a power of 2, plus three. Linear interpolation really only requires 1 additional point, such that the first and last points are the same value, but for the sake of compatibility, the wave starts at index 1, while index 0 is just ignored. Pd's 4-point interpolation has 1 look-behind point and expects the beginning of the wave to be at index 1. Messages like sinesum and cosinesum generate arrays with this in mind.
-
symbol - Table name
-
float - Threshold
-
The percentage of each point that should remain as the original value.
-
If the threshold is 0.9, that means that only the last 10% of the point will be dedicated to interpolation.
-
-
signal - Frequency
-
signal - Threshold
-
float
[tabread2~]- Onset- You can use this to improve the accuracy of indexing into the array.
[tabosc2~]- Phase Index
- signal - Interpolated table
[set $1 (- Set the table name.
[ tabosc2~ ] :
[ft1 $1 (- Set the phase index.
A timer object with pause and lap functions.
-
float - Tempo unit
-
symbol - Tempo unit name
- These args can be written in any order.
-
bang - Resets the timer
float - Resets the timer with an initial delay
-
bang - Output elapsed time
-
float - Elapsed time
-
list - Lap info
-
float - Pause state
- 0 for paused, 1 for unpaused
-
[pause (- Pause/resume the timer. -
[pause $1 (- Pause/resume the timer.- Acts as a toggle when no args are given.
- When an arg is given, state is forced to playing(0) or paused(1).
-
[lap (- Send the lap time and total time as a list through the 2nd outlet. -
[delay $1 (- Add delay.- If more delay is added than time has elapsed since the last reset, the timer will begin counting down to zero.
A delay object with a pause function.
-
float - Delay time
-
float - Tempo unit
-
symbol - Tempo unit name
- The last two args can be written in any order.
-
bang - Resets delay
float - Sets the delay and starts
-
float - Sets the delay but doesn't start
-
bang - Sent after delay period has ended
-
float - Remaining time
-
float - Pause state
- 0 for paused, 1 for unpaused
-
[pause $1 (- Pause/resume the timer.- Acts as a toggle when no args are given.
- When an arg is given, state is forced to playing(0) or paused(1).
-
[time (- Output remaining time. -
[delay $1 (- Add delay.- If the delay has already ended, this will not re-activate it.
And [linp~]
[line] and [line~] objects with a pause function.
-
float - Initial value
-
float - Time grain in milliseconds
- Exactly the same as
[line]and[line~]
-
The ramp value
-
float - Pause state
- 0 for paused, 1 for unpaused
[pause $1 (- Pause/resume the timer.- Acts as a toggle when no args are given.
- When an arg is given, state is forced to playing(0) or paused(1).
Similar to [change] in that it sends different values through the left outlet, but also sends repeat values through the right outlet.
- float - Starting value.
-
bang - Output current value.
-
float - Incoming value.
-
float - New values.
-
float - Old values.
[set $1 (- Set but don't output.
Reverse [moses]. Outputs numbers to the left if they're greater than control value.
- float - Control value.
-
float - Incoming values.
-
float - Changes the control value.
-
float - Values greater than control value.
-
float - Values less than or equal to control value.