main
Batch-processing helpers built on top of ImportedPiece: exporting match
results to CSV, converting EMA addresses into note-level score excerpts, and
gathering ngram tables across pattern-matching results.
export_to_csv
export_to_csv(matches: list)
Exports matches data to a csv in the current working directory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matches
|
list
|
return value from either find_exact_matches or find_close_matches |
required |
Source code in crim_intervals/main.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
ema2ex
ema2ex(emaStr, df)
Return the excerpt from the df that is designated by the emaStr. The df must have a Measure and Beat multiIndex as the index labels. You can get this by passing a regular df of an ImportedPiece to ImportedPiece.detailIndex().
Source code in crim_intervals/main.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
gatherNgrams
gatherNgrams(df, ema_col='ema', piece_col='piece.piece_id', filename='')
Source code in crim_intervals/main.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |