ELVIS-Project / vis-framework

Thoroughly modern symbolic musical data analysis suite.
http://elvisproject.ca/
31 stars 6 forks source link

Allow Multiple Analyzers at Once in get_data() #336

Open crantila opened 9 years ago

crantila commented 9 years ago

Currently, if an analyzer requires input from more than one previous analyzer, the workflow requires multiple calls to get_data(). For example, interval n-grams go like this:

v_ints = indp.get_data([NoteRestIndexer, IntervalIndexer])
h_ints = indp.get_data([NoteRestIndexer, HorizontalIntervalIndexer])
ints = pandas.concat(v_ints, h_ints)
ngrams = indp.get_data([NGramIndexer], settings, ints)

Considering how common this type of workflow is, this is really more complicated than it should be. Worse, it really isn't obvious why this is the case. IndexedPiece objects should be able to do this multiplexing by themselves, as in this example:

ngrams = indp.get_data([NoteRestIndexer, [IntervalIndexer, HorizontalIntervalIndexer], NGramIndexer)

Wow. It's so much simpler! Please develop this on a feature branch, since I'm hoping to keep master stable in preparation for the formal release of VIS 2.0.