コード例 #1
0
            public ProfilEnveloppe(List <ProfilEnveloppe> profils)
            {
                nbEchant   = profils.Sum(e => e.nbEchant);
                intensites = new double[nbEchant];
                int k = 0;

                for (int i = 0; i < profils.Count; i++)
                {
                    ProfilEnveloppe pr = profils.ElementAt(i);
                    for (int j = 0; j < pr.nbEchant; j++)
                    {
                        intensites[k] = pr.GetIntensite(j);
                        k++;
                    }
                }
            }
コード例 #2
0
        static void Main(string[] args)
        {
            Random    r   = new Random();
            Enveloppe env = new Enveloppe(ProfilEnveloppe.Cos(0, 1, 20000), new ProfilEnveloppe(new List <ProfilEnveloppe>(2)
            {
                ProfilEnveloppe.Cos(1, 0.5, 6000), ProfilEnveloppe.Cos(0.5, 1, 9000)
            }), ProfilEnveloppe.Cos(1, 0, 30000));
            ProfilHarmoniques ph       = ProfilHarmoniques.Alea(ref r, 3);
            Instrument        flutador = new Instrument(env, ph, 220, 0.8);

            double[] do_  = flutador.Jouer(4, 0, 44100, 0);
            string   path = "D:/lab/musik/clair.txt";
            //DoubleToFile(k, path+".raw");
            //VersWav(44100, path + "test.wav", do_);
            Orchestre orch = new Orchestre(new Instrument[] { flutador });
            Musique   mc   = new Musique(44100, orch, Note.McFromFile(path));

            VersWav(44100, path + ".musique.wav", mc.Jouer());
        }
コード例 #3
0
 public Enveloppe(ProfilEnveloppe attaque, ProfilEnveloppe courant, ProfilEnveloppe fin)
 {
     this.attaque = attaque;
     this.courant = courant;
     this.fin     = fin;
 }