Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
basicsynth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Marie FAVREAU
basicsynth
Commits
6fd6dd3a
Commit
6fd6dd3a
authored
6 years ago
by
Jean-Marie FAVREAU
Browse files
Options
Downloads
Patches
Plain Diff
Ajout Happy Birthday (en cours)
parent
e4ae77eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
happybirthday.py
+72
-0
72 additions, 0 deletions
happybirthday.py
with
72 additions
and
0 deletions
happybirthday.py
0 → 100755
+
72
−
0
View file @
6fd6dd3a
#!/usr/bin/env python
# coding: utf8
# -*- coding: utf-8 -*-
import
argparse
from
musique.basicsynth
import
BasicSequenceur
from
musique.exercice
import
GenerateurExercice
from
musique.gamme
import
GammeTemperee
parser
=
argparse
.
ArgumentParser
(
description
=
'
Génère des documents à partir de la partition du thème joyeux anniversaire.
'
)
parser
.
add_argument
(
'
--exercice-spectrogramme
'
,
help
=
"
Génère un exercice plutôt que le fichier son
"
,
dest
=
'
exerciceSpectrogramme
'
,
nargs
=
1
)
parser
.
add_argument
(
'
--exercice-spectrogramme-transparent
'
,
help
=
"
Génère un exercice à projeter
"
,
dest
=
'
transparent
'
,
nargs
=
1
)
parser
.
add_argument
(
'
--exercice-spectrogramme-correction
'
,
help
=
"
Génère la correction pour l
'
enseignant
"
,
dest
=
'
correction
'
,
nargs
=
1
)
parser
.
add_argument
(
'
--boomwhackers
'
,
help
=
"
Fichier décrivant la configuration de boomwhackers disponible.
"
,
dest
=
'
boomwhackers
'
,
nargs
=
1
)
parser
.
add_argument
(
'
--primaire
'
,
help
=
"
Génère un exercice destiné aux primaires
"
,
dest
=
'
primaire
'
,
action
=
'
store_true
'
,
default
=
False
)
args
=
parser
.
parse_args
()
boomwhackers
=
""
if
not
args
.
boomwhackers
is
None
:
boomwhackers
=
args
.
boomwhackers
[
0
]
gamme
=
GammeTemperee
(
117
)
happy
=
[
[
[
gamme
.
do
(
4
),
gamme
.
crochepointee
],
[
gamme
.
do
(
4
),
gamme
.
doublecroche
],
[
gamme
.
re
(
4
),
gamme
.
noire
],
[
gamme
.
do
(
4
),
gamme
.
noire
],
[
gamme
.
fa
(
4
),
gamme
.
noire
],
[
gamme
.
mi
(
4
),
gamme
.
blanche
],
[
gamme
.
do
(
4
),
gamme
.
crochepointee
],
[
gamme
.
do
(
4
),
gamme
.
doublecroche
],
[
gamme
.
re
(
4
),
gamme
.
noire
],
[
gamme
.
do
(
4
),
gamme
.
noire
],
[
gamme
.
sol
(
4
),
gamme
.
noire
],
[
gamme
.
fa
(
4
),
gamme
.
blanche
],
[
gamme
.
do
(
4
),
gamme
.
crochepointee
],
[
gamme
.
do
(
4
),
gamme
.
doublecroche
],
[
gamme
.
do
(
5
),
gamme
.
noire
],
[
gamme
.
la
(
4
),
gamme
.
noire
],
[
gamme
.
fa
(
4
),
gamme
.
noire
],
[
gamme
.
mi
(
4
),
gamme
.
noire
],
[
gamme
.
re
(
4
),
gamme
.
noire
],
[
gamme
.
sib
(
4
),
gamme
.
crochepointee
],
[
gamme
.
sib
(
4
),
gamme
.
doublecroche
],
[
gamme
.
la
(
4
),
gamme
.
noire
],
[
gamme
.
fa
(
4
),
gamme
.
noire
],
[
gamme
.
sol
(
4
),
gamme
.
noire
],
[
gamme
.
fa
(
4
),
gamme
.
blanchepointee
]
]
]
if
args
.
exerciceSpectrogramme
:
g
=
GenerateurExercice
(
gamme
.
bpm
)
g
.
setBoomwhackers
(
boomwhackers
)
g
.
setLongueurPartitionColoree
(
6
)
g
.
setLongueurPartitionMusicale
(
8
)
if
args
.
primaire
:
g
.
setTableauSimplifie
(
True
)
if
args
.
exerciceSpectrogramme
:
g
.
genererExerciceSpectrogramme
(
happy
,
args
.
exerciceSpectrogramme
[
0
],
"
thème 5
"
)
if
args
.
transparent
:
g
.
genererTransparentSpectrogramme
(
happy
,
args
.
transparent
[
0
],
"
thème 5
"
,
"
joyeux anniversaire
"
)
if
args
.
correction
:
g
.
genererCorrectionSpectrogramme
(
happy
,
args
.
correction
[
0
],
"
thème 5
"
,
"
joyeux anniversaire
"
)
else
:
print
"
Génération du son
"
s
=
BasicSequenceur
(
1
,
gamme
.
bpm
,
8
)
s
.
genererMelodie
(
happy
,
"
sons/happybirthday.wav
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment