8d27e28429291655a95cd6658b325a9f11c6009f
[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 if _here[-2].endswith('.exe') or _here[-2].endswith('*.zip') :
14 _here.pop(-2)
15
16 def _computePath(path) :
17 path = path.split('/')
18 path = _here + path
19 path = os.path.abspath(os.path.sep.join(path))
20 return path
21
22
23 pygame.font.init()
24
25
26 # playingscreen
27 FRAMERATE = 100
28 FIRST_HUE = 0.6
29 OFF_LUMINANCE = 0.2
30 OFF_SATURATION = 1
31 ON_TOP_LUMINANCE = 0.6
32 ON_BOTTOM_LUMINANCE = 0.9
33 ON_SATURATION = 1
34 ON_COLUMN_OVERSIZING = 2
35 ON_COLUMN_ALPHA = 1
36 font_file = _computePath('fonts/Arial Unicode.ttf')
37 NOTES_FONT = pygame.font.Font(font_file, 50)
38 default_font_file = _computePath('fonts/freesansbold.ttf')
39 LYRICS_FONT = pygame.font.Font(default_font_file, 80)
40 FONT_COLOR = (0,0,0)
41 MIDI_VELOCITY_RANGE = (64, 127)
42 MIDI_PAN_RANGE = (32, 96)
43 MIDI_VELOCITY_WRONG_NOTE_ATTN = 0.5
44
45 SONG_FILE_PATH = _computePath('../../chansons')
46
47 INSTRUMENTS = (
48 {'name' : 'accordeon',
49 'bank' : 0,
50 'preset' : 23
51 },
52 {'name' : 'celesta',
53 'bank' : 0,
54 'preset' : 8,
55 'octave' : 1
56 },
57 {'name' : 'flute',
58 'bank' : 0,
59 'preset' : 73
60 },
61 {'name' : 'guitare',
62 'bank' : 0,
63 'preset' : 24,
64 'octave' : -1
65 },
66 {'name' : 'orgue',
67 'bank' : 0,
68 'preset' : 19
69 },
70 {'name' : 'piano',
71 'bank' : 0,
72 'preset' : 0
73 },
74 {'name' : 'tuba',
75 'bank' : 0,
76 'preset' : 58,
77 'octave' : -2
78 },
79 {'name' : 'violon',
80 'bank' : 0,
81 'preset' : 40
82 },
83 {'name' : 'violoncelle',
84 'bank' : 0,
85 'preset' : 42,
86 'octave' : -2
87 },
88 )
89
90 for i in INSTRUMENTS :
91 i['octave'] = i.get('octave', 0)