diff --git a/dico_clavier.py b/dico_clavier.py new file mode 100644 index 0000000..2738cfd --- /dev/null +++ b/dico_clavier.py @@ -0,0 +1,30 @@ +from pygame.locals import * + +midi_note={} + +midi_note[K_a]=440 +midi_note[K_z]=466 +midi_note[K_e]=494 +midi_note[K_r]=523 +midi_note[K_t]=554 +midi_note[K_y]=587 +midi_note[K_u]=622 +midi_note[K_i]=659 +midi_note[K_o]=698 +midi_note[K_p]=740 +midi_note[K_q]=784 +midi_note[K_s]=831 +midi_note[K_d]=880 +midi_note[K_f]=932 +midi_note[K_g]=988 +midi_note[K_h]=1046 +midi_note[K_j]=1109 +midi_note[K_k]=1175 +midi_note[K_l]=1244 +midi_note[K_m]=1318 +midi_note[K_w]=1397 +midi_note[K_x]=1480 +midi_note[K_c]=1568 +midi_note[K_v]=1661 +midi_note[K_b]=1760 +midi_note[K_n]=1865 diff --git a/exec.php b/exec.php new file mode 100755 index 0000000..f75a485 --- /dev/null +++ b/exec.php @@ -0,0 +1,10 @@ +

"; + if (isset($_POST["button"]) { + $resultat = system("sudo python /var/www/cgi-bin/main.py"); + } + if (isset($_POST["live"]) { + $resultat = system("sudo python /var/www/cgi-bin/live.py"); + } + echo "

"; +?> diff --git a/index.html b/index.html new file mode 100755 index 0000000..5f94782 --- /dev/null +++ b/index.html @@ -0,0 +1,30 @@ + + + + + + P45 Orchestre Electronique - Page de test + + +

IMA4 Projets S8 - P45 Orchestre Electronique

+
+

ROJ Thomas - IMA4SC

+

LETELLIER Joshua - IMA4SA

+
+

Prototype d'interface WEB

+

Premier programme : La marche impériale + sur 2 FDD

+ +
+
+ +
+
+ +
+
+ +
+
+ + diff --git a/live.py b/live.py new file mode 100644 index 0000000..052fa5f --- /dev/null +++ b/live.py @@ -0,0 +1,25 @@ +import dico_clavier +import sys +import time +import pygame +from pygame.locals import * +from RPi import GPIO + +def main(args): + GPIO.setmode(GPIO.BCM) + GPIO.setup(23,GPIO.OUT) + GPIO.setup(24, GPIO.OUT) + GPIO.setup(25,GPIO.OUT) + GPIO.setup(18,GPIO.OUT) + p = GPIO.PWM(18,1) + p.start(35) + pygame.init() + pygame.display.set_mode((640,480)) + continuer = 1 + while continuer: + for event in pygame.event.get(): + if (event.type == KEYDOWN): + p.ChangeFrequency(dico_clavier.midi_note[event.key]) + time.sleep(0.2) + +main(sys.argv) -- libgit2 0.21.2