musicflower.loader.load_corpus

musicflower.loader.load_corpus(data, n, parallel=False, sort_func=<function <lambda>>, **kwargs)[source]

This is essentially a wrapper for parallelisation around the load_file() function, which computes pitch scapes for a set of files.

Parameters
  • data (Iterable) – an iterable of file paths or tuples with audio data (see get_chroma())

  • n (int) – resolution of pitch scape, i.e., the number of equally-sized time intervals to split the piece into

  • parallel (bool) – parallelise loading

  • sort_func (callable) – function that takes a file path and returns a key for sorting the result

  • kwargs – kwargs passed to the load_file() function (Note: this has to include

Return type

np.ndarray

Returns

array of shape (k, l, 12) where k is the number of files and l=n(n+1)/2 is the number of points in a pitch scape of resolution n.