// set everything up public BonIverStemPlayer(Engine.Engine engine) { mixer.AutoStop = false; waveOutDevice.Init(mixer); Engine = engine; // load in each of our files reader[0] = new WaveFileReader(@"C:\\Users\\Badger\\repos\\balloon\\SkeletalTracking\\boniver\\bangorkook.wav"); reader[1] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\chippewa_falls.wav"); reader[2] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\eleva.wav"); reader[3] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\gilman.wav"); reader[4] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\grand_rapids.wav"); reader[5] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\heigh_on.wav"); reader[6] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\lake_hallie.wav"); reader[7] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\le_grange_wi.wav"); reader[8] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\long_plain.wav"); reader[9] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\mandolin_wa.wav"); reader[10] = new WaveFileReader(@"C:\Users\Badger\repos\balloon\SkeletalTracking\boniver\virginia.wav"); // set the starting positions // and load into the mixer for (int i = 0; i < 11; i++) { channelStream[i] = new WaveChannel32(reader[i]); channelStream[i].Position = 0; mixer.AddInputStream(channelStream[i]); } }
/// <summary> /// Just generate a cloud of points within the given sphere /// </summary> /// <param name="engine"></param> public static void GenerateAFuckTonneOfCubes(Engine.Engine engine, ChannelAndInstrument ci, Note scaleNote, int numberOfCubes, Point3D point, double radius, double cubeRadius) { Scale scale = new Scale(scaleNote, Scale.Major); Random random = new Random(); OutputDevice device = OutputDevice.InstalledDevices[0]; Channel channel = ci.Channel; Instrument instrument = ci.Instrument; int rootOctave = 3; int thisOctave = rootOctave; for (int i = 0; i < numberOfCubes; i++) { double x = point.X + (random.NextDouble() - 0.5) * radius; double y = point.Y + (random.NextDouble() - 0.5) * radius; double z = point.Z + (random.NextDouble() - 0.5) * radius; Point3D cubePoint = new Point3D(x * radius, y * radius, z * radius); Pitch thisPitch; // limit it to 3 octaves if (i % 21 == 0) thisOctave = rootOctave; thisPitch = scale.NoteSequence[i % 7].PitchInOctave(thisOctave); // increment the octave if we have run out of notes if (i % 7 == 0) thisOctave++; SingleNoteCube a = new Cubes.SingleNoteCube(cubePoint, cubeRadius, thisPitch, instrument, App.OutputDevice, channel); engine.AddCube(a); } }