Skip to content
Snippets Groups Projects
Commit 0724aa3a authored by Jean-Marie  FAVREAU's avatar Jean-Marie FAVREAU
Browse files

Amélioration, rendu sur plusieurs lignes de la partition

parent df68e7e5
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,7 @@ if args.exerciceSpectrogramme or args.transparent: ...@@ -60,6 +60,7 @@ if args.exerciceSpectrogramme or args.transparent:
g = GenerateurExercice(gamme.bpm) g = GenerateurExercice(gamme.bpm)
g.setBoomwhackers(boomwhackers) g.setBoomwhackers(boomwhackers)
g.setLongueurPartitionColoree(6) g.setLongueurPartitionColoree(6)
g.setLongueurPartitionMusicale(12)
if args.exerciceSpectrogramme: if args.exerciceSpectrogramme:
g.genererExerciceSpectrogramme(brahms, "exercices/ex-spec-brahms.tex", "thème 4", "Lullaby, berceuse de Brahms") g.genererExerciceSpectrogramme(brahms, "exercices/ex-spec-brahms.tex", "thème 4", "Lullaby, berceuse de Brahms")
if args.transparent: if args.transparent:
......
...@@ -72,6 +72,7 @@ if args.exerciceSpectrogramme or args.transparent: ...@@ -72,6 +72,7 @@ if args.exerciceSpectrogramme or args.transparent:
g = GenerateurExercice(gamme.bpm) g = GenerateurExercice(gamme.bpm)
g.setBoomwhackers(boomwhackers) g.setBoomwhackers(boomwhackers)
g.setLongueurPartitionColoree(8) g.setLongueurPartitionColoree(8)
g.setLongueurPartitionMusicale(16)
if args.exerciceSpectrogramme: if args.exerciceSpectrogramme:
g.genererExerciceSpectrogramme(joie, "exercices/ex-spec-joie.tex", "thème 1", "Hymne à la joie") g.genererExerciceSpectrogramme(joie, "exercices/ex-spec-joie.tex", "thème 1", "Hymne à la joie")
if args.transparent: if args.transparent:
......
...@@ -24,12 +24,17 @@ class GenerateurExercice(GammeTemperee): ...@@ -24,12 +24,17 @@ class GenerateurExercice(GammeTemperee):
self.margeLegende = 2.0 self.margeLegende = 2.0
self.boomwhackers = [] self.boomwhackers = []
self.longueurPartitionColoree = 4 self.longueurPartitionColoree = 4
self.longueurPartitionMusicale = 16
# donne la largeur d'une ligne de partition colorée, exprimée # donne la largeur d'une ligne de partition colorée, exprimée
# en nombre de noires # en nombre de noires
def setLongueurPartitionColoree(self, longueur): def setLongueurPartitionColoree(self, longueur):
self.longueurPartitionColoree = longueur self.longueurPartitionColoree = longueur
# donne la largeur d'une ligne de partition musicale, exprimée
# en nombre de noires
def setLongueurPartitionMusicale(self, longueur):
self.longueurPartitionMusicale = longueur
def setBoomwhackers(self, mw): def setBoomwhackers(self, mw):
import json import json
...@@ -467,6 +472,10 @@ class GenerateurExercice(GammeTemperee): ...@@ -467,6 +472,10 @@ class GenerateurExercice(GammeTemperee):
maxNote = max([ n for n in notes if n[1] > 0]) maxNote = max([ n for n in notes if n[1] > 0])
(maxoctave, maxidnote) = maxNote (maxoctave, maxidnote) = maxNote
midOctave = int((maxoctave + minoctave) / 2) midOctave = int((maxoctave + minoctave) / 2)
dureePartition = self.longueurPartitionMusicale * self.noire
longueurCourante = 0
if beamer: if beamer:
result += "\\normalmusicsize" result += "\\normalmusicsize"
else: else:
...@@ -482,10 +491,19 @@ class GenerateurExercice(GammeTemperee): ...@@ -482,10 +491,19 @@ class GenerateurExercice(GammeTemperee):
result += self.dureeToMusicTex(note[1]) + "{" result += self.dureeToMusicTex(note[1]) + "{"
result += self.frequenceToMusicTeX(note[0], midOctave) result += self.frequenceToMusicTeX(note[0], midOctave)
result += "}" result += "}"
longueurCourante += note[1]
else: else:
# TODO # TODO
pass pass
result +="\enotes" if longueurCourante >= dureePartition and i < len(partition) - 1:
longueurCourante = 0
result +="\\enotes"
result += "\\zendextract"
result += "\\end{music}"
result += "\\begin{music}"
result += "\\startextract"
result += "\\notes "
result +="\\enotes"
result += "\\zendextract" result += "\\zendextract"
result += "\\end{music}" result += "\\end{music}"
result += "\\caption{Partition simplifiée}" result += "\\caption{Partition simplifiée}"
......
...@@ -57,6 +57,7 @@ if args.exerciceSpectrogramme or args.transparent: ...@@ -57,6 +57,7 @@ if args.exerciceSpectrogramme or args.transparent:
g = GenerateurExercice(gamme.bpm) g = GenerateurExercice(gamme.bpm)
g.setBoomwhackers(boomwhackers) g.setBoomwhackers(boomwhackers)
g.setLongueurPartitionColoree(6) g.setLongueurPartitionColoree(6)
g.setLongueurPartitionMusicale(8)
if args.exerciceSpectrogramme: if args.exerciceSpectrogramme:
g.genererExerciceSpectrogramme(tabac, "exercices/ex-spec-tabac2.tex", "thème 3", "j'ai du bon tabac") g.genererExerciceSpectrogramme(tabac, "exercices/ex-spec-tabac2.tex", "thème 3", "j'ai du bon tabac")
if args.transparent: if args.transparent:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment