Skip to main content

nmfcross

nmfcross(
@target ## llll (required)
@continuity 7
@iterations 50
@timesparsity 7
@polyphony 10
@winsize 1024
@hopsize -1
@fftsize -1
@maxfftsize -1
@useseed 0
) -> llll

Generates an audio process operation for NMF-based cross-synthesis. The process works by attempting to reconstruct components of the target sound using the timbre (i.e., spectra) of the source sound, learned through a Non-negative Matrix Factorization. The result is a hybrid whose character depends on how well the target can be represented by the source's spectral frames.

In contrast to buf2nmf, each spectral frame of source is a spectral template. Be aware that NMF is O(N^2) in the number of templates, so longer source buffers will take dramatically longer to process.

See Driedger, J., Prätzlich, T., & Müller, M. (2015). Let it Bee-Towards NMF-Inspired Audio Mosaicing. ISMIR, 350-356. http://ismir2015.uma.es/articles/13_Paper.pdf


Arguments

  • @target [llll]: Target buffer. (required)
  • @continuity [int]: Promote the use of N successive source frames, giving greater continuity in the result. This can not be bigger than the size of the source buffer, but useful values tend to be much lower (in the tens). Spans to odd numbers. (default: 7).
  • @iterations [int]: Iterations of NMF to run. (default: 50).
  • @timesparsity [int]: Repetition of source templates in the reconstruction by specifying a number of frames within which a template should not be re-used. Units are spectral frames. (default: 7).
  • @polyphony [int]: Spectral density of the output sound by specifying the maximum number of simultaneous spectral templates from source that can be used. (default: 10).
  • @winsize [int]: Window size (default: 1024).
  • @hopsize [int]: Hop size. -1 is equivalent to @winsize / 2 (default: -1).
  • @fftsize [int]: FFT size. -1 is equivalent to @winsize snapped to the nearest equal or greater power of 2. (e.g. @winsize 1024 => @fftsize 1024 but @winsize 1000 also => @fftsize 1024) (default: -1).
  • @maxfftsize [int]: Max. FFT size. @maxfftsize -1 is equivalent to whatever the initial FFT size is. (default: -1).
  • @useseed [int]: Use random seed for parameter initialization. (default: 0).
    • 0: Off
    • 1: On

Output

NMF Cross operation [llll]


Usage

nmfcross is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = nmfcross(importaudio("drums.wav")); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after nmfcross process')