Humdrum Extras

extractx examples


This page gives example input and output data for the extractx program. The output data from these tests can be compared to output on your platform using the same input file in order to determine if there is a problem with the extractx program. If the output you generate is not the same as the output listed in the individual tests, then something may be wrong with the compiled program or your computing environment (or a bug added to the program after the example output was generated).


Test Index

    Test 001:Extract the second spine in a file.
    Test 002:Extract the first two spines in a file.
    Test 003:Extract the first two spines in a file using a spine range.
    Test 004:Extract the last two spines in a file.
    Test 005:Extract the last two spines in a file by range.
    Test 006:Extract the first two spines in data, but reverse their ordering in output.
    Test 007:Extract the first two spines in reverse using range.
    Test 008:Extract the first two spines in reverse using range.
    Test 009:Duplicate an extracted spine.
    Test 010:Extract the penultimate spine.
    Test 011:Extract the penultimate spine using alternate notation.
    Test 012:Extract the spine before the penultimate spine.
    Test 013:Exclude the second spine from being extracted.
    Test 014:Remove all except the last two spines.
    Test 015:Extract all **b spines.
    Test 016:Extract first and last spine in file.
    Test 017:Extract a spine which splits into subspines.
    Test 018:Extract a spine which splits into subspines, also duplicating it.
    Test 019:Extract a complex spine, duplicating it as well as adding a blank spine between the copies to preserve valid humdrum syntax.
    Test 020:Extract a spine which uses *x will remove the "x" in the output.
    Test 021:Extracting a pair of spines with mutual *x manipulators will preserver *x markers.
    Test 022:Extracting a pair of spines in reverse with mutual *x manipulators will preserver *x markers.
    Test 023:Multiple copies of spines with *x manipulators will only preserve them if all repetitons of spines are paired to the left.
    Test 024:Extract pair of *x spines and an extra copy of only one of the spines will cause the *x in the extra copy to be removed.
    Test 025:Extracting spines which don't have matching *x will remove unmatched *x's.
    Test 026:Reversing spines will always preserve *x manipulators.
    Test 027:Extract two spines with splits and joins.
    Test 028:Extract two spines with splits and joins which are not strictly allowed.
    Test 029:Extract a spine which does not start/stop at the same time as other spines.
    Test 030:Extracting two partial spines.
    Test 031:Extracting two partial spines, preserving their relative positions.
    Test 032:Reverse spines grouped by **kern data.
    Test 033:Reverse spines grouped by **kern data, with the first spine not a **kern spine.
    Test 034:Reverse spines grouped by **num spines.
    Test 035:Extract only the "a" portion of a spine.
    Test 036:Extract only the "b" portion of a spine.
    Test 037:Extract both the "a" and "b" sections into separate spines.
    Test 038:Extract both the "a" and "b" sections in reverse order.
    Test 039:Expand all spines which contain a *^ manipulator.
    Test 040:Extract a secondary sub-spine, duplicating primary spine data when no sub-spines.
    Test 041:Extract a secondary sub-spine, using null tokens when no sub-spines.
    Test 042:Extract a secondary sub-spine, using rests when no sub-spines.
    Test 043:Extract a non-existant secondary sub-spine using rests.
    Test 044:Extract a non-existant secondary sub-spine using rests without interpretation marking "yy".
    Test 045:Extract co-spine information along with a spine.
    Test 046:Extract co-spine information along with a spine.
    Test 047:Extract co-spine information along with a spine and its duplicate.
    Test 048:Extract co-spine information along with a spines in reverse order.
    Test 049:Extract co-spine information, ignoring rests in **kern data.
    Test 050:Extract co-spine information for the third spine of music.


Test 021: Extracting a pair of spines with mutual *x manipulators will preserver *x markers.

The command:

     extractx -s 1,2 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 022: Extracting a pair of spines in reverse with mutual *x manipulators will preserver *x markers.

The command:

     extractx -s 2,1 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 023: Multiple copies of spines with *x manipulators will only preserve them if all repetitons of spines are paired to the left.

The command:

     extractx -s 2,1,1,1,2 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 024: Extract pair of *x spines and an extra copy of only one of the spines will cause the *x in the extra copy to be removed.

The command:

     extractx -s 2,1,2 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 025: Extracting spines which don't have matching *x will remove unmatched *x's.

The command:

     extractx -s 1,2 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 026: Reversing spines will always preserve *x manipulators.

The command:

     extractx -s '$0-1' input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 027: Extract two spines with splits and joins.

The command:

     extractx -s 2,4 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 028: Extract two spines with splits and joins which are not strictly allowed.

The command:

     extractx -s 2,4 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 029: Extract a spine which does not start/stop at the same time as other spines.

The command:

     extractx -i '**c' input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 030: Extracting two partial spines.

The command:

     extractx -s 3,4 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 031: Extracting two partial spines, preserving their relative positions.

The command:

     extractx -s 0,3,4 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 032: Reverse spines grouped by **kern data.

The command:

     extractx -r input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 033: Reverse spines grouped by **kern data, with the first spine not a **kern spine.

The command:

     extractx -r input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 034: Reverse spines grouped by **num spines.

The command:

     extractx -R '**num' input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 035: Extract only the "a" portion of a spine.

The command:

     extractx -s 2a input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 036: Extract only the "b" portion of a spine.

The command:

     extractx -s 2b input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 037: Extract both the "a" and "b" sections into separate spines.

The command:

     extractx -s 1,2a,2b,3 input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 038: Extract both the "a" and "b" sections in reverse order.

The command:

     extractx -s 2b,2a input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 039: Expand all spines which contain a *^ manipulator.

The command:

     extractx -e input-file > output-file
using the following input, will generate the following output:

input-file:
output-file:
Test 040: Extract a secondary sub-spine, duplicating primary spine data when no sub-spines.

The command:

     extractx -s 2b input-file > output-file
using the following input, will generate the following output:

input-file:
output-file: