File: txt2ins.awk

package info (click to toggle)
vmpk 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,800 kB
  • sloc: cpp: 7,371; xml: 927; awk: 40; sh: 38; python: 37; makefile: 15
file content (48 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download | duplicates (6)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This AWK script creates an INS (instruments definition) file from 
# an instrument list like the file "vkeybd.list" provided with vkeybd, 
# or a similar one created from scratch or with the help of the 
# sftovkb utility.
#
# usage example:
#     awk -f txt2ins.awk vkeybd.list > translated.ins

BEGIN { 
  print ".Patch Names"
  b=""
}
{ 
  if (b!=$1) { 
     print "\n[Bank" $1 "]" 
     a[$1]=1 
     b=$1
  }
  print $2 "=" $3,$4,$5,$6
}
END { 
  print "\n.Controller Names"
  print "\n[Standard]"
  print "1=1-Modulation"
  print "2=2-Breath"
  print "4=4-Foot controller"
  print "5=5-Portamento time"
  print "7=7-Volume"
  print "8=8-Balance"
  print "10=10-Pan"
  print "11=11-Expression"
  print "64=64-Pedal (sustain)"
  print "65=65-Portamento"
  print "66=66-Pedal (sostenuto)"
  print "67=67-Pedal (soft)"
  print "69=69-Hold 2"
  print "91=91-External Effects depth"
  print "92=92-Tremolo depth"
  print "93=93-Chorus depth"
  print "94=94-Celeste (detune) depth"
  print "95=95-Phaser depth"
  print "\n.Instrument Definitions"
  print "\n[" FILENAME "]"
  print "Control=Standard"
  for (i in a) { 
    print "Patch[" i "]=Bank" i 
  } 
}