Skip to content
Snippets Groups Projects
Commit f837046c authored by Jean-Marie Favreau's avatar Jean-Marie Favreau
Browse files

Début de restructuration de l'ensemble:

* ajout d'un Makefile pour générer exercices et sons
* ajout d'illustrations
* ajout de paramètres dans chaque script pour faciliter son exécution
parent 9577c57e
No related branches found
No related tags found
No related merge requests found
Makefile 0 → 100644
EXERCICESDIR=exercices/
SONS=sons/
SCRIPTS=$(wildcard *.py)
EXESPECTEX=$(addprefix $(EXERCICESDIR)/ex-spec-,$(SCRIPTS:.py=.tex))
EXESPECPDF=$(EXESPECTEX:.tex=.pdf)
WAVES=$(addprefix $(SONS)/,$(SCRIPTS:.py=.wav))
all: waves pdf
waves: $(WAVES)
pdf: $(EXESPECPDF)
tex: $(EXESPECTEX)
$(EXERCICESDIR)/%.pdf: $(EXERCICESDIR)/%.tex
cd $(EXERCICESDIR); pdflatex $(<:$(EXERCICESDIR)/%=%); cd ..
$(EXERCICESDIR)/ex-spec-%.tex: %.py
python $< --exercice-spectrogramme
$(SONS)/%.wav: %.py
python $<
clean:
rm -f $(EXESPECTEX) $(EXESPECPDF)
File moved
File moved
This diff is collapsed.
......@@ -5,32 +5,49 @@
from musique.basicsynth import BasicSequenceur
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 du flic de Beverly Hills.')
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
args = parser.parse_args()
gamme = GammeTemperee(117)
flic = [ [ [gamme.fad(4), gamme.noire],
[gamme.la(4), gamme.crochepointee],
[gamme.fad(4), gamme.doublecroche],
[gamme.fad(4), gamme.doublecroche],
[gamme.si(4), gamme.doublecroche],
[gamme.fad(4), gamme.croche],
[gamme.mi(4), gamme.croche],
[gamme.fad(4), gamme.crochepointee],
[gamme.re(5), gamme.croche],
[gamme.fad(4), gamme.doublecroche],
[gamme.fad(4), gamme.croche],
[gamme.re(4), gamme.doublecroche],
[gamme.dod(5), gamme.doublecroche],#reb
[gamme.la(4), gamme.doublecroche],
[gamme.fad(4), gamme.doublecroche],
[gamme.dod(5), gamme.croche],
[gamme.fad(5), gamme.doublecroche],
[gamme.fad(4), gamme.doublecroche],
[gamme.mi(4), gamme.croche],
[gamme.mi(4), gamme.croche],
[gamme.dod(4), gamme.doublecroche],
[gamme.sold(4), gamme.doublecroche],#lab
[gamme.fad(4), gamme.blanche] ] ]
s = BasicSequenceur(1, 117, 0.7, 0)
flic = [ [ [s.fad(4), s.noire],
[s.la(4), s.crochepointee],
[s.fad(4), s.doublecroche],
[s.fad(4), s.doublecroche],
[s.si(4), s.doublecroche],
[s.fad(4), s.croche],
[s.mi(4), s.croche],
[s.fad(4), s.crochepointee],
[s.re(5), s.croche],
[s.fad(4), s.doublecroche],
[s.fad(4), s.croche],
[s.re(4), s.doublecroche],
[s.dod(5), s.doublecroche],#reb
[s.la(4), s.doublecroche],
[s.fad(4), s.doublecroche],
[s.dod(5), s.croche],
[s.fad(5), s.doublecroche],
[s.fad(4), s.doublecroche],
[s.mi(4), s.croche],
[s.mi(4), s.croche],
[s.dod(4), s.doublecroche],
[s.sold(4), s.doublecroche],#lab
[s.fad(4), s.blanche] ] ]
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(flic, "exercices/ex-spec-flic.tex", "thème \"le flic de Beverly Hills\"")
else:
print "Génération de la version \"piano\""
s = BasicSequenceur(1, gamme.bpm, 0.7, 0)
s.genererMelodie(flic, "sons/flic.wav")
......@@ -2,36 +2,51 @@
# 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 du flic de Beverly Hills (v2).')
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
args = parser.parse_args()
gamme = GammeTemperee(117)
s = BasicSequenceur(1, 117, 0.7, 0)
flic2 = [ [ [s.mi(4), s.croche],
[s.sol(4), s.doublecrochepointee],
[s.mi(4), s.doublecroche],
[s.mi(4), s.triplecroche],
[s.la(4), s.doublecroche],
[s.mi(4), s.doublecroche],
[s.red(4), s.doublecroche],
[s.mi(4), s.croche],
[s.si(4), s.doublecrochepointee],
[s.mi(4), s.doublecroche],
[s.mi(4), s.triplecroche],
[s.do(3), s.doublecroche],
[s.si(4), s.doublecroche],
[s.sol(4), s.doublecroche],
[s.mi(4), s.doublecroche],
[s.si(4), s.doublecroche],
[s.mi(3), s.doublecroche],
[s.mi(4), s.triplecroche],
[s.red(4), s.doublecroche],
[s.red(4), s.triplecroche],
[s.si(1), s.doublecroche],
[s.fad(4), s.doublecroche],
[s.mi(4), s.doublecroche]
flic2 = [ [ [gamme.mi(4), gamme.croche],
[gamme.sol(4), gamme.doublecrochepointee],
[gamme.mi(4), gamme.doublecroche],
[gamme.mi(4), gamme.triplecroche],
[gamme.la(4), gamme.doublecroche],
[gamme.mi(4), gamme.doublecroche],
[gamme.red(4), gamme.doublecroche],
[gamme.mi(4), gamme.croche],
[gamme.si(4), gamme.doublecrochepointee],
[gamme.mi(4), gamme.doublecroche],
[gamme.mi(4), gamme.triplecroche],
[gamme.do(3), gamme.doublecroche],
[gamme.si(4), gamme.doublecroche],
[gamme.sol(4), gamme.doublecroche],
[gamme.mi(4), gamme.doublecroche],
[gamme.si(4), gamme.doublecroche],
[gamme.mi(3), gamme.doublecroche],
[gamme.mi(4), gamme.triplecroche],
[gamme.red(4), gamme.doublecroche],
[gamme.red(4), gamme.triplecroche],
[gamme.si(1), gamme.doublecroche],
[gamme.fad(4), gamme.doublecroche],
[gamme.mi(4), gamme.doublecroche]
] ]
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(flic2, "exercices/ex-spec-flic2.tex", "thème \"le flic de Beverly Hills\"")
else:
print "Génération du son"
s = BasicSequenceur(1, gamme.bpm, 0.7, 0)
s.genererMelodie(flic2, "sons/flic2.wav")
happybirthday.py 100644 → 100755
......@@ -2,37 +2,51 @@
# 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', action='store_true',default=False)
s = BasicSequenceur(1, 117, 0.7, 0)
happy = [ [ [s.do(2), s.crochepointee],
[s.do(2), s.doublecroche],
[s.re(2), s.noire],
[s.do(2), s.noire],
[s.fa(2), s.noire],
[s.mi(2), s.blanche],
[s.do(2), s.crochepointee],
[s.do(2), s.doublecroche],
[s.re(2), s.noire],
[s.do(2), s.noire],
[s.sol(2), s.noire],
[s.fa(2), s.blanche],
[s.do(2), s.crochepointee],
[s.do(2), s.doublecroche],
[s.do(3), s.noire],
[s.la(2), s.noire],
[s.fa(2), s.noire],
[s.mi(2), s.noire],
[s.re(2), s.noire],
[s.sib(2), s.crochepointee],
[s.sib(2), s.doublecroche],
[s.la(2), s.noire],
[s.fa(2), s.noire],
[s.sol(2), s.noire],
[s.fa(2), s.blanchepointee]
args = parser.parse_args()
gamme = GammeTemperee(117)
happy = [ [ [gamme.do(2), gamme.crochepointee],
[gamme.do(2), gamme.doublecroche],
[gamme.re(2), gamme.noire],
[gamme.do(2), gamme.noire],
[gamme.fa(2), gamme.noire],
[gamme.mi(2), gamme.blanche],
[gamme.do(2), gamme.crochepointee],
[gamme.do(2), gamme.doublecroche],
[gamme.re(2), gamme.noire],
[gamme.do(2), gamme.noire],
[gamme.sol(2), gamme.noire],
[gamme.fa(2), gamme.blanche],
[gamme.do(2), gamme.crochepointee],
[gamme.do(2), gamme.doublecroche],
[gamme.do(3), gamme.noire],
[gamme.la(2), gamme.noire],
[gamme.fa(2), gamme.noire],
[gamme.mi(2), gamme.noire],
[gamme.re(2), gamme.noire],
[gamme.sib(2), gamme.crochepointee],
[gamme.sib(2), gamme.doublecroche],
[gamme.la(2), gamme.noire],
[gamme.fa(2), gamme.noire],
[gamme.sol(2), gamme.noire],
[gamme.fa(2), gamme.blanchepointee]
] ]
s.genererMelodie(happy, "sons/happy.wav")
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(happy, "exercices/ex-spec-happybirthday.tex", "thème joyeux anniversaire")
else:
print "Génération du son"
s = BasicSequenceur(1, gamme.bpm, 0.7, 0)
s.genererMelodie(happy, "sons/happybirthday.wav")
*.png
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="232.25752mm"
height="86.103554mm"
viewBox="0 0 232.25752 86.103556"
version="1.1"
id="svg8"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="enveloppe.svg"
inkscape:export-filename="/home/jm/recherche/vulgarisation/basicsynth/illustrations/enveloppe.png"
inkscape:export-xdpi="195"
inkscape:export-ydpi="195">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="221.13055"
inkscape:cy="208.74246"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1051"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<defs
id="defs2">
<marker
inkscape:stockid="Arrow2Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path950"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:0.64285715"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(-0.6)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow2Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow2Lend"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path944"
style="fill:#ffffff;fill-opacity:0.07246375;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:0.64285715"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path923"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#ffffff;fill-opacity:0.07246375;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:0.64285715"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow2Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mend-6"
style="overflow:visible"
inkscape:isstock="true">
<path
inkscape:connector-curvature="0"
id="path950-7"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:0.64285715"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(-0.6)" />
</marker>
</defs>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(7.3950696,-33.194755)">
<path
style="fill:none;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.52999997, 0.52999997;stroke-dashoffset:2.64999986;stroke-opacity:1"
d="M 10.853108,96.238802 8.774239,110.49856"
id="path846"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 20.525037,51.888405 V 103.79502"
id="path846-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
id="path900"
title="sin(x)"
d="M 3.6042047,106.71218 V 45.194172"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.86500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.64285715;marker-end:url(#Arrow2Mend)"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
id="path900-5"
title="sin(x)"
d="M -6.2847679,103.96947 H 208.12405"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.86500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.64285715;marker-end:url(#Arrow2Mend-6)"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<g
aria-label="temps"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text1840"
transform="matrix(0.82342121,0,0,0.82342121,39.70594,17.248247)">
<path
d="M 194.10464,88.047689 V 89.691 h 1.95854 v 0.738972 h -1.95854 v 3.141927 q 0,0.707968 0.19121,0.909506 0.19637,0.201538 0.79065,0.201538 h 0.97668 v 0.795817 h -0.97668 q -1.10071,0 -1.51929,-0.408244 -0.41858,-0.413411 -0.41858,-1.498617 V 90.429972 H 192.451 V 89.691 h 0.69763 v -1.643311 z"
style="stroke-width:0.26458332"
id="path1877"
inkscape:connector-curvature="0" />
<path
d="m 202.26952,92.347168 v 0.465088 h -4.37183 q 0.062,0.981852 0.58912,1.498616 0.53226,0.511597 1.47794,0.511597 0.54777,0 1.05937,-0.134359 0.51676,-0.134358 1.02319,-0.403076 v 0.89917 q -0.51159,0.217041 -1.04903,0.330729 -0.53743,0.113688 -1.09037,0.113688 -1.38493,0 -2.19625,-0.806152 -0.80615,-0.806152 -0.80615,-2.180745 0,-1.421102 0.76481,-2.253093 0.76998,-0.837158 2.07222,-0.837158 1.16789,0 1.84485,0.754476 0.68213,0.749308 0.68213,2.041219 z m -0.95085,-0.279053 q -0.0103,-0.780314 -0.43925,-1.245402 -0.42374,-0.465088 -1.12654,-0.465088 -0.79582,0 -1.27641,0.449585 -0.47542,0.449585 -0.54777,1.266073 z"
style="stroke-width:0.26458332"
id="path1879"
inkscape:connector-curvature="0" />
<path
d="m 208.33633,90.802043 q 0.35657,-0.640788 0.85267,-0.945679 0.49609,-0.304891 1.16788,-0.304891 0.90434,0 1.39527,0.63562 0.49092,0.630453 0.49092,1.79834 v 3.493327 h -0.95601 v -3.462321 q 0,-0.831991 -0.29456,-1.235067 -0.29455,-0.403076 -0.89917,-0.403076 -0.73897,0 -1.16788,0.490926 -0.42892,0.490926 -0.42892,1.33842 v 3.271118 h -0.95601 v -3.462321 q 0,-0.837158 -0.29456,-1.235067 -0.29455,-0.403076 -0.9095,-0.403076 -0.72864,0 -1.15756,0.496094 -0.42891,0.490926 -0.42891,1.333252 v 3.271118 h -0.95601 V 89.691 h 0.95601 v 0.899169 q 0.32556,-0.532267 0.78031,-0.785481 0.45476,-0.253215 1.08004,-0.253215 0.63045,0 1.0697,0.320394 0.44442,0.320394 0.65629,0.930176 z"
style="stroke-width:0.26458332"
id="path1881"
inkscape:connector-curvature="0" />
<path
d="m 215.06461,94.610596 v 3.06958 h -0.95602 V 89.691 h 0.95602 v 0.878499 q 0.29972,-0.516764 0.75447,-0.764811 0.45992,-0.253215 1.09554,-0.253215 1.0542,0 1.71049,0.837158 0.66146,0.837159 0.66146,2.201416 0,1.364258 -0.66146,2.201416 -0.65629,0.837158 -1.71049,0.837158 -0.63562,0 -1.09554,-0.248046 -0.45475,-0.253215 -0.75447,-0.769979 z m 3.23494,-2.020549 q 0,-1.049031 -0.43408,-1.64331 -0.42892,-0.599447 -1.18339,-0.599447 -0.75448,0 -1.18856,0.599447 -0.42891,0.594279 -0.42891,1.64331 0,1.049032 0.42891,1.648478 0.43408,0.594279 1.18856,0.594279 0.75447,0 1.18339,-0.594279 0.43408,-0.599446 0.43408,-1.648478 z"
style="stroke-width:0.26458332"
id="path1883"
inkscape:connector-curvature="0" />
<path
d="m 224.5524,89.861532 v 0.89917 q -0.40308,-0.206706 -0.83716,-0.310059 -0.43408,-0.103353 -0.89917,-0.103353 -0.70797,0 -1.06454,0.217041 -0.3514,0.217041 -0.3514,0.651123 0,0.330729 0.25322,0.521932 0.25321,0.186035 1.01803,0.356568 l 0.32556,0.07235 q 1.01285,0.217041 1.4366,0.614949 0.42892,0.392741 0.42892,1.100708 0,0.806152 -0.64079,1.276408 -0.63562,0.470255 -1.75183,0.470255 -0.46509,0 -0.97152,-0.09302 -0.50126,-0.08785 -1.05937,-0.268718 v -0.981852 q 0.5271,0.273885 1.0387,0.413412 0.5116,0.134358 1.01286,0.134358 0.67179,0 1.03353,-0.227376 0.36173,-0.232544 0.36173,-0.651123 0,-0.387573 -0.26355,-0.594279 -0.25838,-0.206706 -1.14205,-0.397908 l -0.33073,-0.07752 q -0.88366,-0.186035 -1.2764,-0.568441 -0.39275,-0.387573 -0.39275,-1.059367 0,-0.816487 0.57878,-1.260905 0.57878,-0.444417 1.64331,-0.444417 0.5271,0 0.99219,0.07752 0.46509,0.07751 0.85783,0.232544 z"
style="stroke-width:0.26458332"
id="path1885"
inkscape:connector-curvature="0" />
</g>
<g
aria-label="pression"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
id="text1840-3"
transform="matrix(0.77857864,0,0,0.77857864,2.5577449,10.734296)">
<path
d="m 2.265227,36.020718 v 3.06958 H 1.309213 v -7.989177 h 0.956014 v 0.8785 q 0.2997233,-0.516765 0.7544759,-0.764811 0.4599202,-0.253215 1.0955403,-0.253215 1.0541992,0 1.7104899,0.837158 0.6614583,0.837158 0.6614583,2.201416 0,1.364258 -0.6614583,2.201416 -0.6562907,0.837158 -1.7104899,0.837158 -0.6356201,0 -1.0955403,-0.248047 Q 2.5649503,36.537482 2.265227,36.020718 Z m 3.2349445,-2.020549 q 0,-1.049031 -0.434082,-1.64331 -0.4289143,-0.599447 -1.1833902,-0.599447 -0.7544759,0 -1.1885579,0.599447 -0.4289144,0.594279 -0.4289144,1.64331 0,1.049032 0.4289144,1.648478 0.434082,0.594279 1.1885579,0.594279 0.7544759,0 1.1833902,-0.594279 0.434082,-0.599446 0.434082,-1.648478 z"
style="stroke-width:0.26458332"
id="path1860"
inkscape:connector-curvature="0" />
<path
d="m 11.417123,31.989956 q -0.160197,-0.09302 -0.3514,-0.134359 -0.186035,-0.04651 -0.413411,-0.04651 -0.8061526,0 -1.2402346,0.527099 Q 8.983163,32.85812 8.983163,33.839972 v 3.04891 H 8.0271491 V 31.101121 H 8.983163 v 0.89917 q 0.2997233,-0.527099 0.7803141,-0.780314 0.4805909,-0.258382 1.1678869,-0.258382 0.09819,0 0.217041,0.0155 0.118856,0.01033 0.26355,0.03617 z"
style="stroke-width:0.26458332"
id="path1862"
inkscape:connector-curvature="0" />
<path
d="m 17.148039,33.75729 v 0.465088 h -4.371826 q 0.06201,0.981852 0.589112,1.498616 0.532267,0.511597 1.477946,0.511597 0.54777,0 1.059366,-0.134359 0.516765,-0.134358 1.023194,-0.403076 v 0.89917 q -0.511597,0.217041 -1.049032,0.330729 -0.537435,0.113688 -1.090373,0.113688 -1.384928,0 -2.196248,-0.806152 -0.806152,-0.806152 -0.806152,-2.180745 0,-1.421102 0.764811,-2.253093 0.769979,-0.837158 2.072225,-0.837158 1.167887,0 1.844848,0.754476 0.682129,0.749308 0.682129,2.041219 z m -0.950846,-0.279053 q -0.01033,-0.780314 -0.43925,-1.245402 -0.423746,-0.465088 -1.126546,-0.465088 -0.795817,0 -1.276408,0.449585 -0.475423,0.449585 -0.54777,1.266073 z"
style="stroke-width:0.26458332"
id="path1864"
inkscape:connector-curvature="0" />
<path
d="m 22.398365,31.271654 v 0.89917 q -0.403076,-0.206706 -0.837158,-0.310059 -0.434082,-0.103353 -0.89917,-0.103353 -0.707967,0 -1.064535,0.217041 -0.351399,0.217041 -0.351399,0.651123 0,0.330729 0.253214,0.521932 0.253215,0.186035 1.018026,0.356567 l 0.325561,0.07235 q 1.012858,0.217041 1.436605,0.61495 0.428915,0.392741 0.428915,1.100708 0,0.806152 -0.640788,1.276408 -0.63562,0.470255 -1.751831,0.470255 -0.465088,0 -0.971517,-0.09302 -0.501262,-0.08785 -1.059367,-0.268718 v -0.981852 q 0.5271,0.273885 1.038696,0.413412 0.511597,0.134358 1.012858,0.134358 0.671794,0 1.033529,-0.227376 0.361735,-0.232544 0.361735,-0.651123 0,-0.387573 -0.26355,-0.594279 -0.258382,-0.206706 -1.142049,-0.397908 l -0.330729,-0.07751 q -0.883667,-0.186035 -1.276408,-0.568441 -0.392741,-0.387573 -0.392741,-1.059367 0,-0.816487 0.578776,-1.260905 0.578776,-0.444417 1.643311,-0.444417 0.527099,0 0.992187,0.07752 0.465088,0.07751 0.857829,0.232544 z"
style="stroke-width:0.26458332"
id="path1866"
inkscape:connector-curvature="0" />
<path
d="m 27.917408,31.271654 v 0.89917 q -0.403076,-0.206706 -0.837158,-0.310059 -0.434082,-0.103353 -0.89917,-0.103353 -0.707967,0 -1.064535,0.217041 -0.351399,0.217041 -0.351399,0.651123 0,0.330729 0.253214,0.521932 0.253215,0.186035 1.018026,0.356567 l 0.325561,0.07235 q 1.012858,0.217041 1.436605,0.61495 0.428914,0.392741 0.428914,1.100708 0,0.806152 -0.640787,1.276408 -0.63562,0.470255 -1.751831,0.470255 -0.465088,0 -0.971517,-0.09302 -0.501262,-0.08785 -1.059367,-0.268718 v -0.981852 q 0.5271,0.273885 1.038696,0.413412 0.511597,0.134358 1.012858,0.134358 0.671794,0 1.033529,-0.227376 0.361735,-0.232544 0.361735,-0.651123 0,-0.387573 -0.26355,-0.594279 -0.258382,-0.206706 -1.142049,-0.397908 l -0.330729,-0.07751 q -0.883667,-0.186035 -1.276408,-0.568441 -0.392741,-0.387573 -0.392741,-1.059367 0,-0.816487 0.578776,-1.260905 0.578776,-0.444417 1.643311,-0.444417 0.527099,0 0.992187,0.07752 0.465088,0.07751 0.857829,0.232544 z"
style="stroke-width:0.26458332"
id="path1868"
inkscape:connector-curvature="0" />
<path
d="M 29.746754,31.101121 H 30.6976 v 5.787761 h -0.950846 z m 0,-2.253092 H 30.6976 v 1.204061 h -0.950846 z"
style="stroke-width:0.26458332"
id="path1870"
inkscape:connector-curvature="0" />
<path
d="m 34.924732,31.767747 q -0.764812,0 -1.209229,0.599447 -0.444417,0.594279 -0.444417,1.632975 0,1.038696 0.439249,1.638143 0.444418,0.594279 1.214397,0.594279 0.759643,0 1.20406,-0.599447 0.444418,-0.599446 0.444418,-1.632975 0,-1.028361 -0.444418,-1.627807 -0.444417,-0.604615 -1.20406,-0.604615 z m 0,-0.806152 q 1.240234,0 1.948201,0.806152 0.707967,0.806153 0.707967,2.232422 0,1.421102 -0.707967,2.232422 -0.707967,0.806152 -1.948201,0.806152 -1.245402,0 -1.95337,-0.806152 -0.702799,-0.81132 -0.702799,-2.232422 0,-1.426269 0.702799,-2.232422 0.707968,-0.806152 1.95337,-0.806152 z"
style="stroke-width:0.26458332"
id="path1872"
inkscape:connector-curvature="0" />
<path
d="m 43.962939,33.395555 v 3.493327 h -0.950847 v -3.462321 q 0,-0.821655 -0.320393,-1.229899 -0.320394,-0.408244 -0.961182,-0.408244 -0.769979,0 -1.214396,0.490926 -0.444417,0.490926 -0.444417,1.33842 v 3.271118 H 39.11569 v -5.787761 h 0.956014 v 0.89917 q 0.341064,-0.521932 0.800984,-0.780314 0.465088,-0.258382 1.069702,-0.258382 0.997355,0 1.508952,0.620117 0.511597,0.61495 0.511597,1.813843 z"
style="stroke-width:0.26458332"
id="path1874"
inkscape:connector-curvature="0" />
</g>
<path
id="path900-3-3"
title="sin(x)"
d="M 3.6042047,103.96947 20.525037,51.888405 29.535502,79.619395 H 136.06383 l 22.05064,24.694645"
style="opacity:1;fill:none;fill-opacity:0.07246375;stroke:#dc0000;stroke-width:0.86500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:5.92616224px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14815405"
x="-7.7509866"
y="118.06562"
id="text861"><tspan
sodipodi:role="line"
id="tspan859"
x="-7.7509866"
y="118.06562"
style="stroke-width:0.14815405">attaque</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:5.92616224px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14815405"
x="18.900406"
y="118.06562"
id="text861-3"><tspan
sodipodi:role="line"
id="tspan859-6"
x="18.900406"
y="118.06562"
style="stroke-width:0.14815405">déclin</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:5.92616224px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14815405"
x="80.022331"
y="118.06562"
id="text861-3-7"><tspan
sodipodi:role="line"
id="tspan859-6-5"
x="80.022331"
y="118.06562"
style="stroke-width:0.14815405">maintien</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:5.92616224px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.14815405"
x="134.17883"
y="118.06562"
id="text861-3-7-3"><tspan
sodipodi:role="line"
id="tspan859-6-5-5"
x="134.17883"
y="118.06562"
style="stroke-width:0.14815405">relâche</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 29.535502,79.619395 V 103.79502"
id="path846-3-62"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 136.06383,79.619395 V 103.79502"
id="path846-3-62-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.52999997, 0.52999997;stroke-dashoffset:2.64999986;stroke-opacity:1"
d="M 25.783171,96.238802 23.704302,110.49856"
id="path846-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.52999997, 0.52999997;stroke-dashoffset:2.64999986;stroke-opacity:1"
d="M 97.40966,96.238802 95.330791,110.49856"
id="path846-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.52999997, 0.52999997;stroke-dashoffset:2.64999986;stroke-opacity:1"
d="m 144.08972,96.238802 -2.07887,14.259758"
id="path846-7"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,60 +2,70 @@
# 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 de "la vie en rose".')
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
g = GenerateurExercice(160, 0.7)
s = BasicSequenceur(1, 160 , 0.7, 5)
lavieenrose = [ [ [s.do(2), s.noirepointee],
[s.si(1), s.croche],
[s.la(1), s.croche],
[s.sol(1), s.croche],
[s.mi(1), s.croche],
[s.do(2), s.croche],
[s.si(1), s.noirepointee],
[s.la(1), s.croche],
[s.sol(1), s.croche],
[s.mi(1), s.croche],
[s.do(2), s.croche],
[s.si(1), s.croche],
[s.la(1), s.noirepointee],
[s.sol(1), s.croche],
[s.mi(1), s.croche],
[s.do(1), s.croche],
[s.do(1), s.croche],
[s.si(1), s.croche],
[s.la(1), s.blanche],
[s.sol(1), s.blanche],
[s.re(2), s.noirepointee],
[s.do(2), s.croche],
[s.si(1), s.croche],
[s.la(1), s.croche],
[s.fa(1), s.croche],
[s.do(2), s.croche],
[s.si(1), s.noirepointee],
[s.la(1), s.croche],
[s.sol(1), s.croche],
[s.mi(1), s.croche],
[s.do(2), s.croche],
[s.si(1), s.croche],
[s.la(1), s.noirepointee],
[s.sol(1), s.croche],
[s.mi(1), s.croche],
[s.do(1), s.croche],
[s.do(1), s.croche],
[s.si(1), s.croche],
[s.la(1), s.blanche],
[s.sol(1), s.noirepointee],
[[s.sol(1), s.si(1)], s.croche],
[[s.do(1), s.do(2)], s.noire] ] ]
g.genererExerciceSpectrogramme(lavieenrose, "exercices/ex-spec-lavienrose.tex", "la vie en rose")
#s.genererMelodie(lavieenrose, "sons/lavieenrose.wav")
args = parser.parse_args()
gamme = GammeTemperee(160)
lavieenrose = [ [ [gamme.do(2), gamme.noirepointee],
[gamme.si(1), gamme.croche],
[gamme.la(1), gamme.croche],
[gamme.sol(1), gamme.croche],
[gamme.mi(1), gamme.croche],
[gamme.do(2), gamme.croche],
[gamme.si(1), gamme.noirepointee],
[gamme.la(1), gamme.croche],
[gamme.sol(1), gamme.croche],
[gamme.mi(1), gamme.croche],
[gamme.do(2), gamme.croche],
[gamme.si(1), gamme.croche],
[gamme.la(1), gamme.noirepointee],
[gamme.sol(1), gamme.croche],
[gamme.mi(1), gamme.croche],
[gamme.do(1), gamme.croche],
[gamme.do(1), gamme.croche],
[gamme.si(1), gamme.croche],
[gamme.la(1), gamme.blanche],
[gamme.sol(1), gamme.blanche],
[gamme.re(2), gamme.noirepointee],
[gamme.do(2), gamme.croche],
[gamme.si(1), gamme.croche],
[gamme.la(1), gamme.croche],
[gamme.fa(1), gamme.croche],
[gamme.do(2), gamme.croche],
[gamme.si(1), gamme.noirepointee],
[gamme.la(1), gamme.croche],
[gamme.sol(1), gamme.croche],
[gamme.mi(1), gamme.croche],
[gamme.do(2), gamme.croche],
[gamme.si(1), gamme.croche],
[gamme.la(1), gamme.noirepointee],
[gamme.sol(1), gamme.croche],
[gamme.mi(1), gamme.croche],
[gamme.do(1), gamme.croche],
[gamme.do(1), gamme.croche],
[gamme.si(1), gamme.croche],
[gamme.la(1), gamme.blanche],
[gamme.sol(1), gamme.noirepointee],
[[gamme.sol(1), gamme.si(1)], gamme.croche],
[[gamme.do(1), gamme.do(2)], gamme.noire] ] ]
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(lavieenrose, "exercices/ex-spec-lavieenrose.tex", "La vie en rose")
else:
print "Génération de la version \"piano\""
s = BasicSequenceur(1, gamme.bpm , 0.7, 5)
s.genererMelodie(lavieenrose, "sons/lavieenrose.wav")
rainbow.py 100644 → 100755
......@@ -2,36 +2,51 @@
# 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 de "rainbow".')
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
s = BasicSequenceur(1, 130, 0.7, 0)
rainbow = [ [ [s.do(3), s.blanche],
[s.do(3), s.noire],
[s.si(2), s.noire],
[s.sol(2), s.croche],
[s.la(2), s.croche],
[s.si(2), s.noire],
[s.do(3), s.blanche],
[s.do(2), s.noirepointee],
[s.la(2), s.croche],
[s.sol(2), s.blanche],
s.pause(),
[s.la(1), s.blanche],
[s.fa(2), s.blanche],
[s.mi(2), s.noire],
[s.do(2), s.croche],
[s.re(2), s.croche],
[s.mi(2), s.noire],
[s.fa(2), s.noire],
[s.re(2), s.noire],
[s.sol(2), s.croche],
[s.si(2), s.croche],
[s.do(2), s.croche],
[s.re(2), s.noirepointee],
[s.do(2), s.croche]
args = parser.parse_args()
gamme = GammeTemperee(130)
rainbow = [ [ [gamme.do(3), gamme.blanche],
[gamme.do(3), gamme.noire],
[gamme.si(2), gamme.noire],
[gamme.sol(2), gamme.croche],
[gamme.la(2), gamme.croche],
[gamme.si(2), gamme.noire],
[gamme.do(3), gamme.blanche],
[gamme.do(2), gamme.noirepointee],
[gamme.la(2), gamme.croche],
[gamme.sol(2), gamme.blanche],
gamme.pause(),
[gamme.la(1), gamme.blanche],
[gamme.fa(2), gamme.blanche],
[gamme.mi(2), gamme.noire],
[gamme.do(2), gamme.croche],
[gamme.re(2), gamme.croche],
[gamme.mi(2), gamme.noire],
[gamme.fa(2), gamme.noire],
[gamme.re(2), gamme.noire],
[gamme.sol(2), gamme.croche],
[gamme.si(2), gamme.croche],
[gamme.do(2), gamme.croche],
[gamme.re(2), gamme.noirepointee],
[gamme.do(2), gamme.croche]
] ]
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(rainbow, "exercices/ex-spec-rainbow.tex", "Rainbow")
else:
print "Génération du son"
s = BasicSequenceur(1, gamme.bpm, 0.7, 0)
s.genererMelodie(rainbow, "sons/rainbow.wav")
stairway.py 100644 → 100755
......@@ -2,39 +2,54 @@
# 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 de Stairway.')
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
args = parser.parse_args()
gamme = GammeTemperee(117)
s = BasicSequenceur(1, 117, 0.7, 0)
stair = [ [
[s.la(2), s.croche],
[s.do(3), s.croche],
[s.mi(3), s.croche],
[s.la(3), s.croche],
[[s.fad(2), s.si(3)], s.croche],
[s.mi(3), s.croche],
[s.do(3), s.croche],
[s.si(3), s.croche],
[[s.fa(2), s.do(4)], s.croche],
[s.mi(3), s.croche],
[s.do(3), s.croche],
[s.do(4), s.croche],
[[s.fad(2), s.fad(3)], s.croche],
[s.re(3), s.croche],
[s.la(2), s.croche],
[s.fa(3), s.croche],
[[s.fa(2), s.mi(3)], s.croche],
[s.do(3), s.croche],
[s.la(2), s.croche],
[s.do(3), s.noire],
[s.mi(3), s.croche],
[s.do(3), s.croche],
[s.la(2), s.croche],
[[s.si(1), s.sol(2), s.si(2)], s.croche],
[[s.la(2), s.do(3)], s.croche],
[[s.la(1), s.la(2)], s.blanche]
[gamme.la(2), gamme.croche],
[gamme.do(3), gamme.croche],
[gamme.mi(3), gamme.croche],
[gamme.la(3), gamme.croche],
[[gamme.fad(2), gamme.si(3)], gamme.croche],
[gamme.mi(3), gamme.croche],
[gamme.do(3), gamme.croche],
[gamme.si(3), gamme.croche],
[[gamme.fa(2), gamme.do(4)], gamme.croche],
[gamme.mi(3), gamme.croche],
[gamme.do(3), gamme.croche],
[gamme.do(4), gamme.croche],
[[gamme.fad(2), gamme.fad(3)], gamme.croche],
[gamme.re(3), gamme.croche],
[gamme.la(2), gamme.croche],
[gamme.fa(3), gamme.croche],
[[gamme.fa(2), gamme.mi(3)], gamme.croche],
[gamme.do(3), gamme.croche],
[gamme.la(2), gamme.croche],
[gamme.do(3), gamme.noire],
[gamme.mi(3), gamme.croche],
[gamme.do(3), gamme.croche],
[gamme.la(2), gamme.croche],
[[gamme.si(1), gamme.sol(2), gamme.si(2)], gamme.croche],
[[gamme.la(2), gamme.do(3)], gamme.croche],
[[gamme.la(1), gamme.la(2)], gamme.blanche]
] ]
s.genererMelodie(stair, "sons/stair.wav")
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(stair, "exercices/ex-spec-stairway.tex", "Stairway")
else:
print "Génération du son"
s = BasicSequenceur(1, gamme.bpm, 0.7, 0)
s.genererMelodie(stair, "sons/stairway.wav")
#!/usr/bin/env python
# coding: utf8
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 de star wars.')
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
args = parser.parse_args()
gamme = GammeTemperee(150)
s = BasicSequenceur(1, 150, 0.7, 3)
starwars = [
[ [s.re(2), s.croche],
[s.sol(2), s.blanche],
[s.la(2), s.noire],
[s.sib(2), s.croche],
[s.do(3), s.croche],
[s.sib(2), s.blanche],
[s.re(2), s.noirepointee],
[s.re(2), s.croche],
[s.sol(2), s.noirepointee],
[s.la(2), s.croche],
[s.sib(2), s.croche],
[s.sol(2), s.croche],
[s.sib(2), s.croche],
[s.sol(2), s.croche],
[s.re(3), s.croche],
[s.do(3), s.blanche],
[s.re(2), s.croche],
[s.re(2), s.croche],
[s.re(2), s.croche],
[s.sol(2), s.noirepointee],
[s.la(2), s.croche],
[s.sib(2), s.croche],
[s.sol(2), s.croche],
[s.sib(2), s.croche],
[s.sol(2), s.croche],
[s.sol(3), s.blanche],
[s.sol(2), s.noire],
[s.sib(2), s.croche],
[s.la(2), s.doublecroche],
[s.sol(2), s.doublecroche],
[s.re(3), s.noire],
[s.sib(2), s.croche],
[s.sol(2), s.croche],
[s.re(2), s.noirepointee],
[s.re(2), s.croche],
[s.sol(2), s.blanche]
[ [gamme.re(2), gamme.croche],
[gamme.sol(2), gamme.blanche],
[gamme.la(2), gamme.noire],
[gamme.sib(2), gamme.croche],
[gamme.do(3), gamme.croche],
[gamme.sib(2), gamme.blanche],
[gamme.re(2), gamme.noirepointee],
[gamme.re(2), gamme.croche],
[gamme.sol(2), gamme.noirepointee],
[gamme.la(2), gamme.croche],
[gamme.sib(2), gamme.croche],
[gamme.sol(2), gamme.croche],
[gamme.sib(2), gamme.croche],
[gamme.sol(2), gamme.croche],
[gamme.re(3), gamme.croche],
[gamme.do(3), gamme.blanche],
[gamme.re(2), gamme.croche],
[gamme.re(2), gamme.croche],
[gamme.re(2), gamme.croche],
[gamme.sol(2), gamme.noirepointee],
[gamme.la(2), gamme.croche],
[gamme.sib(2), gamme.croche],
[gamme.sol(2), gamme.croche],
[gamme.sib(2), gamme.croche],
[gamme.sol(2), gamme.croche],
[gamme.sol(3), gamme.blanche],
[gamme.sol(2), gamme.noire],
[gamme.sib(2), gamme.croche],
[gamme.la(2), gamme.doublecroche],
[gamme.sol(2), gamme.doublecroche],
[gamme.re(3), gamme.noire],
[gamme.sib(2), gamme.croche],
[gamme.sol(2), gamme.croche],
[gamme.re(2), gamme.noirepointee],
[gamme.re(2), gamme.croche],
[gamme.sol(2), gamme.blanche]
]]
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(starwars, "exercices/ex-spec-starwars.tex", "thème StarWars")
else:
print "Génération de la version \"piano\""
s = BasicSequenceur(1, gamme.bpm, 0.7, 3)
s.genererMelodie(starwars, "sons/starwars.wav")
......@@ -2,65 +2,84 @@
# 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 "j\'ai du bon tabac".')
parser.add_argument('--full', help="Génère l'ensemble des sons pour illustrer la construction du synthétiseur", dest='full', action='store_true',default=False)
parser.add_argument('--exercice-spectrogramme', help="Génère un exercice plutôt que le fichier son", dest='exerciceSpectrogramme', action='store_true',default=False)
s = BasicSequenceur(1, 160 , 0.7, 0)
args = parser.parse_args()
flic = [ [ [s.sol(3), s.noire],
[s.la(3), s.noire],
[s.si(3), s.noire],
[s.sol(3), s.noire],
[s.la(3), s.blanche],
[s.la(3), s.noire],
[s.si(3), s.noire],
[s.do(4), s.blanche],
[s.do(4), s.blanche],
[s.si(3), s.blanche],
[s.si(3), s.blanche],
[s.sol(3), s.noire],
[s.la(3), s.noire],
[s.si(3), s.noire],
[s.sol(3), s.noire],
[s.la(3), s.blanche],
[s.la(3), s.noire],
[s.si(3), s.noire],
[s.do(4), s.blanche],
[s.re(4), s.blanche],
[s.sol(3), s.ronde],
[s.re(4), s.blanche],
[s.re(4), s.noire],
[s.do(4), s.noire],
[s.si(3), s.blanche],
[s.la(3), s.noire],
[s.si(3), s.noire],
[s.do(4), s.blanche],
[s.re(4), s.blanche],
[s.la(3), s.ronde],
[s.re(4), s.blanche],
[s.re(4), s.noire],
[s.do(4), s.noire],
[s.si(3), s.blanche],
[s.la(3), s.noire],
[s.si(3), s.noire],
[s.do(4), s.blanche],
[s.re(4), s.blanche],
[s.la(3), s.ronde]
gamme = GammeTemperee(160)
tabac = [ [ [gamme.sol(3), gamme.noire],
[gamme.la(3), gamme.noire],
[gamme.si(3), gamme.noire],
[gamme.sol(3), gamme.noire],
[gamme.la(3), gamme.blanche],
[gamme.la(3), gamme.noire],
[gamme.si(3), gamme.noire],
[gamme.do(4), gamme.blanche],
[gamme.do(4), gamme.blanche],
[gamme.si(3), gamme.blanche],
[gamme.si(3), gamme.blanche],
[gamme.sol(3), gamme.noire],
[gamme.la(3), gamme.noire],
[gamme.si(3), gamme.noire],
[gamme.sol(3), gamme.noire],
[gamme.la(3), gamme.blanche],
[gamme.la(3), gamme.noire],
[gamme.si(3), gamme.noire],
[gamme.do(4), gamme.blanche],
[gamme.re(4), gamme.blanche],
[gamme.sol(3), gamme.ronde],
[gamme.re(4), gamme.blanche],
[gamme.re(4), gamme.noire],
[gamme.do(4), gamme.noire],
[gamme.si(3), gamme.blanche],
[gamme.la(3), gamme.noire],
[gamme.si(3), gamme.noire],
[gamme.do(4), gamme.blanche],
[gamme.re(4), gamme.blanche],
[gamme.la(3), gamme.ronde],
[gamme.re(4), gamme.blanche],
[gamme.re(4), gamme.noire],
[gamme.do(4), gamme.noire],
[gamme.si(3), gamme.blanche],
[gamme.la(3), gamme.noire],
[gamme.si(3), gamme.noire],
[gamme.do(4), gamme.blanche],
[gamme.re(4), gamme.blanche],
[gamme.la(3), gamme.ronde]
] ]
s = BasicSequenceur(1, gamme.bpm , 0.7, 0)
if args.full:
print "Génération de multiples versions"
s.setEnveloppeZeroUn(0.3)
s.genererMelodie(flic, "sons/tabac-01.wav")
s.genererMelodie(tabac, "sons/tabac-01.wav")
s.setEnveloppeMonteeDescente(0.5)
s.genererMelodie(flic, "sons/tabac-md.wav")
s.genererMelodie(tabac, "sons/tabac-md.wav")
s.setEnveloppeFrappeSimple(0.7)
s.nbHarmoniques = 0
s.genererMelodie(flic, "sons/tabac-frappe.wav")
s.genererMelodie(tabac, "sons/tabac-frappe.wav")
if args.exerciceSpectrogramme:
g = GenerateurExercice(gamme.bpm, 0.7)
g.genererExerciceSpectrogramme(tabac, "exercices/ex-spec-tabac.tex", "j'ai du bon tabac")
else:
print "Génération de la version \"piano\""
s.setEnveloppeFrappeSimple(0.7)
s.nbHarmoniques = 5
s.genererMelodie(flic, "sons/tabac-piano.wav")
s.genererMelodie(tabac, "sons/tabac-piano.wav")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment