public IGang GetBassSequence(int bars) { IGang[] result = new IGang[bars * timeSig.BeatsPerBar + 1]; result [0] = new InstrumentChange(Instrument.ElectricBassFinger); for (int i = 1; i < result.Length; i++) { result [i] = new Note(p [rand.Next(3)], .25, 100); } return(new ChainGang(result)); }
private byte[] ProcessMinion(IMinion minion) { if (minion is NoteStart) { int Channel = 0; NoteStart m = minion as NoteStart; return(new byte[] { (byte)(Control.NoteOn + Channel), (byte)m.NotePitch, (byte)m.Velocity }); } else if (minion is NoteEnd) { int Channel = 0; NoteEnd m = minion as NoteEnd; return(new byte[] { (byte)(Control.NoteOff + Channel), (byte)m.NotePitch, 0 }); } else if (minion is DrumStart) { int Channel = 9; DrumStart m = minion as DrumStart; return(new byte[] { (byte)(Control.NoteOn + Channel), (byte)(35 + m.DrumPitch), (byte)m.Velocity }); } else if (minion is DrumEnd) { int Channel = 9; DrumEnd m = minion as DrumEnd; return(new byte[] { (byte)(Control.NoteOff + Channel), (byte)(35 + m.DrumPitch), 0 }); } else if (minion is InstrumentChange) { int Channel = 0; InstrumentChange m = minion as InstrumentChange; return(new byte[] { (byte)(Control.Program + Channel), (byte)m.NewInstrument, 0 }); } else if (minion is NoOp) { return(null); } throw new InvalidOperationException("Minion not recognised for processing: " + minion); }