MIRLCRep2:
Filter:
Classes (extension) | Music Information Retrieval

MIRLCRep2 : Object
ExtensionExtension

(put short description here)
Source: MIRLC2.sc
Subclasses: MIRLCa

Description

MIRLC2 is an incremental improvement over MIRLC. For the moment it includes the MIRLCRep2 module, which is designed for repurposing audio samples from Freesound.org using and expanding the Freesound quark for SuperCollider. It provides improved methods for querying and some automatic methods. It can also apply effects to the downloaded sounds.

Class Methods

MIRLCRep2.new(backend: 0, dbSize: 478456, path, creditsPath)

Creates a new instance.

Arguments:

backend

An Integer indicating the database used, default 0 to use the Freesound database.

dbSize

An Integer indicating the size of the database in terms of the total number of sounds of the Freesound database.

path

A String containing the path name where the sounds are downloaded (write mode).

creditsPath

A String containing the path name where the sound credits list is stored (write mode).

Inherited class methods

Undocumented class methods

MIRLCRep2.date

MIRLCRep2.date = value

MIRLCRep2.debugging

MIRLCRep2.debugging = value

MIRLCRep2.file

MIRLCRep2.file = value

MIRLCRep2.server

MIRLCRep2.server = value

Instance Methods

Querying & Retrieving methods

.id(id: 31362, size: 1)

Returns a sound by its Freesound ID number.

Arguments:

id

An Integer indicating the Freesound ID number of a sound.

size

An Integer that indicates the number of sounds to be retrieved. This is only used for internal purposes as only one sound is expected to be returned from a Freesound ID.

Returns:

A FSSound sound

.random(size: 1)

Returns a sound by random.

Arguments:

size

An Integer that indicates the number of sounds to be retrieved.

Returns:

A FSSound sound

.tag(tag: "noise", size: 1)

Returns a sound by a defined tag.

Arguments:

tag

A String that indicates the tag.

size

An Integer that indicates the number of sounds to be retrieved.

Returns:

A FSSound sound

.similar(targetnumsnd: 0, size: 1)

Returns a similar sound from a target sound.

Arguments:

targetnumsnd

An Integer indicating the index number of the sound in the group.

size

An Integer that indicates the number of sounds to be retrieved.

Returns:

A FSSound sound

.content(size: 1, feature: 'dur', fvalue: 1, fx: 'conf', fxvalue: 'bypass')

Returns a sound by content search that is defined by a target sound (feature) and filter.

Arguments:

size

An Integer that indicates the number of sounds to be retrieved.

feature

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the feature value (fvalue) and defines the characteristics of a target sound. Only a few options are available in the internal dictionary. Check the Freesound API for the full list of options:

"dur"
Default value. Returns ".sfx.duration:" from the Freesound API.
"pitch"
Returns ".lowlevel.pitch.mean:" from the Freesound API.
"dissonance"
Returns ".lowlevel.dissonance.mean:" from the Freesound API.
"bpm"
Returns ".rhythm.bpm:" from the Freesound API.
fvalue

An Integer or Float that indicates the value of the argument feature. Default value is 1 that pairs with the default value of feature, which is dur. Check the Freesound API for the full list of values.

fx

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter value (fxvalue) and defines the characteristics of a filter when retrieving the target sound. Only a few options are available in the internal dictionary. Check the Freesound API for the full list of options:

"key"
Default value. Returns "tonal.key_key:" from the Freesound API.
"scale"
Returns "tonal.key_scale:" from the Freesound API.
"conf"
Returns ".lowlevel.pitch_instantaneous_confidence.mean:" from the Freesound API.
"mfcc0"
Returns "lowlevel.mfcc.mean[0]:" from the Freesound API.
"mfcc1"
Returns "lowlevel.mfcc.mean[1]:" from the Freesound API.
"mfcc4"
Returns "lowlevel.mfcc.mean[4]:" from the Freesound API.
fxvalue

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter (fx) and indicates the range of the filter. Only a few options are available in the internal dictionary and are relevant to certain filters. Check the Freesound API for the full list of values:

"Asharp"
Default value. Returns "\"ASharp\"" from the Freesound API.
"A"
Returns "\"A\"" from the Freesound API.
"B"
Returns "\"B\"" from the Freesound API.
"C"
Returns "\"C\"" from the Freesound API.
"D"
Returns "\"D\"" from the Freesound API.
"E"
Returns "\"E\"" from the Freesound API.
"F"
Returns "\"F\"" from the Freesound API.
"G"
Returns "\"G\"" from the Freesound API.
"major"
Returns "\"major\"" from the Freesound API.
"minor"
Returns "\"minor\"" from the Freesound API.
"hi"
Returns "[0.8 TO 1]" from the Freesound API.
"lo"
Returns "[0 TO 0.2]" from the Freesound API.
"bypass"
Returns "[0 TO 1]" from the Freesound API.
"1720"
Returns "[17 TO 20]" from the Freesound API.
"2040"
Returns "[20 TO 40]" from the Freesound API.
"neg"
Returns "[-1124 TO -1121]" from the Freesound API.

Returns:

A FSSound sound

.diss(size: 1, fvalue: 1.0, fx: 'conf', fxvalue: 'lo')

Returns a sound based on the dissonance feature.

Arguments:

size

An Integer that indicates the number of sounds to be retrieved.

fvalue

An Integer or Float that is paired with the dissonance feature and indicates the value of the feature "dissonance". Default value is 1.0. Check the Freesound API for the full list of values.

fx

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter value (fxvalue) and defines the characteristics of a filter when retrieving the target sound. Default value is 'conf'. Only a few options are available in the internal dictionary. See the content method for details. Check the Freesound API for the full list of options.

fxvalue

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter (fx) and indicates the range of the filter. Default value is 'lo'. Only a few options are available in the internal dictionary and are relevant to certain filters. See the content method for details. Check the Freesound API for the full list of values.

Returns:

A FSSound sound

.dur(size: 1, fvalue: 10, fx: 'conf', fxvalue: 'lo')

Returns a sound based on the duration feature.

Arguments:

size

An Integer that indicates the number of sounds to be retrieved.

fvalue

An Integer or Float that is paired with the duration feature and indicates the value of the feature "dur". Default value is 10 seconds. Check the Freesound API for the full list of values.

fx

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter value (fxvalue) and defines the characteristics of a filter when retrieving the target sound. Default value is 'conf'. Only a few options are available in the internal dictionary. See the content method for details. Check the Freesound API for the full list of options.

fxvalue

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter (fx) and indicates the range of the filter. Default value is 'lo'. Only a few options are available in the internal dictionary and are relevant to certain filters. See the content method for details. Check the Freesound API for the full list of values.

Returns:

A FSSound sound

.bpm(size: 1, fvalue: 60, fx: 'conf', fxvalue: 'lo')

Returns a sound based on the BPM feature.

Arguments:

size

An Integer that indicates the number of sounds to be retrieved.

fvalue

An Integer or Float that is paired with the BPM feature and indicates the value of the feature "bpm". Default value is 60. Check the Freesound API for the full list of values.

fx

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter value (fxvalue) and defines the characteristics of a filter when retrieving the target sound. Default value is 'conf'. Only a few options are available in the internal dictionary. See the content method for details. Check the Freesound API for the full list of options.

fxvalue

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter (fx) and indicates the range of the filter. Default value is 'lo'. Only a few options are available in the internal dictionary and are relevant to certain filters. See the content method for details. Check the Freesound API for the full list of values.

Returns:

A FSSound sound

.pitch(size: 1, fvalue: 440, fx: 'conf', fxvalue: 'lo')

Returns a sound based on the pitch feature.

Arguments:

size

An Integer that indicates the number of sounds to be retrieved.

fvalue

An Integer or Float that is paired with the pitch feature and indicates the value of the feature "pitch". Default value is 440 Hz. Check the Freesound API for the full list of values.

fx

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter value (fxvalue) and defines the characteristics of a filter when retrieving the target sound. Default value is 'conf'. Only a few options are available in the internal dictionary. See the content method for details. Check the Freesound API for the full list of options.

fxvalue

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter (fx) and indicates the range of the filter. Default value is 'lo'. Only a few options are available in the internal dictionary and are relevant to certain filters. See the content method for details. Check the Freesound API for the full list of values.

Returns:

A FSSound sound

.filter(targetnumsnd: 0, size: 1, fx: 'conf', fxvalue: 'bypass')

Returns a similar sound from a target sound filtered by a filter.

Arguments:

targetnumsnd

An Integer indicating the index number of the target sound in the group of sounds.

size

An Integer that indicates the number of sounds to be retrieved.

fx

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter value (fxvalue) and defines the characteristics of a filter when retrieving the target sound. Default value is 'conf'. Only a few options are available in the internal dictionary. See the content method for details. Check the Freesound API for the full list of options.

fxvalue

A Symbol in an internal dictionary or a String from the Freesound API, which pairs with the filter (fx) and indicates the range of the filter. Default value is 'bypass'. Only a few options are available in the internal dictionary and are relevant to certain filters. See the content method for details. Check the Freesound API for the full list of values.

Returns:

A FSSound sound

Play methods

.play(rate: 1)

Plays the sounds of the same group at the same rate

Arguments:

rate

An Integer indicating the rate

.solo(targetnumsnd: 0)

Mutes all the sounds except for the selected sound from a given group.

Arguments:

targetnumsnd

An Integer indicating the index number of the sound in the group.

.mute(targetnumsnd: 0)

Mutes a selected sound from a given group.

Arguments:

targetnumsnd

An Integer indicating the index number of the sound in the group.

.muteall

Mutes all the sounds from a given group.

.stop

Stops the sound of the group of sounds (sets the amplitude to zero).

.sequence

Plays sounds sequentially, one after the other.

.parallel

Plays sounds in parallel, all of them looping at the same time.

.volume(vol: 0.2)

Sets the volume of the group of sounds within a range 0..1.

Arguments:

vol

A Float indicating the volume value.

.fadeout(release: 1.0)

Fades out all synths of a group of sounds with a smooth fade out.

Arguments:

release

Release time in seconds.

Automatic play methods

.cmdPeriod

Activated when stopping the code, stops all sounds.

.playauto(times: 4, tempo: 30)

Plays the sounds of the same group several times at different rates that are changed on every certain interval.

Arguments:

times

An Integer that indicates the number of times that the rate will be changed.

tempo

An Integer that indicates duration of the interval.

.playautodown(startspeed: 1, endspeed: 0, times: 5, tempo: 10)

Plays the sounds of the same group several times at different rates that increasingly slow down that are changed on every certain interval.

Arguments:

startspeed

An Integer that indicates the start rate of the sound.

endspeed

An Integer that indicates the end rate of the sound.

times

An Integer that indicates the number of times that the rate will be changed.

tempo

An Integer that indicates duration of the interval.

.autochopped(times: 4, tempo: 1)

Plays the sounds of the same group several times at randomly assigned rates during a certain interval.

Arguments:

times

An Integer that indicates the number of times that the rate will be changed.

tempo

An Integer that indicates duration of the interval.

.similarauto(targetnumsnd: 0, size: 3, tempo: 30)

Returns a set of similar sounds from a target sound scheduled to be downloaded on every certain interval.

Arguments:

targetnumsnd

An Integer indicating the index number of the sound in the group.

size

An Integer that indicates the number of sounds to be retrieved.

tempo

An Integer indicating the interval in seconds.

.sameidauto(id: 0, size: 3, tempo: 30)

Plays the same sound a number of times on every certain interval.

Arguments:

id

An Integer indicating the Freesound ID number of a sound.

size

An Integer that indicates the number of times to retrieve the same sound.

tempo

An Integer indicating the interval in seconds.

Sound effects methods

.bypass

Bypasses the effects.

.lowpf

Applies a lowpass filter.

.highpf

Applies a highpass filter.

.bandpf(freq: 440)

applies a bandpass filter.

Arguments:

freq

Centre frequency in Hertz. WARNING: due to the nature of its implementation frequency values close to 0 may cause glitches and/or extremely loud audio artifacts.

.reverb

Applies a reverb.

.vibrato(maxdelaytime: 0.01)

Applies a phaser.

Arguments:

maxdelaytime

The maximum delay time in seconds. Used to initialize the delay buffer size.

.delay

Applies a delay.

.bitcrush

Applies a bitcrush filter.

.distort(ampfx: 0.1)

Applies a distortion.

Arguments:

ampfx

Controls the point at which the output signal becomes linear.

.compress(threshold: 0.5)

Applies a compressor.

Arguments:

threshold

Control signal amplitude threshold, which determines the break point between slopeBelow and slopeAbove. Usually 0..1. The control signal amplitude is calculated using RMS.

Info methods

.credits

Prints the list of sounds used in a session including information about the title of the sound, author and the license.

.whatdur(feature: "sfx.duration")

Returns the duration of a sound.

Arguments:

feature

A String that describes the duration of a sound in the Freesound API.

Returns:

A Float indicating the duration of the sound.

.whatkey(feature: "tonal.key_key")

Returns the key of a sound.

Arguments:

feature

A String that describes the key of a sound in the Freesound API.

Returns:

A String indicating the key of the sound.

.whatpitch(feature: "lowlevel.pitch.mean")

Returns the pitch of a sound.

Arguments:

feature

A String that describes the pitch of a sound in the Freesound API.

Returns:

A String indicating the pitch of the sound.

.whatid(feature: "id")

Returns the ID of a sound.

Arguments:

feature

A String that describes the ID of a sound in the Freesound API.

Returns:

A String indicating the ID of the sound.

.whatbpm(feature: "rhythm.bpm")

Returns the BPM of a sound.

Arguments:

feature

A String that describes the BPM of a sound in the Freesound API.

Returns:

A String indicating the BPM of the sound.

.whatvol

Returns the volume.

.info

(describe method here)

Returns:

(describe returnvalue here)

.analyze(descriptors, action)

Retrieves all content-based descriptors listed in the Analysis Descriptor Documentation from the FreeSound API: "https://www.freesound.org/docs/api/analysis_docs.html#analysis-docs". The result can be filtered using the descriptors request parameter passing a list of comma separated descriptor names chosen from the available descriptors e.g. 'descriptors=lowlevel.mfcc,rhythm.bpm'

Arguments:

descriptors
action

Returns:

A String indicating information about the descriptors of the sound

.printsynths

Prints the synths information and associated FS metadata information for all the active sounds.

.printsynth(index)

Prints the synth information and associated FS metadata information of the current active sound.

Arguments:

index

An Integer indicating the index of the targeted sound.

.printbuffers

Prints the buffers information and associated FS metadata information for all downloaded sounds.

.printmetadata

Prints the FS metadata information for all downloaded sounds.

.printall

Prints the 3 arrays stored during a session of metada, buffers and synths.

.plotserver

Plots the server.

.scope

Plots an oscilloscope.

Inherited instance methods

Undocumented instance methods

.buffers

.translation

Examples

Setup and Instantiation

Quick Test