1# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
2#
3# Copyright (c) 2008 - 2014 by Wilbert Berendsen
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; either version 2
8# of the License, or (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18# See http://www.gnu.org/licenses/ for more information.
19
20"""
21Wood wind part types.
22"""
23
24
25from . import _base
26from . import register
27
28
29class WoodWindPart(_base.SingleVoicePart):
30    """Base class for wood wind part types."""
31
32
33class Flute(WoodWindPart):
34    @staticmethod
35    def title(_=_base.translate):
36        return _("Flute")
37
38    @staticmethod
39    def short(_=_base.translate):
40        return _("abbreviation for Flute", "Fl.")
41
42    midiInstrument = 'flute'
43
44
45class Piccolo(WoodWindPart):
46    @staticmethod
47    def title(_=_base.translate):
48        return _("Piccolo")
49
50    @staticmethod
51    def short(_=_base.translate):
52        return _("abbreviation for Piccolo", "Pic.")
53
54    midiInstrument = 'piccolo'
55    transposition = (1, 0, 0)
56
57
58class AltoFlute(WoodWindPart):
59    @staticmethod
60    def title(_=_base.translate):
61        return _("Alto Flute")
62
63    @staticmethod
64    def short(_=_base.translate):
65        return _("abbreviation Alto flute", "Afl.")
66
67    midiInstrument = 'flute'
68    transposition = (-1, 4, 0)
69
70
71class BassFlute(WoodWindPart):
72    @staticmethod
73    def title(_=_base.translate):
74        return _("Bass flute")
75
76    @staticmethod
77    def short(_=_base.translate):
78        return _("abbreviation for Bass flute", "Bfl.")
79
80    midiInstrument = 'flute'
81    transposition = (-1, 0, 0)
82
83
84class Oboe(WoodWindPart):
85    @staticmethod
86    def title(_=_base.translate):
87        return _("Oboe")
88
89    @staticmethod
90    def short(_=_base.translate):
91        return _("abbreviation for Oboe", "Ob.")
92
93    midiInstrument = 'oboe'
94
95
96class OboeDAmore(WoodWindPart):
97    @staticmethod
98    def title(_=_base.translate):
99        return _("Oboe d'amore")
100
101    @staticmethod
102    def short(_=_base.translate):
103        return _("abbreviation for Oboe d'amore", "Ob.d'am.")
104
105    midiInstrument = 'oboe'
106    transposition = (-1, 5, 0)
107
108
109class EnglishHorn(WoodWindPart):
110    @staticmethod
111    def title(_=_base.translate):
112        return _("English horn")
113
114    @staticmethod
115    def short(_=_base.translate):
116        return _("abbreviation for English horn", "Eng.h.")
117
118    midiInstrument = 'english horn'
119    transposition = (-1, 3, 0)
120
121
122class Bassoon(WoodWindPart):
123    @staticmethod
124    def title(_=_base.translate):
125        return _("Bassoon")
126
127    @staticmethod
128    def short(_=_base.translate):
129        return _("abbreviation for Bassoon", "Bn.")
130
131    midiInstrument = 'bassoon'
132    clef = 'bass'
133    octave = -1
134
135
136class ContraBassoon(WoodWindPart):
137    @staticmethod
138    def title(_=_base.translate):
139        return _("Contrabassoon")
140
141    @staticmethod
142    def short(_=_base.translate):
143        return _("abbreviation for Contrabassoon", "C.Bn.")
144
145    midiInstrument = 'bassoon'
146    transposition = (-1, 0, 0)
147    clef = 'bass'
148    octave = -1
149
150
151class Clarinet(WoodWindPart):
152    @staticmethod
153    def title(_=_base.translate):
154        return _("Clarinet")
155
156    @staticmethod
157    def short(_=_base.translate):
158        return _("abbreviation for Clarinet", "Cl.")
159
160    midiInstrument = 'clarinet'
161    transposition = (-1, 6, -1)
162
163
164class EflatClarinet(WoodWindPart):
165    @staticmethod
166    def title(_=_base.translate):
167        return _("E-flat clarinet ")
168
169    @staticmethod
170    def short(_=_base.translate):
171        return _("abbreviation for E-flat Clarinet", "Cl. in Eb")
172
173    midiInstrument = 'clarinet'
174    transposition = (0, 2, -1)
175
176
177class AClarinet(WoodWindPart):
178    @staticmethod
179    def title(_=_base.translate):
180        return _("A clarinet ")
181
182    @staticmethod
183    def short(_=_base.translate):
184        return _("abbreviation for A Clarinet", "Cl. in A")
185
186    midiInstrument = 'clarinet'
187    transposition = (-1, 5, 0)
188
189
190class BassClarinet(WoodWindPart):
191    @staticmethod
192    def title(_=_base.translate):
193        return _("Bass clarinet")
194
195    @staticmethod
196    def short(_=_base.translate):
197        return _("abbreviation for Bass clarinet", "BCl.")
198
199    midiInstrument = 'clarinet'
200    transposition = (-2, 6, -1)
201
202
203class C_MelodySax(WoodWindPart):
204    @staticmethod
205    def title(_=_base.translate):
206        return _("C-Melody Sax")
207
208    @staticmethod
209    def short(_=_base.translate):
210        return _("abbreviation for C-Melody Sax", "C-Mel Sax")
211
212    midiInstrument = 'soprano sax'
213
214
215class SopraninoSax(WoodWindPart):
216    @staticmethod
217    def title(_=_base.translate):
218        return _("Sopranino Sax")
219
220    @staticmethod
221    def short(_=_base.translate):
222        return _("abbreviation for Sopranino Sax", "SiSx.")
223
224    midiInstrument = 'soprano sax'
225    transposition = (0, 2, -1)    # es'
226
227
228class SopranoSax(WoodWindPart):
229    @staticmethod
230    def title(_=_base.translate):
231        return _("Soprano Sax")
232
233    @staticmethod
234    def short(_=_base.translate):
235        return _("abbreviation for Soprano Sax", "SoSx.")
236
237    midiInstrument = 'soprano sax'
238    transposition = (-1, 6, -1)   # bes
239
240
241class AltoSax(WoodWindPart):
242    @staticmethod
243    def title(_=_base.translate):
244        return _("Alto Sax")
245
246    @staticmethod
247    def short(_=_base.translate):
248        return _("abbreviation for Alto Sax", "ASx.")
249
250    midiInstrument = 'alto sax'
251    transposition = (-1, 2, -1)   # es
252
253
254class TenorSax(WoodWindPart):
255    @staticmethod
256    def title(_=_base.translate):
257        return _("Tenor Sax")
258
259    @staticmethod
260    def short(_=_base.translate):
261        return _("abbreviation for Tenor Sax", "TSx.")
262
263    midiInstrument = 'tenor sax'
264    transposition = (-2, 6, -1)   # bes,
265
266
267class BaritoneSax(WoodWindPart):
268    @staticmethod
269    def title(_=_base.translate):
270        return _("Baritone Sax")
271
272    @staticmethod
273    def short(_=_base.translate):
274        return _("abbreviation for Baritone Sax", "BSx.")
275
276    midiInstrument = 'baritone sax'
277    transposition = (-2, 2, -1)   # es,
278
279
280class BassSax(WoodWindPart):
281    @staticmethod
282    def title(_=_base.translate):
283        return _("Bass Sax")
284
285    @staticmethod
286    def short(_=_base.translate):
287        return _("abbreviation for Bass Sax", "BsSx.")
288
289    midiInstrument = 'baritone sax'
290    transposition = (-3, 6, -1)   # bes,,
291
292
293class SopraninoRecorder(WoodWindPart):
294    @staticmethod
295    def title(_=_base.translate):
296        return _("Sopranino recorder")
297
298    @staticmethod
299    def short(_=_base.translate):
300        return _("abbreviation for Sopranino recorder", "Si.rec.")
301
302    midiInstrument = 'recorder'
303    transposition = (1, 0, 0)
304
305class SopranoRecorder(WoodWindPart):
306    @staticmethod
307    def title(_=_base.translate):
308        return _("Soprano recorder")
309
310    @staticmethod
311    def short(_=_base.translate):
312        return _("abbreviation for Soprano recorder", "S.rec.")
313
314    midiInstrument = 'recorder'
315    transposition = (1, 0, 0)
316
317
318class AltoRecorder(WoodWindPart):
319    @staticmethod
320    def title(_=_base.translate):
321        return _("Alto recorder")
322
323    @staticmethod
324    def short(_=_base.translate):
325        return _("abbreviation for Alto recorder", "A.rec.")
326
327    midiInstrument = 'recorder'
328
329
330class TenorRecorder(WoodWindPart):
331    @staticmethod
332    def title(_=_base.translate):
333        return _("Tenor recorder")
334
335    @staticmethod
336    def short(_=_base.translate):
337        return _("abbreviation for Tenor recorder", "T.rec.")
338
339    midiInstrument = 'recorder'
340
341
342class BassRecorder(WoodWindPart):
343    @staticmethod
344    def title(_=_base.translate):
345        return _("Bass recorder")
346
347    @staticmethod
348    def short(_=_base.translate):
349        return _("abbreviation for Bass recorder", "B.rec.")
350
351    midiInstrument = 'recorder'
352    transposition = (1, 0, 0)
353    clef = 'bass'
354    octave = -1
355
356
357class ContraBassRecorder(WoodWindPart):
358    @staticmethod
359    def title(_=_base.translate):
360        return _("Contra Bass recorder")
361
362    @staticmethod
363    def short(_=_base.translate):
364        return _("abbreviation for Contra Bass recorder", "Cb.rec.")
365
366    midiInstrument = 'recorder'
367    clef = 'bass'
368    octave = -1
369
370
371class SubContraBassRecorder(WoodWindPart):
372    @staticmethod
373    def title(_=_base.translate):
374        return _("Subcontra Bass recorder")
375
376    @staticmethod
377    def short(_=_base.translate):
378        return _("abbreviation for Subcontra Bass recorder", "Scb.rec.")
379
380    midiInstrument = 'recorder'
381    clef = 'bass'
382    octave = -1
383
384
385
386register(
387    lambda: _("Woodwinds"),
388    [
389        Flute,
390        Piccolo,
391        AltoFlute,
392        BassFlute,
393        Oboe,
394        OboeDAmore,
395        EnglishHorn,
396        Bassoon,
397        ContraBassoon,
398        Clarinet,
399        EflatClarinet,
400        AClarinet,
401        BassClarinet,
402        SopraninoSax,
403        SopranoSax,
404        AltoSax,
405        TenorSax,
406        BaritoneSax,
407        BassSax,
408        C_MelodySax,
409        SopraninoRecorder,
410        SopranoRecorder,
411        AltoRecorder,
412        TenorRecorder,
413        BassRecorder,
414        ContraBassRecorder,
415        SubContraBassRecorder
416    ])
417