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(); }
void _DispatchTimer_Tick(object sender, EventArgs e) { SoundWaves.ForEach(x => { if (x.HasNextValue()) { x.NextValue(); } }); }
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; }