rangement.
[minwii.git] / src / minwii / config.py
1 # -*- coding: utf-8 -*-
2 """
3 constantes de configuration
4
5 $Id$
6 $URL$
7 """
8
9 import pygame
10 import os.path
11
12 _here = os.path.abspath(__file__).split(os.path.sep)[:-1]
13 def _computePath(path) :
14 path = path.split('/')
15 path = _here + path
16 path = os.path.abspath(os.path.sep.join(path))
17 return path
18
19
20 pygame.font.init()
21
22
23 # playingscreen
24 FRAMERATE = 100
25 FIRST_HUE = 0.6
26 OFF_LUMINANCE = 0.2
27 OFF_SATURATION = 1
28 ON_TOP_LUMINANCE = 0.6
29 ON_BOTTOM_LUMINANCE = 0.9
30 ON_SATURATION = 1
31 ON_COLUMN_OVERSIZING = 2
32 ON_COLUMN_ALPHA = 1
33 font_file = _computePath('fonts/Arial Unicode.ttf')
34 NOTES_FONT = pygame.font.Font(font_file, 50)
35 LYRICS_FONT = pygame.font.Font(None, 80)
36 FONT_COLOR = (0,0,0)
37 MIDI_VELOCITY_RANGE = (64, 127)
38 MIDI_PAN_RANGE = (32, 96)
39 MIDI_VELOCITY_WRONG_NOTE_ATTN = 0.5
40
41 SONG_FILE_PATH = _computePath('../../chansons')
42
43 INSTRUMENTS = (
44 {'name' : 'accordeon',
45 'bank' : 0,
46 'preset' : 23
47 },
48 {'name' : 'celesta',
49 'bank' : 0,
50 'preset' : 8,
51 'octave' : 1
52 },
53 {'name' : 'flute',
54 'bank' : 0,
55 'preset' : 73
56 },
57 {'name' : 'guitare',
58 'bank' : 0,
59 'preset' : 24,
60 'octave' : -1
61 },
62 {'name' : 'orgue',
63 'bank' : 0,
64 'preset' : 19
65 },
66 {'name' : 'piano',
67 'bank' : 0,
68 'preset' : 0
69 },
70 {'name' : 'tuba',
71 'bank' : 0,
72 'preset' : 58,
73 'octave' : -2
74 },
75 {'name' : 'violon',
76 'bank' : 0,
77 'preset' : 40
78 },
79 {'name' : 'violoncelle',
80 'bank' : 0,
81 'preset' : 42,
82 'octave' : -2
83 },
84 )
85
86 for i in INSTRUMENTS :
87 i['octave'] = i.get('octave', 0)