+
+instruments = ConfigParser()
+instruments.add_section('accordeon')
+instruments.set('accordeon', 'bank', '0')
+instruments.set('accordeon', 'preset', '23')
+instruments.set('accordeon', 'pos', '0')
+
+instruments.add_section('celesta')
+instruments.set('celesta', 'bank', '0')
+instruments.set('celesta', 'preset', '8')
+instruments.set('celesta', 'octave', '1')
+instruments.set('celesta', 'pos', '1')
+
+instruments.add_section('flute')
+instruments.set('flute', 'bank', '0')
+instruments.set('flute', 'preset', '73')
+instruments.set('flute', 'pos', '2')
+
+instruments.add_section('guitare')
+instruments.set('guitare', 'bank', '0')
+instruments.set('guitare', 'preset', '24')
+instruments.set('guitare', 'octave', '-1')
+instruments.set('guitare', 'pos', '3')
+
+instruments.add_section('orgue')
+instruments.set('orgue', 'bank', '0')
+instruments.set('orgue', 'preset', '19')
+instruments.set('orgue', 'pos', '4')
+
+instruments.add_section('piano')
+instruments.set('piano', 'bank', '0')
+instruments.set('piano', 'preset', '0')
+instruments.set('piano', 'pos', '5')
+
+instruments.add_section('tuba')
+instruments.set('tuba', 'bank', '0')
+instruments.set('tuba', 'preset', '58')
+instruments.set('tuba', 'octave', '-2')
+instruments.set('tuba', 'pos', '6')
+
+
+instruments.add_section('violon')
+instruments.set('violon', 'bank', '0')
+instruments.set('violon', 'preset', '40')
+instruments.set('violon', 'pos', '7')
+
+instruments.add_section('violoncelle')
+instruments.set('violoncelle', 'bank', '0')
+instruments.set('violoncelle', 'preset', '42')
+instruments.set('violoncelle', 'octave', '-2')
+instruments.set('violoncelle', 'pos', '8')
+
+# customisation
+instruments.read(_computePath('../instruments.ini'))
+
+
+INSTRUMENTS = []
+for section in instruments.sections() :
+ items = instruments.items(section)
+ instru = dict([(k, int(v)) for k, v in items])
+ instru['octave'] = instru.get('octave', 0)
+ instru['name'] = section
+ INSTRUMENTS.append(instru)
+
+INSTRUMENTS.sort(lambda a, b : cmp(a['pos'], b['pos']))
+map(lambda a : a.pop('pos'), INSTRUMENTS)
+
+#INSTRUMENTS = (
+# {'name' : 'violoncelle',
+# 'bank' : 0,
+# 'preset' : 42,
+# 'octave' : -2
+# },
+#)
+#
+#for i in INSTRUMENTS :
+# i['octave'] = i.get('octave', 0)
+
+
+if __name__ == '__main__' :
+ for f in (conf, instruments) :
+ for section in f.sections() :
+ print '=== ', section, ' ==='
+ for k, v in f.items(section) :
+ print k, v
+ print '*'*80
+
+ from pprint import pprint
+ pprint(INSTRUMENTS)
\ No newline at end of file