summaryrefslogtreecommitdiff
path: root/CIS/post-process
blob: 459a98a4fefd34dff46c1d9cac2d4b46c11fb72c (plain)
1
2
3
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
#!/bin/sh

sed '
  s@\s\+\\\(barNumberCheck\|numericTimeSignature\|stemDown\|stemUp\)\b@@g;
  s@\bb\([0-9]*\)\b@h\1@g;
  s@\bbes\([0-9]*\)\b@b\1@g;
  s@\[@@g;
  s@]@@g;
  s@\s*[#%]\s*[0-9]\+\s*$@@g;
  s@\s\+~@~@g;
  s@\\bar@| \0@g;
  s@\(\S\)\s\+@\1 @g;
' -i "$1"

sed '
  /|/! {
    :a
    N
    /|/ {
      s@\n@ @g
      b
    }
    /}/! ba
  }
' -i "$1"

sed '
  s@\(\S\)\s\+@\1 @g;
  s@\s$@@
' -i "$1"

rm "$1~"