Projet Exemple de fonctionnement Analyseur de courbe Banque audio son.jo sous bash Exemple 7 Exemple 8 Exemple 9 Exemple 10 Ancien format son.jo Ancien sonnerie de téléphone Ancien exemple sur la durée

Projet gkri

version 2.01 Le projet "constructeur d'exercices" alias gkri fait partie d'une série de projets imaginés et réalisés par Andre pierre jocelyn.
Dans la continuation des projets de création, " clé USB bootable, moteur de recherche système expert, technique de modélisations en sciences " ce projet est un nouvel outil qui a pour but de créer des exercices ou examens en ligne. En téléchargement gratuit ici

Format audio en music.jo

/** *@projet audio au format jo
*@ le format jo est un fichier de musique écrit en mode texte par
*@ Andre pierre jocelyn
*@ andre@univ-montp2.fr
*la lecture du fonctionnement des class son ici
*http://wwwdi.supelec.fr/fb/enseignement/latin1/JavaSound/SonSimple.java
*a permis de fignoler mon script de base donc je le cite
// Frédéric Boulanger
// Supélec - Département Informatique
// 3 rue Joliot-Curie
// 91192 Gif-sur-Yvette cedex, France
//
// frederic.boulanger@supelec.fr
*/
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;


public class Onde {

/** C ici que commence la construction des ondes
* chaque onde devra avoir son propre void, il suffit de copier coller
*en remplaçant le numéro de l'onde pour en créer une nouvelle
*/

//onde 1
public static void face1(double freq1, long duree1, SourceDataLine onde1) {


AudioFormat jo1 = onde1.getFormat();

float TauxEchantillon1 = jo1.getSampleRate();

int tailletampon1 = onde1.getBufferSize();

int tailleEchantillon1 = jo1.getSampleSizeInBits();
int nbOctets = 0;
int valMax1 = 0;
if (tailleEchantillon1 == 8) {
nbOctets = 1;
valMax1 = 0x7F;
} else if (tailleEchantillon1 == 16) {
nbOctets = 2;
valMax1 = 0x7FFF;
} else {
throw new Error("# Nombre de bits par échantillon non supporté : " + tailleEchantillon1);
}

boolean bigEndian = jo1.isBigEndian();


int nbEchantillons = (int)Math.ceil((double)duree1 / 1000 * TauxEchantillon1);

byte echantillonaudio1[] = new byte[tailletampon1];
int i = 0;
while (i ‹ nbEchantillons) {

int j = 0;
while ((j ‹ tailletampon1) && (i ‹ nbEchantillons)) {

int val1 = (int)(valMax1 * base1(i++, freq1, TauxEchantillon1));
if (nbOctets == 1) {

echantillonaudio1[j++] = (byte)val1;
} else if (bigEndian) {

echantillonaudio1[j++] = (byte)((val1 & 0xFF00) >> 8);
echantillonaudio1[j++] = (byte)(val1 & 0x00FF);
} else {

echantillonaudio1[j++] = (byte)(val1 & 0x00FF);
echantillonaudio1[j++] = (byte)((val1 & 0xFF00) >> 8);
}
}

onde1.write(echantillonaudio1, 0, j);
}
}
// fin onde 1

//debut onde 2

public static void face2(double freq2, long duree2, SourceDataLine onde2) {

AudioFormat jo2 = onde2.getFormat();

float TauxEchantillon2 = jo2.getSampleRate();

int tailletampon2 = onde2.getBufferSize();

int tailleEchantillon2 = jo2.getSampleSizeInBits();
int nbOctets = 0;
int valMax2 = 0;
if (tailleEchantillon2 == 8) {
nbOctets = 1;
valMax2 = 0x7F;
} else if (tailleEchantillon2 == 16) {
nbOctets = 2;
valMax2 = 0x7FFF;
} else {
throw new Error("# Nombre de bits par échantillon non supporté : " + tailleEchantillon2);
}

boolean bigEndian = jo2.isBigEndian();

int nbEchantillons = (int)Math.ceil((double)duree2 / 1000 * TauxEchantillon2);

byte echantillonaudio2[] = new byte[tailletampon2];
int i = 0;
while (i ‹ nbEchantillons) {

int j = 0;
while ((j ‹ tailletampon2) && (i ‹ nbEchantillons)) {

int val2 = (int)(valMax2 * base2(i++, freq2, TauxEchantillon2));
if (nbOctets == 1) {

echantillonaudio2[j++] = (byte)val2;
} else if (bigEndian) {

echantillonaudio2[j++] = (byte)((val2 & 0xFF00) >> 8);
echantillonaudio2[j++] = (byte)(val2 & 0x00FF);
} else {

echantillonaudio2[j++] = (byte)(val2 & 0x00FF);
echantillonaudio2[j++] = (byte)((val2 & 0xFF00) >> 8);
}
}

onde2.write(echantillonaudio2, 0, j);
}
}
//fin onde 2
//debut onde 3

public static void face3(double freq3, long duree3, SourceDataLine onde3) {

AudioFormat jo3 = onde3.getFormat();

float TauxEchantillon3 = jo3.getSampleRate();

int tailletampon3 = onde3.getBufferSize();

int tailleEchantillon3 = jo3.getSampleSizeInBits();
int nbOctets = 0;
int valMax3 = 0;
if (tailleEchantillon3 == 8) {
nbOctets = 1;
valMax3 = 0x7F;
} else if (tailleEchantillon3 == 16) {
nbOctets = 2;
valMax3 = 0x7FFF;
} else {
throw new Error("# Nombre de bits par échantillon non supporté : " + tailleEchantillon3);
}

boolean bigEndian = jo3.isBigEndian();


int nbEchantillons3 = (int)Math.ceil((double)duree3 / 1000 * TauxEchantillon3);

byte echantillonaudio3[] = new byte[tailletampon3];
int i = 0;
while (i < nbEchantillons3) {

int j = 0;
while ((j ‹ tailletampon3) && (i ‹ nbEchantillons3)) {

int val3 = (int)(valMax3 * base3(i++, freq3, TauxEchantillon3));
if (nbOctets == 1) {

echantillonaudio3[j++] = (byte)val3;
} else if (bigEndian) {

echantillonaudio3[j++] = (byte)((val3 & 0xFF00) >> 8);
echantillonaudio3[j++] = (byte)(val3 & 0x00FF);
} else {

echantillonaudio3[j++] = (byte)(val3 & 0x00FF);
echantillonaudio3[j++] = (byte)((val3 & 0xFF00) >> 8);
}
}

onde3.write(echantillonaudio3, 0, j);
}
}
//fin onde 3
//debut onde 4

public static void face4(double freq4, long duree4, SourceDataLine onde4) {

AudioFormat jo4 = onde4.getFormat();

float TauxEchantillon4 = jo4.getSampleRate();

int tailletampon4 = onde4.getBufferSize();

int tailleEchantillon4 = jo4.getSampleSizeInBits();
int nbOctets = 0;
int valMax4 = 0;
if (tailleEchantillon4 == 8) {
nbOctets = 1;
valMax4 = 0x7F;
} else if (tailleEchantillon4 == 16) {
nbOctets = 2;
valMax4 = 0x7FFF;
} else {
throw new Error("# Nombre de bits par échantillon non supporté : " + tailleEchantillon4);
}

boolean bigEndian = jo4.isBigEndian();

int nbEchantillons4 = (int)Math.ceil((double)duree4 / 1000 * TauxEchantillon4);

byte echantillonaudio4[] = new byte[tailletampon4];
int i = 0;
while (i ‹ nbEchantillons4) {
int j = 0;
while ((j ‹ tailletampon4) && (i ‹ nbEchantillons4)) {
int val4 = (int)(valMax4 * base2(i++, freq4, TauxEchantillon4));
if (nbOctets == 1) {

echantillonaudio4[j++] = (byte)val4;
} else if (bigEndian) {

echantillonaudio4[j++] = (byte)((val4 & 0xFF00) >> 8);
echantillonaudio4[j++] = (byte)(val4 & 0x00FF);
} else {

echantillonaudio4[j++] = (byte)(val4 & 0x00FF);
echantillonaudio4[j++] = (byte)((val4 & 0xFF00) >> 8);
}
}

onde4.write(echantillonaudio4, 0, j);
}
}



// fin onde 4



//ici nous indiquons quel va etre la forme de chaque onde
//en exemple pour les voyelles nous utilisons une fonction sinus
// pour les consonnes une fonction exponentielle
//debut forme d'onde 1
public static double base1(int i, double freq1, double pourcentage1) {

double temps1 = Math.IEEEremainder(i/pourcentage1, 1/freq1);

if (temps1 ‹ 0) {
temps1 += 1 / freq1;
}

// return (0.25 *Math.sin(2 * Math.PI * freq * temps1));
// return (0.42 * Math.sin(2 * Math.PI * freq * temps1));
// return Math.exp(t)*(0.50 * Math.sin(freq * temps1 * Math.exp(1)));
return (0.5 * Math.sin(2 * Math.PI * freq1 * temps1));
// return (0.5 * Math.sin(freq1 * Math.exp(temps1)));
// return (0.125 * Math.cos(2 * Math.PI * freq1 * temps1 + 1 ) * Math.cos(2 * Math.PI * freq1 * temps1 +1));
}
//fin forme onde 1
//debut forme d'onde 2
public static double base2(int i, double freq2, double pourcentage2) {

double temps2 = Math.IEEEremainder(i/pourcentage2, 1/freq2);

if (temps2 ‹ 0) {
temps2 += 1 / freq2;
}

// return Math.exp(temps2)*(Math.sin(freq * temps2 ));
// return Math.exp(temps2)*(0.25 * Math.sin(freq * temps2 * Math.exp(1)));
// return (0.14 * Math.sin(2 * Math.PI * freq * temps2));
// return (0.25 * Math.sin(freq * temps2 * Math.exp(1)));
return (0.5 * Math.sin(2 * Math.PI * freq2 * temps2));
// return (0.5 * Math.sin(freq2 * Math.exp(temps2)));
// return (0.125 * Math.cos(2 * Math.PI * freq2 * temps2 + 1) * Math.cos(2 * Math.PI * freq2 * temps2 + 1));
}

//fin forme onde 2
//debut forme d'onde 3

public static double base3(int i, double freq3, double pourcentage3) {

double temps3 = Math.IEEEremainder(i/pourcentage3, 1/freq3);

if (temps3 ‹ 0) {
temps3 += 1 / freq3;
}

// return Math.exp(t)*(Math.sin(freq * temps3 ));
// return (0.25 * Math.sin(freq3 * temps3 * Math.exp(1)));
// return (0.06 * Math.sin(2 * Math.PI * freq3 * temps3));
return (0.5 * Math.sin(2 * Math.PI * freq3 * temps3));
// return (0.5 * Math.sin(freq3 * Math.exp(temps3)));
// return (0.125 * Math.cos(2 * Math.PI * freq3 * temps3 + 1) * Math.cos(2 * Math.PI * freq3 * temps3 + 1));
}
//fin forme onde 3
//debut forme d'onde 4 ici une forme pour consonne donc onde cassante

public static double base4(int i, double freq4, double pourcentage4) {

double temps4 = Math.IEEEremainder(i/pourcentage4, 1/freq4);

if (temps4 ‹ 0) {
temps4 += 1 / freq4;
} // return (0.125 * Math.sin(2 * Math.PI * freq4 * temps4 + 1) * Math.cos(2 * Math.PI * freq4 * temps4 + 1));
// return Math.exp(temps4)*(Math.sin(freq4 * temps4 ));
// return (0.25 * Math.sin(freq * temps4 * Math.exp(1)));
// return (0.06 * Math.sin(2 * Math.PI * freq4 * temps4));
return (0.2 * Math.sin(2 * Math.PI * freq4 * temps4));
}
//fin forme onde 4

public static void main(String args[]) {
final float TauxEchantillon1 = 20500;
final int tailleEchantillon1 = 8;
final float TauxEchantillon2 = 20500;
final int tailleEchantillon2 = 8;
final float TauxEchantillon3 = 20500;
final int tailleEchantillon3 = 8;
final float TauxEchantillon4 = 20500;
final int tailleEchantillon4 = 8;
final boolean bigEndian = true;
final boolean signed = true;

AudioFormat audiojo1 = new AudioFormat(TauxEchantillon1, tailleEchantillon1, 1, signed, bigEndian);
AudioFormat audiojo2 = new AudioFormat(TauxEchantillon2, tailleEchantillon2, 1, signed, bigEndian);
AudioFormat audiojo3 = new AudioFormat(TauxEchantillon3, tailleEchantillon3, 1, signed, bigEndian);
AudioFormat audiojo4 = new AudioFormat(TauxEchantillon4, tailleEchantillon4, 1, signed, bigEndian);

SourceDataLine onde1 = null;
SourceDataLine onde2 = null;
SourceDataLine onde3 = null;
SourceDataLine onde4 = null;

try {
onde1 = AudioSystem.getSourceDataLine(audiojo1);
onde1.open(audiojo1);
onde2 = AudioSystem.getSourceDataLine(audiojo2);
onde2.open(audiojo2);
onde3 = AudioSystem.getSourceDataLine(audiojo3);
onde3.open(audiojo3);
onde4 = AudioSystem.getSourceDataLine(audiojo4);
onde4.open(audiojo4);

} catch (LineUnavailableException lue) {
System.out.println("# Erreur : impossible de trouver une ligne de sortie audio au format :");
System.out.println("# " + audiojo1);
System.exit(1);
}

onde1.start();
onde2.start();
onde3.start();
onde4.start();

//ici commence les données à modifier pour jouer différents son
// variables pour les boucles
double B1 = 0 , B2 = 0 , B3 = 0 , B4 = 0 , B5 , B6 = 0 , B7 = 0;
// variables des durées
int Dur1 = 8 , Dur2 = 4 , Dur3 = 4;
//fréquence
double F1 = Math.exp(6) , F2 = 3 * F1 , F3 = 4 * F1 , F4 = 22 * F1;
// F1 est la forme de base, F2 donne la contenance, F3 entre 2800 et 3200 donne le timbre
// N6ous remarquons que l'intensité pour garder l'équilibre avec la fréquence est très importante
// l'intensité se réglant dans la forme de la courbe plus haut
//ici fini la fin des données, il reste la forme de la courbe aussi modifiable, ou ajouter des ondes
// /**
while (B7 <= 1) //le temps est de 2 boucles
{
B1 = 0; //je remets ici les variables à 0 pour pouvoir
B2 = 0; // recommencer la boucle
B3 = 0;
B4 = 0;
B5 = 0;
B6 = 0;


B1 = 0;
while (B1 <= 200) //le temps de l'onde est 200 boucles
{
face1(F1, Dur2 , onde1); // onde F1 fixée au dessus
face2(F2, Dur2 , onde2);
face2(F3, Dur3 , onde3);
face4(F4, Dur3 , onde4);

B1 = B1 + 1;
B5 = (int) (B1%2) ;
if(B5 == 1)

{ F1 = F1 / ( F1 + 1 );
F2 = F2 / ( F2 + 1 );
F3 = F3 / ( F3 + 1 );
F4 = F4 / (F4 + 1 );

} // la variation en fréquence de l'onde est de
else
{ F1 = F1 / ( F1 - 1 );
F2 = F2 / ( F2 - 1 );
F3 = F3 / ( F3 - 1 );
F4 = F4 / ( F4 - 1 );
}
}

F1 = 500;
F2 = 1.5 * F1;

while (B4 <= 50)
{
face1(F1, Dur2 , onde1);
face2(F2, Dur2 , onde2);
B4 = B4 + 1;
F1 = F1 / ( F1 + 5 );
F2 = F2 / ( F2 + 5 );
}
while (B2 <= 50)
{
face1(F1, 3 , onde1);
face2(F2, 3 , onde2);
B2 = B2 + 1;
F1 = F1 / ( F1 + 5 );
F2 = F2 / ( F2 + 5 );
}
// */
// /**
F1 = 500;
F2 = 1.5 * F1;

while (B3 <= 200) // B3 sert à indiquer la durée de l'onde, combien de fois elle est répétée.
{
while (B6 <= 2){
face1(F1, Dur3 , onde1); //onde composée de trois ondes F1 F2 et F3
face2(F2, Dur3 , onde2);
face3(F3, Dur3 , onde3);

F1 = F1 / ( F1 - 2 );
F2 = F2 / ( F2 - 2 );
F3 = F3 / ( F3 - 2 );
B6 = B6 + 1;
} B5 = (int) (B3%2) ; //ici je fais varier l'onde d'une manière ondulatoire
if(B5 == 1)

{
F1 = F1 / ( F1 + 2 );
F2 = F2 / ( F2 + 2 );
F3 = F3 / ( F3 + 2 );


} // la variation en fréquence de l'onde est de
else
{ F1 = F1 / ( F1 - 2 );
F2 = F2 / ( F2 - 2 );
F3 = F3 / ( F3 - 2 );

}
B3 = B3 + 1;
}

B7 = B7 + 1;

}
// */
//*/
// deuxième partie je modifie mes fréquences et place des durée plus courtes

B1 = 0; //je remets ici les variables à 0 pour pouvoir
B2 = 0; // recommencer la boucle
B3 = 0;
B4 = 0;
B5 = 0;
B6 = 0;
Dur1 = 16;
F1 = 500;
F2 = F1 * F1;

while (B1 <= 100) //le temps de l'onde est 400 boucles
{
face1(F1, Dur1 , onde1); // onde F1 fixée au dessus
face2(F2, Dur1 , onde2);
face4(F3, Dur1 , onde4);
B1 = B1 + 1;
B5 = (int) (B1%2) ;
if(B5 == 1)

{ F1 = F1 / ( F1 + 4 );
F2 = F2 / ( F2 + 4 );
} // la variation en fréquence de l'onde est de
else
{F1 =F1 / ( F1 - 4 );
F2 = F2 / ( F2 - 4 );
}

}
// fin deuxième partie
//troisième partie
B3 = 0;


while (B3 <= 50) // B3 sert à indiquer la durée de l'onde, combien de fois elle est répétée.
{
B6 = 0;
while (B6 <= 2){
face1(F1, Dur1 , onde1); //onde composée de trois ondes F1 F2 et F3
face2(F2, Dur1 , onde2);
face3(F3, Dur1 , onde3);

F1 = F1 / ( F1 - 8 ); //ici je fais varier l'onde d'une manière continue
F2 = F2 / ( F2 - 8 );
F3 = F3 / ( F3 - 8 );
B6 = B6 + 1;
}
B5 = (int) (B3%2) ; //ici je fais varier l'onde d'une manière ondulatoire
if(B5 == 1)

{
F1 = F1 / ( F1 + 20 );
F2 = F2 / ( F2 + 20 );
F3 = F3 / ( F3 + 20 );


} // la variation en fréquence de l'onde est de
else
{ F1 = F1 / ( F1 - 20 );
F2 = F2 / ( F2 - 20 );
F3 = F3 / ( F3 - 20 );
}
B3 = B3 + 1;
}

// fin troisième partie

while (B1 <= 200) //le temps de l'onde est 200 boucles
{
face1(F1, Dur2 , onde1); // onde F1 fixée au dessus
face2(F2, Dur2 , onde2);
B1 = B1 + 1;
}

onde1.drain();
onde2.drain();
onde3.drain();
onde4.drain();

System.exit(0);
}

}

Analyseur de courbe

Le scrip est écrit en langage C
Il analyse la forme de chaque courbe ( sa vitesse )
et modélise leurs variations (variation de vitesse)
de maniere a pouvoir créer le fichier son au format son.jo
Le fichier son.jo est un fichier texte, qui est ensuite
encodé avec ma propre technique de maniere a le rendre
executable. Cet executable appel mon propre player
que j'ai créé aussi en langage C.
Cette application démontre mon hypothese sur le temps,
et remet en cause trente mille ans de sciences dogmatiques.
Démonstration sur google en recherchant 9temps

lecteur au format son.jo

modéliseur au format son.jo

filtre au format son.jo

imagine le synthétiseur vocale au format son.jo


Le lecteur est l'outil qui permet de tranformer le fichier texte "abadie.jo" en fichier audio compatible "joris.aiff" , pour l'utiliser il faut modifier les adresses qui sont actuellemnt celles de mon P.C "/home/josi/AbadieJoris/abadie.jo",

Le filtre sert à rendre les sons plus cristallin, plus pénétrant, et de plus réduit la taille des fichiers abadie.jo

Le modeliseur sert à identifier les sons rencontrés, bien qu'en l'affinant il puisse plus tard convertir n'importe quel fichier audio, le modeliseur a été créé pour de la reconnaissance vocale.

Imagine, le synthetiseur est le plus bel outil, c'est lui qui va permettre de lire les textes, de donner des informations issus de capteurs, comme une caméra ou un radar, ou bien même une reconnaissance de forme et en plus de créer des mélodies contenant des voix humaines.

Sonnerie de téléphone portable

sonnerie de téléphone créé au format son.jo

Banque audio au format abadie.jo

banque impure

banque pure

banque pour imagine

Réponse texte

Exemple

Enregistrement Audio