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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Marie FAVREAU
basicsynth
Commits
e3720758
Commit
e3720758
authored
6 years ago
by
Jean-Marie Favreau
Browse files
Options
Downloads
Patches
Plain Diff
Suite développement exercices (WIP)
parent
f8903326
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
boomwhackers-8.json
+10
-0
10 additions, 0 deletions
boomwhackers-8.json
happybirthday.py
+25
-24
25 additions, 24 deletions
happybirthday.py
musique/exercice.py
+8
-5
8 additions, 5 deletions
musique/exercice.py
musique/gamme.py
+1
-1
1 addition, 1 deletion
musique/gamme.py
with
44 additions
and
30 deletions
boomwhackers-8.json
0 → 100644
+
10
−
0
View file @
e3720758
{
"do1"
:
{
"couleur"
:
"#a73824"
,
"capsule"
:
"0"
},
"re1"
:
{
"couleur"
:
"#c56528"
,
"capsule"
:
"0"
},
"mi1"
:
{
"couleur"
:
"#f4e236"
,
"capsule"
:
"0"
},
"fa1"
:
{
"couleur"
:
"#f4e236"
,
"capsule"
:
"0"
},
"sol1"
:
{
"couleur"
:
"#27476d"
,
"capsule"
:
"0"
},
"la1"
:
{
"couleur"
:
"#413a88"
,
"capsule"
:
"0"
},
"si1"
:
{
"couleur"
:
"#682174"
,
"capsule"
:
"0"
},
"do2"
:
{
"couleur"
:
"#9c3922"
,
"capsule"
:
"0"
}
}
This diff is collapsed.
Click to expand it.
happybirthday.py
+
25
−
24
View file @
e3720758
...
...
@@ -42,6 +42,7 @@ happy = [ [ [gamme.do(4), gamme.crochepointee],
[
gamme
.
fa
(
4
),
gamme
.
blanchepointee
]
]
]
if
args
.
exerciceSpectrogramme
:
g
=
GenerateurExercice
(
gamme
.
bpm
)
g
.
genererExerciceSpectrogramme
(
happy
,
"
exercices/ex-spec-happybirthday.tex
"
,
"
thème joyeux anniversaire
"
)
...
...
This diff is collapsed.
Click to expand it.
musique/exercice.py
+
8
−
5
View file @
e3720758
...
...
@@ -13,7 +13,7 @@ class GenerateurExercice(GammeTemperee):
# Paramètres:
# * bpm: nombre de battements par minute (= nombre de noires par minute)
# * dureeFrappe: duree de la frappe
def
__init__
(
self
,
bpm
=
120
,
dureeFrappe
=
0.
04
):
def
__init__
(
self
,
bpm
=
120
,
dureeFrappe
=
0.
12
):
GammeTemperee
.
__init__
(
self
,
bpm
)
self
.
dureeFrappe
=
dureeFrappe
self
.
margeDocument
=
1.0
...
...
@@ -236,10 +236,10 @@ class GenerateurExercice(GammeTemperee):
def
estDessinable
(
self
,
partitions
):
if
len
(
partitions
)
!=
1
:
print
"
plus d
'
une partition
"
print
"
La partition contient plusieurs mains.
"
return
False
if
self
.
contientNoteAlteree
(
partitions
):
print
"
not
e alter
ee
"
print
"
La partition contient un
e alter
ée.
"
return
False
notes
=
[
self
.
getOctaveEtIDNote
(
p
)
for
p
in
self
.
notesDansPartition
(
partitions
)
]
...
...
@@ -309,6 +309,9 @@ class GenerateurExercice(GammeTemperee):
# dessine sur le spectrogramme l'accord donné en paramètre,
# à l'horodatage donné
def
noteSpectrogrammePartition
(
self
,
frequence
,
duree
,
horodatage
,
couleur
=
"
black
"
):
if
frequence
==
0
:
return
''
else
:
y
=
self
.
frequenceEnCm
(
frequence
)
return
self
.
noteGraphique
(
y
,
self
.
margeDureeDebut
,
duree
,
horodatage
,
couleur
)
...
...
This diff is collapsed.
Click to expand it.
musique/gamme.py
+
1
−
1
View file @
e3720758
...
...
@@ -144,7 +144,7 @@ class GammeTemperee:
# retourne la fréquence minimum utilisée dans les partitions
def
minFrequence
(
self
,
partitions
):
return
min
([
min
([
x
for
x
in
[
note
[
0
]
if
isinstance
(
note
[
0
],
float
)
else
min
(
note
[
0
])
for
note
in
partition
]
if
x
!=
0
.
])
for
partition
in
partitions
])
return
min
([
min
([
x
for
x
in
[
note
[
0
]
if
isinstance
(
note
[
0
],
float
)
else
min
(
note
[
0
])
for
note
in
partition
]
if
x
>
0
])
for
partition
in
partitions
])
# retourne la fréquence maximum utilisée dans les partitions
def
maxFrequence
(
self
,
partitions
):
return
max
([
max
([
note
[
0
]
if
isinstance
(
note
[
0
],
float
)
else
max
(
note
[
0
])
for
note
in
partition
])
for
partition
in
partitions
])
...
...
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