SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
Licence
Image et Son
Pierre Hanna
hanna@labri.fr
Université de Bordeaux
Son – p.1/49
Notation musicale
Manière la plus satisfaisante de transmettre de la musique: écoute.
Plus compliqué : présence de l’interprète nécessaire.
Notation musicale: transmettre une oeuvre pour qu’elle puisse être
jouée/interprétée.
Langage d’écriture musicale évolué, largement reconnu sur le plan
international.
Répertoire immense disponible sous cette forme dans les librairies
musicales.
Possibilité d’écrire votre musique de manière à la faire jouer par d’autres.
Partition : une ou plusieurs pages sur lesquelles la musique est écrite.
Son – p.2/49
Formats musicaux
Au lieu de se placer au niveau de l’onde sonore :
pression acoustique en fonction du temps
niveau musical : évènements musicaux (partition)
notes
durée des notes
Format principal : MIDI (Musical Instrument Digital Interface)
Son – p.3/49
Bibliographie (1/2)
documents officiels:
International MIDI Association, 5316 West 57th Street, Los Angeles, CA 90056, USA
International MIDI Association (IMA)
MIDI 1.0 Detailed Specification
Los Angeles, 1988.
International MIDI Association (IMA)
General MIDI System
Los Angeles, 1991.
MIDI Manufacturers Association (MMA)
The Complete MIDI 1.0 Detailed Specification – Standard MIDI Files 1.1
1996.
documents en ligne:
http://www.midi.org (officiels)
http://www.borg.com/~jglatt/tech/midispec/table.htm
http://www.harmony-central.com/MIDI
très nombreux livres sur le sujet...
Son – p.4/49
Bibliographie (2/2)
quelques critiques:
F. Richard Moore
The Dysfunctions of MIDI
Proceedings of the International Computer Music Conference
Computer Music Association, San Francisco, 1987;
Computer Music Journal
12(1):19–28, Spring 1988.
C. Muir et K. McMillen
What’s Missing in MIDI?
Guitar Player, June 1986.
...
A. Roberts
Devices for Increasing the Number of MIDI Channels
Computer Music Journal
16(4):101–104, Winter 1992.
Son – p.5/49
Qu’est-ce que MIDI?
MIDI: Musical Instrument Digital Interface
(marque déposée par la MMA: MIDI Manufacturers Association)
protocole de communication entre instruments numériques
événements musicaux (gestes de l’instrumentiste)
pas de flux audio-numérique (absence de son)
pas une véritable norme, mais un standard de marché
Son – p.6/49
Historique
origine: 1983, NAMM (North American Music Manufacturers) Show à Los Angeles
(liaison de 2 synthétiseurs de marques différentes pour qu’un instrumentiste puisse
jouer le même son avec des timbres différents depuis un unique clavier)
années 80,
première moitié: définition du protocole MIDI;
seconde moitié:
publication du standard,
premières critiques;
années 90,
première moitié: améliorations,
mais sans toucher au standard original,
seconde moitié: grosses critiques;
depuis: pas de gros changements...
→ astuces ingénieuses, mais sans réelle remise en question
Son – p.7/49
Caractéristiques techniques
liaison série (type RS 232)
vitesse de transmission: 31250 bauds
31250 bits par seconde
un message MIDI usuel:
3 octets (1 commande, 2 arguments)
un octet → 8 bits de données + 2 bits start / stop (série)
⇒ un message MIDI transmis en (3×10)/31250 ≤ 1 ms
protocole asynchrone, unidirectionnel
fonctionnement maître / esclave
Son – p.8/49
Prises MIDI (DIN)
OUT
THRU (OUT)
GROUND
THRU (IN)
IN
Son – p.9/49
Câble MIDI minimal...
IN
OUT
GROUND
IN
OUT
GROUND
(unidirectionnel: IN → OUT ou OUT → IN)
La fonctionnalité THRU (through: “à travers”):
renvoie en sortie ce qui provient de l’entrée IN.
Son – p.10/49
Périphériques MIDI
clavier maître: envoie les événements musicaux
expandeur: synthétise les sons
synthétiseur (= clavier maître + expandeur)
séquenceur: stocke les événements musicaux
contrôleur matériel: envoi de valeurs
. . .
Son – p.11/49
Exemples de réseaux MIDI (1/3)
IN
expandeur
geste (MIDI) son (non MIDI)
OUT
Son – p.12/49
Exemples de réseaux MIDI (2/3)
Son – p.13/49
Exemples de réseaux MIDI (3/3)
chaîne
I O T
I O T
I O T I O T I O T
I O T I O T I O T
I O T
I O T
maître / esclave
boucle
Son – p.14/49
Messages normaux (de voix / canal)
channel message: 1xxx cccc
1000cccc 0kkkkkkk 0ppppppp: note off (touche k, vélocité p)
1001cccc 0kkkkkkk 0ppppppp: note on (touche k, vélocité p – note OFF si p = 0)
1010cccc 0kkkkkkk 0ppppppp: after touch (touche k, pression p)
1011cccc 0ppppppp 0vvvvvvv: control change (valeur v affectée au paramètre p)
1100cccc 0nnnnnnn : program change (numéro n)
1101cccc 0ppppppp : channel pressure (pression p)
1110cccc 0vvvvvvv 0vvvvvvv: pitch wheel (valeur v [14 bits, little-endian])
0v6v5v4v3v2v1v0 0v13v12v11v10v9v8v7
Son – p.15/49
Notes et notations
notations des 7 notes de la gamme:
français la si do ré mi fa sol
anglo-saxon A B C D E F G
(touches blanches du piano)
plus les dièses (#),
au nombre de 5 dans la gamme chromatique
(touches noires du piano)
une octave = 12 demi-tons
(7 + 5 notes)
Son – p.16/49
Code des touches
code note
C C# D D# E F F# G G# A A# B
-2 | -1 – 1 2 3 4 5 6 7 8 9 10 11
-1 | 0 12 13 14 15 16 17 18 19 20 21 22 23
0 | 1 24 25 26 27 28 29 30 31 32 33 34 35
1 | 2 36 37 38 39 40 41 42 43 44 45 46 47
2 | 3 48 49 50 51 52 53 54 55 56 57 58 59
3 | 4 60 61 62 63 64 65 66 67 68 69 70 71
4 | 5 72 73 74 75 76 77 78 79 80 81 82 83
5 | 6 84 85 86 87 88 89 90 91 92 93 94 95
6 | 7 96 97 98 99 100 101 102 103 104 105 106 107
7 | 8 108 109 110 111 112 113 114 115 116 117 118 119
8 120 121 122 123 124 125 126 127
octave
Son – p.17/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
Son – p.18/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
0x90 = 10010000 = note on canal 0
Son – p.19/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
0x90 = 10010000 = note on canal 0 → prend 2 arguments:
1. numéro de touche: 0x3C = 60 → do
2. vélocité: 0x5F = 95 → forte
Son – p.20/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué
0x80 = 10000000 = note off canal 0
Son – p.21/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué
0x80 = 10000000 = note off canal 0 → prend 2 arguments:
1. numéro de touche: 0x3C = 60 → do
2. vélocité: 0x00 = 0 → non spécifiée
Son – p.22/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué, puis relâché
ensuite:
ré joué, puis relâché
mi joué, puis relâché
do joué, puis relâché∗
∗ (astuce: note on avec vélocité 0 ⇒ note off)
Son – p.23/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué, puis relâché
ré joué, puis relâché
mi joué, puis relâché
do joué, puis relâché
active sensing → ne prend pas de paramètre
Son – p.24/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué, puis relâché
ré joué, puis relâché
mi joué, puis relâché
do joué, puis relâché
octet de donnée, alors qu’on attend une commande !
Son – p.25/49
État courant: “running status”
pour économiser l’octet de commande,
le dernier octet de commande est mémorisé
(à l’exception des messages système temps-réel,
qui ne prennent pas de paramètres),
si un octet de donnée est trouvé alors qu’un octet de commande était
attendu, alors le “running status” est utilisé pour la commande.
Dans le cas de l’exemple: running status = 0x90
Son – p.26/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué, puis relâché
ré joué, puis relâché
mi joué, puis relâché
do joué, puis relâché
note on (ré, vélocité 127)
Son – p.27/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00
do joué, puis relâché
ré joué, puis relâché
mi joué, puis relâché
do joué, puis relâché
ré joué
note off (ré, vélocité non spécifiée)
Son – p.28/49
Un exemple...
en hexadécimal:
0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E
0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90
0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 interprétation:
do joué, puis relâché
ré joué, puis relâché
mi joué, puis relâché
do joué, puis relâché
ré joué, puis relâché
début d’une comptine connue. . .
Son – p.29/49
Extension General MIDI (GM)
publiée en 1991 (cf. bibliographie)
normalise:
les numéros des instruments,
les numéros des contrôleurs,
les identifiants des constructeurs.
Remarque: General Standard (GS)
est une extension non standard!
(décision unilatérale d’un constructeur dissident. . . )
Son – p.30/49
Instruments
0 acoustic piano 1 brite piano 2 synth piano 3 honky
4 electric piano 1 5 electric piano 2 6 harpischord 7 clavinet
8 celeste 9 glockenspiel 10 music box 11 vibes
12 marimba 13 xylophone 14 tubebell 15 santur
16 home organ 17 percussive organ 18 rock organ 19 church
20 reed organ 21 accordion 22 harmonica 23 concertna
24 nylon guitar 25 acoustic guitar 26 jazz guitar 27 clean guitar
28 mute guitar 29 odd guitar 30 distorted guitar 31 guitar harm
112 carillon 113 agogo 114 steel drum 115 wood block
116 taiko 117 toms 118 synth tom 119 reverse cymbal
120 fx-fret 121 fx-blow 122 seashore 123 jungle
124 telephone 125 helicopter 126 applause 127 pistol
⇒ un canal (numéro 10) reservé à la batterie (drums)
Son – p.31/49
Format de fichiers MIDI (Standard MIDI Files)
Différent des formats de fichiers son type WAV
1min = 10 Mo (WAV) = 1 Mo (MP3)
Taille importante : limites pour des communications temps-réel entre
instruments ou entre utilisateurs.
Au lieu de se placer au niveau du son (microscopique), au niveau de la
musique (macroscopique).
format musical: pas la musique elle-même, mais uniquement une
description des actions des musiciens
Son – p.32/49
Ecoute de fichiers MIDI
Pas d’écoute directe d’un fichier MIDI
Besoin d’un synthétiseur
interprétation des ordres d’un fichier musical
exemple: un synthétiseur génère une onde correspondant à un do de
violon.
la qualité du synthétiseur influence la qualité du son produit.
Synthétiseur MIDI souvent inclus dans la carte son
Son – p.33/49
Lecture de fichiers MIDI
Sous Linux, le programme timidity a
timidity -h
générer un fichier son (wav) à partir d’un fichier MIDI, il suffit
d’employer l’option -Ow:
timidity -Ow fichier.mid
a
http://timidity.sourceforge.net/
Son – p.34/49
Format MIDI: intérêt
Les fichiers MIDI sont très souvent employés sur internet.
jouer et transmettre de la musique (site web)
contrôler un instrument (claviers MIDI, instruments MIDI, . . . )
représenter un morceau (partition)
Son – p.35/49
Format MIDI: avantages
très léger, quelques k-octets pour plusieurs minutes de musique, idéal pour
Internet.
réutilisable et modifiable : chaque note étant clairement identifiée, elle
peut être modifiée facilement.
aucune dégradation lors de la transmission.
Son – p.36/49
Format MIDI: inconvénients
Réinterprétation du morceau
Interprétation propre à chaque synthétiseur
Qualité dépend du synthétiseur
Qualité très moyenne
bien moins bonne qu’un mp3. . .
Son – p.37/49
Fichiers MIDI (Standard MIDI Files)
3 formats:
format 0: piste unique pouvant contenir plusieurs canaux
format 1: plusieurs pistes à jouer simultanément
format 2: plusieurs pistes à jouer séquentiellement
structure commune:
un en-tête (header) MTHd
des pistes (tracks) MTrk
Remarque: même principe de base que le format IFF,
avec des entiers stockés également en big-endian.
Son – p.38/49
MThd: en-tête
MThd (4 octets)
taille (32 bits)
format (16 bits)
nombre de pistes (16 bits)
(+ “master track” pour les formats > 0)
division (16 bits)
en tops par temps (noire = quart de ronde)
Exemple:
tempo de 125 temps par minute
division de 96 tops par temps
⇒ durée du top d’horloge: 60 / (125 * 96) = 5 ms
Son – p.39/49
MTrk: piste
MTrk (4 octets)
taille (32 bits)
suite d’événements datés: date status data ...data
Date stockée relativement à la précédente, représentation VLQ (Variable-Length Quantity):
la représentation binaire est découpée en blocs de 7 bits
tous les blocs sont placés dans des octets dont le bit de poids fort est positionné à 1,
sauf pour le dernier bloc (pour marquer la fin).
Exemples:
codage de la valeur 50:
codage binaire: 00110010
soit en hexadécimal: 0x32
codage de la valeur 32768:
codage binaire (blocs de 8 bits): 10000000 00000000
codage binaire (blocs de 7 bits): 0000010 0000000 0000000
rajout des bits de poids fort: 10000010 10000000 00000000
soit en hexadécimal: 0x82 0x80 0x00
décodage de la représentation: 0x81 0x02
codage binaire: 10000001 00000010
retrait des bits de poids fort: (000000)10000010
valeur décimale: 27 +21 = 128 + 2 = 130 Son – p.40/49
Les méta-événements
meta event: 0xFF
séquence complète: 0xFF code taille donnée···donnée
| {z }
taille octets
principaux codes (et nombre d’octets de données):
0x00 sequence number (2)
0x01 text event (*)
0x02 copyright notice (*)
0x03 sequence / track name (*)
0x04 instrument name (*)
0x05 lyric (*)
0x06 marker (*)
0x07 cue point (*)
...
0x20 MIDI channel prefix (1)
0x2F end of track (0)
0x51 set tempo (3)
0x54 SMPTE offset (5)
0x58 time signature (4)
0x59 key signature (2)
0x7F sequencer specific (*)
Son – p.41/49
Un exemple...
test.mid:
0x4D 0x54 0x68 0x64 MThd
0x00 0x00 0x00 0x06 taille 6
0x00 0x01 format 1
0x00 0x03 3 pistes
0x00 0x60 division: 96
0x4D 0x54 0x72 0x6B MTrk
0x00 0x00 0x00 0x0B taille 11
0x00 0xFF 0x51 0x03 0x07 0xA1 0x20 0, set tempo
0x00 0xFF 0x2F 0x00 0, end of track
0x4D 0x54 0x72 0x6B MTrk
0x00 0x00 0x00 0x48 taille 72
0x00 0xB0 0x07 0x0C 0, control change: main volume 12
0x00 0xC0 0x01 0, program change 1 (piano)
0x00 0x90 0x3C 0x3F note on...
0x60 0x43 0x3F
0x60 0x3C 0x00
00 3E 3F 60 43 00 60 3E 00 00 40 3F 81 40 40 00 00 41 3F 81 40 41
00 00 43 3F 81 40 43 00 00 45 3F 81 40 45 00 00 47 3F 81 40 47 00
00 48 3F 83 00 48 00 00 FF 2F 00
Son – p.42/49
Bibliothèque midifile
Lecture fichier
Ecriture fichier
#include "midifile.h"
Son – p.43/49
Bibliothèque midifile
Ouverture du fichier MIDI
void read_midi(char * midifile)
{
...
MidiFile_t md = MidiFile_load(midifile);
Son – p.44/49
Bibliothèque midifile
Parcours des evenements
event = MidiFile_getFirstEvent(md);
/* boucle principale */
while(event)
{
...
event = MidiFileEvent_getNextEventInFile(event);
}
Son – p.45/49
Bibliothèque midifile
if (!MidiFileEvent_isVoiceEvent(event))
{
}
/* tempo */
else if (MidiFileEvent_isTempoEvent(event))
{
}
else
{
if (MidiFileEvent_isNoteStartEvent(event))
{
}
}
Son – p.46/49
Bibliothèque midifile
if (!MidiFileEvent_isVoiceEvent(event))
{
/* ----- */
/* key signature */
if (MidiFileMetaEvent_getNumber(event) == 0x59)
{
int key, mode;
data = MidiFileMetaEvent_getData(event);
key = (int)(data[0]- ’0’);
mode = (int)(data[1] - ’0’);
/*
if (mode == 0) "major"
else "minor"
*/
}
Son – p.47/49
Bibliothèque midifile
/* ----- */
/* time signature */
if (MidiFileMetaEvent_getNumber(event) == 0x58)
{
data = MidiFileMetaEvent_getData(event);
// Time Signature : (int)(data[0]-’0’);
}
}
Son – p.48/49
Bibliothèque midifile
if (MidiFileEvent_isNoteStartEvent(event))
{
/* note start */
// Channel
c=MidiFileNoteStartEvent_getChannel(event)
// Time
t=MidiFileEvent_getTick(event)
// Pitch
printf("Note jouee : %dn", MidiFileNoteStartEvent_getNote(event));
// Duration
d=MidiFileEvent_getTick(MidiFileNoteStartEvent_getNoteEndEvent(event
-MidiFileEvent_getTick(event);
// Attention channel 10 !!
}
Son – p.49/49

Contenu connexe

Dernier

MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptssusercbaa22
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptxMalikaIdseaid1
 
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...Faga1939
 
Cours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxCours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxlamourfrantz
 
MICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdf
MICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdfMICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdf
MICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdfssuser40e112
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.Franck Apolis
 
La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film françaisTxaruka
 
Sidonie au Japon . pptx Un film français
Sidonie    au   Japon  .  pptx  Un film françaisSidonie    au   Japon  .  pptx  Un film français
Sidonie au Japon . pptx Un film françaisTxaruka
 
systeme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertsysteme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertChristianMbip
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptxSAID MASHATE
 
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...M2i Formation
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.Txaruka
 
Grammaire pour les élèves de la 6ème.doc
Grammaire pour les élèves de la  6ème.docGrammaire pour les élèves de la  6ème.doc
Grammaire pour les élèves de la 6ème.docKarimKhrifech
 
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptxSUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptxssuserbd075f
 
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfCOURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfabatanebureau
 
Présentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxPrésentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxpopzair
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxssusercbaa22
 
Fondation Louis Vuitton. pptx
Fondation      Louis      Vuitton.   pptxFondation      Louis      Vuitton.   pptx
Fondation Louis Vuitton. pptxTxaruka
 
Mécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.pptMécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.pptssusercbaa22
 

Dernier (20)

MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.ppt
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptx
 
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
 
Cours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxCours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptx
 
MICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdf
MICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdfMICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdf
MICROBIOLOGIE ENDODONTIQUE english and frensh 25 nov 2020.pdf
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.
 
La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film français
 
Sidonie au Japon . pptx Un film français
Sidonie    au   Japon  .  pptx  Un film françaisSidonie    au   Japon  .  pptx  Un film français
Sidonie au Japon . pptx Un film français
 
systeme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertsysteme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expert
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
 
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.
 
Grammaire pour les élèves de la 6ème.doc
Grammaire pour les élèves de la  6ème.docGrammaire pour les élèves de la  6ème.doc
Grammaire pour les élèves de la 6ème.doc
 
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptxSUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
 
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfCOURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
 
Présentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxPrésentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptx
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
 
Fondation Louis Vuitton. pptx
Fondation      Louis      Vuitton.   pptxFondation      Louis      Vuitton.   pptx
Fondation Louis Vuitton. pptx
 
Mécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.pptMécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.ppt
 
Evaluación Alumnos de Ecole Victor Hugo
Evaluación Alumnos de Ecole  Victor HugoEvaluación Alumnos de Ecole  Victor Hugo
Evaluación Alumnos de Ecole Victor Hugo
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

cours MIDI.pdf

  • 1. Licence Image et Son Pierre Hanna hanna@labri.fr Université de Bordeaux Son – p.1/49
  • 2. Notation musicale Manière la plus satisfaisante de transmettre de la musique: écoute. Plus compliqué : présence de l’interprète nécessaire. Notation musicale: transmettre une oeuvre pour qu’elle puisse être jouée/interprétée. Langage d’écriture musicale évolué, largement reconnu sur le plan international. Répertoire immense disponible sous cette forme dans les librairies musicales. Possibilité d’écrire votre musique de manière à la faire jouer par d’autres. Partition : une ou plusieurs pages sur lesquelles la musique est écrite. Son – p.2/49
  • 3. Formats musicaux Au lieu de se placer au niveau de l’onde sonore : pression acoustique en fonction du temps niveau musical : évènements musicaux (partition) notes durée des notes Format principal : MIDI (Musical Instrument Digital Interface) Son – p.3/49
  • 4. Bibliographie (1/2) documents officiels: International MIDI Association, 5316 West 57th Street, Los Angeles, CA 90056, USA International MIDI Association (IMA) MIDI 1.0 Detailed Specification Los Angeles, 1988. International MIDI Association (IMA) General MIDI System Los Angeles, 1991. MIDI Manufacturers Association (MMA) The Complete MIDI 1.0 Detailed Specification – Standard MIDI Files 1.1 1996. documents en ligne: http://www.midi.org (officiels) http://www.borg.com/~jglatt/tech/midispec/table.htm http://www.harmony-central.com/MIDI très nombreux livres sur le sujet... Son – p.4/49
  • 5. Bibliographie (2/2) quelques critiques: F. Richard Moore The Dysfunctions of MIDI Proceedings of the International Computer Music Conference Computer Music Association, San Francisco, 1987; Computer Music Journal 12(1):19–28, Spring 1988. C. Muir et K. McMillen What’s Missing in MIDI? Guitar Player, June 1986. ... A. Roberts Devices for Increasing the Number of MIDI Channels Computer Music Journal 16(4):101–104, Winter 1992. Son – p.5/49
  • 6. Qu’est-ce que MIDI? MIDI: Musical Instrument Digital Interface (marque déposée par la MMA: MIDI Manufacturers Association) protocole de communication entre instruments numériques événements musicaux (gestes de l’instrumentiste) pas de flux audio-numérique (absence de son) pas une véritable norme, mais un standard de marché Son – p.6/49
  • 7. Historique origine: 1983, NAMM (North American Music Manufacturers) Show à Los Angeles (liaison de 2 synthétiseurs de marques différentes pour qu’un instrumentiste puisse jouer le même son avec des timbres différents depuis un unique clavier) années 80, première moitié: définition du protocole MIDI; seconde moitié: publication du standard, premières critiques; années 90, première moitié: améliorations, mais sans toucher au standard original, seconde moitié: grosses critiques; depuis: pas de gros changements... → astuces ingénieuses, mais sans réelle remise en question Son – p.7/49
  • 8. Caractéristiques techniques liaison série (type RS 232) vitesse de transmission: 31250 bauds 31250 bits par seconde un message MIDI usuel: 3 octets (1 commande, 2 arguments) un octet → 8 bits de données + 2 bits start / stop (série) ⇒ un message MIDI transmis en (3×10)/31250 ≤ 1 ms protocole asynchrone, unidirectionnel fonctionnement maître / esclave Son – p.8/49
  • 9. Prises MIDI (DIN) OUT THRU (OUT) GROUND THRU (IN) IN Son – p.9/49
  • 10. Câble MIDI minimal... IN OUT GROUND IN OUT GROUND (unidirectionnel: IN → OUT ou OUT → IN) La fonctionnalité THRU (through: “à travers”): renvoie en sortie ce qui provient de l’entrée IN. Son – p.10/49
  • 11. Périphériques MIDI clavier maître: envoie les événements musicaux expandeur: synthétise les sons synthétiseur (= clavier maître + expandeur) séquenceur: stocke les événements musicaux contrôleur matériel: envoi de valeurs . . . Son – p.11/49
  • 12. Exemples de réseaux MIDI (1/3) IN expandeur geste (MIDI) son (non MIDI) OUT Son – p.12/49
  • 13. Exemples de réseaux MIDI (2/3) Son – p.13/49
  • 14. Exemples de réseaux MIDI (3/3) chaîne I O T I O T I O T I O T I O T I O T I O T I O T I O T I O T maître / esclave boucle Son – p.14/49
  • 15. Messages normaux (de voix / canal) channel message: 1xxx cccc 1000cccc 0kkkkkkk 0ppppppp: note off (touche k, vélocité p) 1001cccc 0kkkkkkk 0ppppppp: note on (touche k, vélocité p – note OFF si p = 0) 1010cccc 0kkkkkkk 0ppppppp: after touch (touche k, pression p) 1011cccc 0ppppppp 0vvvvvvv: control change (valeur v affectée au paramètre p) 1100cccc 0nnnnnnn : program change (numéro n) 1101cccc 0ppppppp : channel pressure (pression p) 1110cccc 0vvvvvvv 0vvvvvvv: pitch wheel (valeur v [14 bits, little-endian]) 0v6v5v4v3v2v1v0 0v13v12v11v10v9v8v7 Son – p.15/49
  • 16. Notes et notations notations des 7 notes de la gamme: français la si do ré mi fa sol anglo-saxon A B C D E F G (touches blanches du piano) plus les dièses (#), au nombre de 5 dans la gamme chromatique (touches noires du piano) une octave = 12 demi-tons (7 + 5 notes) Son – p.16/49
  • 17. Code des touches code note C C# D D# E F F# G G# A A# B -2 | -1 – 1 2 3 4 5 6 7 8 9 10 11 -1 | 0 12 13 14 15 16 17 18 19 20 21 22 23 0 | 1 24 25 26 27 28 29 30 31 32 33 34 35 1 | 2 36 37 38 39 40 41 42 43 44 45 46 47 2 | 3 48 49 50 51 52 53 54 55 56 57 58 59 3 | 4 60 61 62 63 64 65 66 67 68 69 70 71 4 | 5 72 73 74 75 76 77 78 79 80 81 82 83 5 | 6 84 85 86 87 88 89 90 91 92 93 94 95 6 | 7 96 97 98 99 100 101 102 103 104 105 106 107 7 | 8 108 109 110 111 112 113 114 115 116 117 118 119 8 120 121 122 123 124 125 126 127 octave Son – p.17/49
  • 18. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 Son – p.18/49
  • 19. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 0x90 = 10010000 = note on canal 0 Son – p.19/49
  • 20. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 0x90 = 10010000 = note on canal 0 → prend 2 arguments: 1. numéro de touche: 0x3C = 60 → do 2. vélocité: 0x5F = 95 → forte Son – p.20/49
  • 21. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué 0x80 = 10000000 = note off canal 0 Son – p.21/49
  • 22. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué 0x80 = 10000000 = note off canal 0 → prend 2 arguments: 1. numéro de touche: 0x3C = 60 → do 2. vélocité: 0x00 = 0 → non spécifiée Son – p.22/49
  • 23. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué, puis relâché ensuite: ré joué, puis relâché mi joué, puis relâché do joué, puis relâché∗ ∗ (astuce: note on avec vélocité 0 ⇒ note off) Son – p.23/49
  • 24. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué, puis relâché ré joué, puis relâché mi joué, puis relâché do joué, puis relâché active sensing → ne prend pas de paramètre Son – p.24/49
  • 25. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué, puis relâché ré joué, puis relâché mi joué, puis relâché do joué, puis relâché octet de donnée, alors qu’on attend une commande ! Son – p.25/49
  • 26. État courant: “running status” pour économiser l’octet de commande, le dernier octet de commande est mémorisé (à l’exception des messages système temps-réel, qui ne prennent pas de paramètres), si un octet de donnée est trouvé alors qu’un octet de commande était attendu, alors le “running status” est utilisé pour la commande. Dans le cas de l’exemple: running status = 0x90 Son – p.26/49
  • 27. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué, puis relâché ré joué, puis relâché mi joué, puis relâché do joué, puis relâché note on (ré, vélocité 127) Son – p.27/49
  • 28. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 do joué, puis relâché ré joué, puis relâché mi joué, puis relâché do joué, puis relâché ré joué note off (ré, vélocité non spécifiée) Son – p.28/49
  • 29. Un exemple... en hexadécimal: 0x90 0x3C 0x5F 0x80 0x3C 0x00 0x90 0x3E 0x64 0x80 0x3E 0x00 0x90 0x40 0x63 0x80 0x40 0x00 0x90 0x3C 0x47 0x90 0x3C 0x00 0xFE 0x3E 0x7F 0x3E 0x00 interprétation: do joué, puis relâché ré joué, puis relâché mi joué, puis relâché do joué, puis relâché ré joué, puis relâché début d’une comptine connue. . . Son – p.29/49
  • 30. Extension General MIDI (GM) publiée en 1991 (cf. bibliographie) normalise: les numéros des instruments, les numéros des contrôleurs, les identifiants des constructeurs. Remarque: General Standard (GS) est une extension non standard! (décision unilatérale d’un constructeur dissident. . . ) Son – p.30/49
  • 31. Instruments 0 acoustic piano 1 brite piano 2 synth piano 3 honky 4 electric piano 1 5 electric piano 2 6 harpischord 7 clavinet 8 celeste 9 glockenspiel 10 music box 11 vibes 12 marimba 13 xylophone 14 tubebell 15 santur 16 home organ 17 percussive organ 18 rock organ 19 church 20 reed organ 21 accordion 22 harmonica 23 concertna 24 nylon guitar 25 acoustic guitar 26 jazz guitar 27 clean guitar 28 mute guitar 29 odd guitar 30 distorted guitar 31 guitar harm 112 carillon 113 agogo 114 steel drum 115 wood block 116 taiko 117 toms 118 synth tom 119 reverse cymbal 120 fx-fret 121 fx-blow 122 seashore 123 jungle 124 telephone 125 helicopter 126 applause 127 pistol ⇒ un canal (numéro 10) reservé à la batterie (drums) Son – p.31/49
  • 32. Format de fichiers MIDI (Standard MIDI Files) Différent des formats de fichiers son type WAV 1min = 10 Mo (WAV) = 1 Mo (MP3) Taille importante : limites pour des communications temps-réel entre instruments ou entre utilisateurs. Au lieu de se placer au niveau du son (microscopique), au niveau de la musique (macroscopique). format musical: pas la musique elle-même, mais uniquement une description des actions des musiciens Son – p.32/49
  • 33. Ecoute de fichiers MIDI Pas d’écoute directe d’un fichier MIDI Besoin d’un synthétiseur interprétation des ordres d’un fichier musical exemple: un synthétiseur génère une onde correspondant à un do de violon. la qualité du synthétiseur influence la qualité du son produit. Synthétiseur MIDI souvent inclus dans la carte son Son – p.33/49
  • 34. Lecture de fichiers MIDI Sous Linux, le programme timidity a timidity -h générer un fichier son (wav) à partir d’un fichier MIDI, il suffit d’employer l’option -Ow: timidity -Ow fichier.mid a http://timidity.sourceforge.net/ Son – p.34/49
  • 35. Format MIDI: intérêt Les fichiers MIDI sont très souvent employés sur internet. jouer et transmettre de la musique (site web) contrôler un instrument (claviers MIDI, instruments MIDI, . . . ) représenter un morceau (partition) Son – p.35/49
  • 36. Format MIDI: avantages très léger, quelques k-octets pour plusieurs minutes de musique, idéal pour Internet. réutilisable et modifiable : chaque note étant clairement identifiée, elle peut être modifiée facilement. aucune dégradation lors de la transmission. Son – p.36/49
  • 37. Format MIDI: inconvénients Réinterprétation du morceau Interprétation propre à chaque synthétiseur Qualité dépend du synthétiseur Qualité très moyenne bien moins bonne qu’un mp3. . . Son – p.37/49
  • 38. Fichiers MIDI (Standard MIDI Files) 3 formats: format 0: piste unique pouvant contenir plusieurs canaux format 1: plusieurs pistes à jouer simultanément format 2: plusieurs pistes à jouer séquentiellement structure commune: un en-tête (header) MTHd des pistes (tracks) MTrk Remarque: même principe de base que le format IFF, avec des entiers stockés également en big-endian. Son – p.38/49
  • 39. MThd: en-tête MThd (4 octets) taille (32 bits) format (16 bits) nombre de pistes (16 bits) (+ “master track” pour les formats > 0) division (16 bits) en tops par temps (noire = quart de ronde) Exemple: tempo de 125 temps par minute division de 96 tops par temps ⇒ durée du top d’horloge: 60 / (125 * 96) = 5 ms Son – p.39/49
  • 40. MTrk: piste MTrk (4 octets) taille (32 bits) suite d’événements datés: date status data ...data Date stockée relativement à la précédente, représentation VLQ (Variable-Length Quantity): la représentation binaire est découpée en blocs de 7 bits tous les blocs sont placés dans des octets dont le bit de poids fort est positionné à 1, sauf pour le dernier bloc (pour marquer la fin). Exemples: codage de la valeur 50: codage binaire: 00110010 soit en hexadécimal: 0x32 codage de la valeur 32768: codage binaire (blocs de 8 bits): 10000000 00000000 codage binaire (blocs de 7 bits): 0000010 0000000 0000000 rajout des bits de poids fort: 10000010 10000000 00000000 soit en hexadécimal: 0x82 0x80 0x00 décodage de la représentation: 0x81 0x02 codage binaire: 10000001 00000010 retrait des bits de poids fort: (000000)10000010 valeur décimale: 27 +21 = 128 + 2 = 130 Son – p.40/49
  • 41. Les méta-événements meta event: 0xFF séquence complète: 0xFF code taille donnée···donnée | {z } taille octets principaux codes (et nombre d’octets de données): 0x00 sequence number (2) 0x01 text event (*) 0x02 copyright notice (*) 0x03 sequence / track name (*) 0x04 instrument name (*) 0x05 lyric (*) 0x06 marker (*) 0x07 cue point (*) ... 0x20 MIDI channel prefix (1) 0x2F end of track (0) 0x51 set tempo (3) 0x54 SMPTE offset (5) 0x58 time signature (4) 0x59 key signature (2) 0x7F sequencer specific (*) Son – p.41/49
  • 42. Un exemple... test.mid: 0x4D 0x54 0x68 0x64 MThd 0x00 0x00 0x00 0x06 taille 6 0x00 0x01 format 1 0x00 0x03 3 pistes 0x00 0x60 division: 96 0x4D 0x54 0x72 0x6B MTrk 0x00 0x00 0x00 0x0B taille 11 0x00 0xFF 0x51 0x03 0x07 0xA1 0x20 0, set tempo 0x00 0xFF 0x2F 0x00 0, end of track 0x4D 0x54 0x72 0x6B MTrk 0x00 0x00 0x00 0x48 taille 72 0x00 0xB0 0x07 0x0C 0, control change: main volume 12 0x00 0xC0 0x01 0, program change 1 (piano) 0x00 0x90 0x3C 0x3F note on... 0x60 0x43 0x3F 0x60 0x3C 0x00 00 3E 3F 60 43 00 60 3E 00 00 40 3F 81 40 40 00 00 41 3F 81 40 41 00 00 43 3F 81 40 43 00 00 45 3F 81 40 45 00 00 47 3F 81 40 47 00 00 48 3F 83 00 48 00 00 FF 2F 00 Son – p.42/49
  • 43. Bibliothèque midifile Lecture fichier Ecriture fichier #include "midifile.h" Son – p.43/49
  • 44. Bibliothèque midifile Ouverture du fichier MIDI void read_midi(char * midifile) { ... MidiFile_t md = MidiFile_load(midifile); Son – p.44/49
  • 45. Bibliothèque midifile Parcours des evenements event = MidiFile_getFirstEvent(md); /* boucle principale */ while(event) { ... event = MidiFileEvent_getNextEventInFile(event); } Son – p.45/49
  • 46. Bibliothèque midifile if (!MidiFileEvent_isVoiceEvent(event)) { } /* tempo */ else if (MidiFileEvent_isTempoEvent(event)) { } else { if (MidiFileEvent_isNoteStartEvent(event)) { } } Son – p.46/49
  • 47. Bibliothèque midifile if (!MidiFileEvent_isVoiceEvent(event)) { /* ----- */ /* key signature */ if (MidiFileMetaEvent_getNumber(event) == 0x59) { int key, mode; data = MidiFileMetaEvent_getData(event); key = (int)(data[0]- ’0’); mode = (int)(data[1] - ’0’); /* if (mode == 0) "major" else "minor" */ } Son – p.47/49
  • 48. Bibliothèque midifile /* ----- */ /* time signature */ if (MidiFileMetaEvent_getNumber(event) == 0x58) { data = MidiFileMetaEvent_getData(event); // Time Signature : (int)(data[0]-’0’); } } Son – p.48/49
  • 49. Bibliothèque midifile if (MidiFileEvent_isNoteStartEvent(event)) { /* note start */ // Channel c=MidiFileNoteStartEvent_getChannel(event) // Time t=MidiFileEvent_getTick(event) // Pitch printf("Note jouee : %dn", MidiFileNoteStartEvent_getNote(event)); // Duration d=MidiFileEvent_getTick(MidiFileNoteStartEvent_getNoteEndEvent(event -MidiFileEvent_getTick(event); // Attention channel 10 !! } Son – p.49/49