diff options
| author | pepper <peppersclothescult@gmail.com> | 2015-01-19 00:02:46 -0800 |
|---|---|---|
| committer | pepper <peppersclothescult@gmail.com> | 2015-01-19 00:02:46 -0800 |
| commit | 760d4d5a0fc89e5b14681879577a80e79795e4a3 (patch) | |
| tree | 3698995f434a00a904f9fdff64a739eb21f53fdb /midicsv-1.1/exchannel.pl | |
Diffstat (limited to 'midicsv-1.1/exchannel.pl')
| -rw-r--r-- | midicsv-1.1/exchannel.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/midicsv-1.1/exchannel.pl b/midicsv-1.1/exchannel.pl new file mode 100644 index 0000000..b1fcde8 --- /dev/null +++ b/midicsv-1.1/exchannel.pl @@ -0,0 +1,18 @@ + + # Extract events for a channel from a MIDI CSV file. + # All non-channel events are output unchanged. + # Comments are discarded. + + $which_channel = 9; # Extract General MIDI percussion for demo + + while ($a = <>) { + if (!($a =~ m/\s*[\#\;]/)) { # Ignore comment lines + if ($a =~ m/\s*\d+\s*,\s*\d+\s*,\s*\w+_c\s*,\s*(\d+)/) { + if ($1 == $which_channel) { + print($a); + } + } else { + print($a); + } + } + } |
