1c2b9bda7f152d102d46af4123776a7705e2a482
[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 BORDER = 0 # 5px
26 FIRST_HUE = 0.6
27 OFF_LUMINANCE = 0.2
28 OFF_SATURATION = 1
29 ON_TOP_LUMINANCE = 0.6
30 ON_BOTTOM_LUMINANCE = 0.9
31 ON_SATURATION = 1
32 ON_COLUMN_OVERSIZING = 2
33 ON_COLUMN_ALPHA = 1
34 font_file = _computePath('fonts/Arial Unicode.ttf')
35 NOTES_FONT = pygame.font.Font(font_file, 50)
36 LYRICS_FONT = pygame.font.Font(None, 80)
37 FONT_COLOR = (0,0,0)
38 DEFAULT_MIDI_VELOCITY = 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)