Exemplo n.º 1
0
    public SoundSource(int x, int y, float period, float amplitude, float initialPhase, Vector2[] partialDirections, float[,] cells, SoundSource mainSource, SoundWaves soundWaves)
    {
        this.x                 = x;
        this.y                 = y;
        this.period            = period;
        this.amplitude         = amplitude;
        this.initialPhase      = initialPhase;
        this.partialDirections = partialDirections;
        this.cells             = cells;
        this.mainSource        = mainSource;
        this.soundWaves        = soundWaves;

        omega = 2 * Mathf.PI / period;

        particles = new List <Particle> [soundWaves.height, soundWaves.width];
        for (int i = 0; i < soundWaves.height; i++)
        {
            for (int j = 0; j < soundWaves.width; j++)
            {
                particles[i, j] = new List <Particle>();
            }
        }

        velocityField = new Vector2[soundWaves.height, soundWaves.width];
        updateVelocityField();
    }
Exemplo n.º 2
0
 void _DispatchTimer_Tick(object sender, EventArgs e)
 {
     SoundWaves.ForEach(x => {
         if (x.HasNextValue())
         {
             x.NextValue();
         }
     });
 }
Exemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();

            deviceSound = new Microsoft.DirectX.DirectSound.Device();
            deviceSound.SetCooperativeLevel(Handle, CooperativeLevel.Priority);
            soundWaves = new SoundWaves(deviceSound);

            imgHoltz.Visible = true;
            imgVas.Visible   = false;
            currentModel     = Model.Holtz;
        }