d8bdd6c10c6ac458edbe5f4eaad1d70926052dd0
[minwii.git] / src / app / 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
40 SONG_FILE_PATH = _computePath('../../chansons')
41
42 INSTRUMENTS = (
43 {'name' : 'accordeon',
44 'bank' : 0,
45 'preset' : 23
46 },
47 {'name' : 'celesta',
48 'bank' : 0,
49 'preset' : 8,
50 'octave' : 1
51 },
52 {'name' : 'flute',
53 'bank' : 0,
54 'preset' : 73
55 },
56 {'name' : 'guitare',
57 'bank' : 0,
58 'preset' : 24,
59 'octave' : -1
60 },
61 {'name' : 'orgue',
62 'bank' : 0,
63 'preset' : 19
64 },
65 {'name' : 'piano',
66 'bank' : 0,
67 'preset' : 0
68 },
69 {'name' : 'tuba',
70 'bank' : 0,
71 'preset' : 58,
72 'octave' : -2
73 },
74 {'name' : 'violon',
75 'bank' : 0,
76 'preset' : 40
77 },
78 {'name' : 'violoncelle',
79 'bank' : 0,
80 'preset' : 42,
81 'octave' : -2
82 },
83 )
84
85 for i in INSTRUMENTS :
86 i['octave'] = i.get('octave', 0)