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
66ff2a87
Commit
66ff2a87
authored
6 years ago
by
Jean-Marie FAVREAU
Browse files
Options
Downloads
Patches
Plain Diff
Amélioration du rendu en partition colorées
parent
84cb088b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
boomwhackers-8.json
+8
-8
8 additions, 8 deletions
boomwhackers-8.json
joie.py
+1
-1
1 addition, 1 deletion
joie.py
musique/exercice.py
+47
-6
47 additions, 6 deletions
musique/exercice.py
with
56 additions
and
15 deletions
boomwhackers-8.json
+
8
−
8
View file @
66ff2a87
{
{
"do1"
:
{
"couleur"
:
[
167
,
56
,
36
],
"capsule"
:
"0"
},
"do1"
:
{
"couleur"
:
[
167
,
56
,
36
],
"capsule"
:
"0"
,
"court"
:
"1"
},
"re1"
:
{
"couleur"
:
[
197
,
101
,
40
],
"capsule"
:
"0"
},
"re1"
:
{
"couleur"
:
[
197
,
101
,
40
],
"capsule"
:
"0"
,
"court"
:
"0"
},
"mi1"
:
{
"couleur"
:
[
244
,
226
,
54
],
"capsule"
:
"0"
},
"mi1"
:
{
"couleur"
:
[
244
,
226
,
54
],
"capsule"
:
"0"
,
"court"
:
"0"
},
"fa1"
:
{
"couleur"
:
[
150
,
197
,
40
],
"capsule"
:
"0"
},
"fa1"
:
{
"couleur"
:
[
150
,
197
,
40
],
"capsule"
:
"0"
,
"court"
:
"0"
},
"sol1"
:
{
"couleur"
:
[
46
,
72
,
109
],
"capsule"
:
"0"
},
"sol1"
:
{
"couleur"
:
[
46
,
72
,
109
],
"capsule"
:
"0"
,
"court"
:
"0"
},
"la1"
:
{
"couleur"
:
[
62
,
58
,
135
],
"capsule"
:
"0"
},
"la1"
:
{
"couleur"
:
[
62
,
58
,
135
],
"capsule"
:
"0"
,
"court"
:
"0"
},
"si1"
:
{
"couleur"
:
[
106
,
41
,
131
],
"capsule"
:
"0"
},
"si1"
:
{
"couleur"
:
[
106
,
41
,
131
],
"capsule"
:
"0"
,
"court"
:
"0"
},
"do2"
:
{
"couleur"
:
[
151
,
55
,
30
],
"capsule"
:
"0"
}
"do2"
:
{
"couleur"
:
[
151
,
55
,
30
],
"capsule"
:
"0"
,
"court"
:
"0"
}
}
}
This diff is collapsed.
Click to expand it.
joie.py
+
1
−
1
View file @
66ff2a87
...
@@ -71,7 +71,7 @@ if args.exerciceSpectrogramme:
...
@@ -71,7 +71,7 @@ if args.exerciceSpectrogramme:
g
=
GenerateurExercice
(
gamme
.
bpm
)
g
=
GenerateurExercice
(
gamme
.
bpm
)
g
.
setBoomwhackers
(
boomwhackers
)
g
.
setBoomwhackers
(
boomwhackers
)
g
.
setLongueurPartitionColoree
(
8
)
g
.
setLongueurPartitionColoree
(
8
)
g
.
genererExerciceSpectrogramme
(
joie
,
"
exercices/ex-spec-joie.tex
"
,
"
thème
joie
"
)
g
.
genererExerciceSpectrogramme
(
joie
,
"
exercices/ex-spec-joie.tex
"
,
"
thème
1
"
)
else
:
else
:
print
"
Génération du son
"
print
"
Génération du son
"
s
=
BasicSequenceur
(
1
,
gamme
.
bpm
,
0
)
s
=
BasicSequenceur
(
1
,
gamme
.
bpm
,
0
)
...
...
This diff is collapsed.
Click to expand it.
musique/exercice.py
+
47
−
6
View file @
66ff2a87
...
@@ -293,8 +293,9 @@ class GenerateurExercice(GammeTemperee):
...
@@ -293,8 +293,9 @@ class GenerateurExercice(GammeTemperee):
def
pointColore
(
self
,
boomwhacker
,
x
,
y
,
r
):
def
pointColore
(
self
,
boomwhacker
,
x
,
y
,
r
):
result
=
self
.
couleurBoomwhackerToTikz
(
boomwhacker
)
result
=
self
.
couleurBoomwhackerToTikz
(
boomwhacker
)
rayon
=
r
if
boomwhacker
[
"
court
"
]
==
"
0
"
else
r
*
0.7
result
+=
"
\\
fill[fill=tempcolor] (
"
+
\
result
+=
"
\\
fill[fill=tempcolor] (
"
+
\
str
(
x
)
+
"
,
"
+
str
(
y
)
+
"
) circle (
"
+
str
(
r
)
+
"
);
"
str
(
x
)
+
"
,
"
+
str
(
y
)
+
"
) circle (
"
+
str
(
r
ayon
)
+
"
);
"
if
boomwhacker
[
"
capsule
"
]
==
"
1
"
:
if
boomwhacker
[
"
capsule
"
]
==
"
1
"
:
result
+=
"
\\
fill [black] (
"
+
str
(
x
-
r
)
+
"
,
"
+
str
(
y
-
1.2
*
r
)
+
\
result
+=
"
\\
fill [black] (
"
+
str
(
x
-
r
)
+
"
,
"
+
str
(
y
-
1.2
*
r
)
+
\
"
) rectangle (
"
+
str
(
x
+
r
)
+
"
,
"
+
str
(
y
-
1.9
*
r
)
+
"
);
"
"
) rectangle (
"
+
str
(
x
+
r
)
+
"
,
"
+
str
(
y
-
1.9
*
r
)
+
"
);
"
...
@@ -302,6 +303,40 @@ class GenerateurExercice(GammeTemperee):
...
@@ -302,6 +303,40 @@ class GenerateurExercice(GammeTemperee):
return
result
return
result
def
ensembleDesNotesGraphiques
(
self
,
frequences
,
radius
):
result
=
""
notes
=
sorted
(
list
(
set
(
frequences
)))
result
+=
"
\\
begin{table}[H]
\n
\centering
\n
"
result
+=
"
\\
begin{tabular}{|r|
"
+
""
.
join
([
"
c|
"
]
*
len
(
notes
))
+
"
}
\n
"
result
+=
"
\\
hline
\n
"
result
+=
"
Notes
"
for
n
in
notes
:
result
+=
"
&
"
result
+=
self
.
frequenceToLaTeX
(
n
)
result
+=
"
\\\\
\n
"
result
+=
"
Forme
"
for
n
in
notes
:
result
+=
"
&
"
result
+=
"
\\
begin{tikzpicture}[]
"
nid
=
self
.
shiftNote
(
self
.
getOctaveEtIDNote
(
n
),
self
.
shiftOctave
)
mw
=
self
.
boomwhackers
[
nid
]
result
+=
self
.
pointColore
(
mw
,
0
,
0
,
radius
)
result
+=
"
\\
end{tikzpicture}
"
result
+=
"
\\\\
\n
"
result
+=
"
Prénom
"
for
n
in
notes
:
result
+=
"
&
"
result
+=
"
\\
hspace*{2.5cm}
"
result
+=
"
\\\\
\n
"
result
+=
"
\\
hline
\n
"
result
+=
"
\\
end{tabular}
\n
"
result
+=
"
\\
caption{Représentation colorée des notes}
\n
"
result
+=
"
\\
end{table}
\n
"
return
result
def
partitionGraphique
(
self
,
partitions
):
def
partitionGraphique
(
self
,
partitions
):
result
=
""
result
=
""
...
@@ -312,6 +347,7 @@ class GenerateurExercice(GammeTemperee):
...
@@ -312,6 +347,7 @@ class GenerateurExercice(GammeTemperee):
stepx
=
2
stepx
=
2
stepy
=
2.5
stepy
=
2.5
radius
=
stepx
/
4.
finDeLigne
=
self
.
longueurPartitionColoree
*
stepx
finDeLigne
=
self
.
longueurPartitionColoree
*
stepx
...
@@ -319,11 +355,16 @@ class GenerateurExercice(GammeTemperee):
...
@@ -319,11 +355,16 @@ class GenerateurExercice(GammeTemperee):
if
self
.
estDessinable
(
partitions
):
if
self
.
estDessinable
(
partitions
):
p
=
partitions
[
0
]
p
=
partitions
[
0
]
result
+=
self
.
ensembleDesNotesGraphiques
(
frequences
,
radius
)
result
+=
"
La partition graphique suivante se lit ligne par ligne. Les durées sont représentées par les espaces entre les cercles colorés.
\n
\n
"
result
+=
"
\\
begin{figure}[H]
"
result
+=
"
\\
begin{tikzpicture}[]
"
result
+=
"
\\
begin{tikzpicture}[]
"
for
note
in
p
:
for
note
in
p
:
print
note
if
x
==
0
:
if
x
==
0
:
result
+=
"
\\
node[draw] at (-
"
+
str
(
stepx
)
+
"
,
"
+
str
(
y
)
+
"
) {
"
+
str
(
nbl
)
+
"
};
"
result
+=
"
\\
node[draw] at (-
"
+
str
(
stepx
)
+
"
,
"
+
str
(
y
)
+
"
) {
"
+
str
(
nbl
)
+
"
};
"
if
isinstance
(
note
[
0
],
float
):
if
isinstance
(
note
[
0
],
float
):
...
@@ -331,7 +372,7 @@ class GenerateurExercice(GammeTemperee):
...
@@ -331,7 +372,7 @@ class GenerateurExercice(GammeTemperee):
if
note
[
0
]
!=
0
:
if
note
[
0
]
!=
0
:
n
=
self
.
shiftNote
(
self
.
getOctaveEtIDNote
(
note
[
0
]),
self
.
shiftOctave
)
n
=
self
.
shiftNote
(
self
.
getOctaveEtIDNote
(
note
[
0
]),
self
.
shiftOctave
)
mw
=
self
.
boomwhackers
[
n
]
mw
=
self
.
boomwhackers
[
n
]
result
+=
self
.
pointColore
(
mw
,
x
,
y
,
stepx
/
4.
)
result
+=
self
.
pointColore
(
mw
,
x
,
y
,
radius
)
# on calcule la translation pour le point suivant
# on calcule la translation pour le point suivant
x
+=
self
.
dureeEnNoires
(
note
[
1
])
*
stepx
x
+=
self
.
dureeEnNoires
(
note
[
1
])
*
stepx
if
x
>=
finDeLigne
:
if
x
>=
finDeLigne
:
...
@@ -341,11 +382,11 @@ class GenerateurExercice(GammeTemperee):
...
@@ -341,11 +382,11 @@ class GenerateurExercice(GammeTemperee):
result
+=
"
\\
end{tikzpicture}
"
result
+=
"
\\
end{tikzpicture}
"
result
+=
"
\\
caption{Partition graphique retranscrite depuis le tableau des notes de la partition}
"
result
+=
"
\\
end{figure}
"
else
:
else
:
result
+=
"
Cette partition n
'
est pas représentable sous forme de partition pour boomwhackers diatoniques.
"
result
+=
"
Cette partition n
'
est pas représentable sous forme de partition pour boomwhackers diatoniques.
"
print
result
return
result
return
result
# cette fonction écrit la fin de l'exercice spectrogramme
# cette fonction écrit la fin de l'exercice spectrogramme
...
...
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