Exemplo n.º 1
0
 public DrumPatternSampleProvider(DrumPattern pattern)
 {
     var kit = new DrumKit();
     this.sequencer = new PatternSequencer(pattern, kit);
     this.waveFormat = kit.WaveFormat;
     mixer = new MixingSampleProvider(waveFormat);
 }
Exemplo n.º 2
0
 public PatternSequencer(DrumPattern drumPattern, DrumKit kit)
 {
     this.drumKit = kit;
     this.drumPattern = drumPattern;
     this.Tempo = 120;
     this.pitch = new int[BeatMaker.noteNum, drumPattern.Steps];
     for (int i = 0; i < BeatMaker.noteNum; i++)
     {
         for (int j = 0; j < drumPattern.Steps; j++)
         {
             this.pitch[i, j] = 4;
         }
     }
 }
Exemplo n.º 3
0
        public BeatMaker()
        {
            InitializeComponent();

            Menu.sync(this);

            MultitouchScreen.AllowNonContactEvents = true;
            //clipIndices = new List<int>();
            //clipIndices.Add(0); clipIndices.Add(1); clipIndices.Add(2); clipIndices.Add(3);
            spaceProvider = new InteractiveSpaceProviderDLL();
            spaceProvider.Connect();
            drumBeats = new Boolean[notes.Length][];
            chosenClips = new int[] {(int)noteName.Kick, (int)noteName.Snare, (int)noteName.ClosedHat, (int)noteName.OpenHat};

            //create an boolean array for each sample
            for (int i = 0; i < notes.Length; i++)
            {
                Boolean[] newArray = new Boolean[MAX_BEATS];
                //make all values false
                for (int j = 0; j < MAX_BEATS; j++)
                {
                    newArray[j] = false;
                }
                drumBeats[i] = newArray;
            }
            for (int i = 8; i < notes.Length; i++)
            {
                Boolean[] newArray = new Boolean[MAX_BEATS];
                //make all values false
                for (int j = 0; j < MAX_BEATS; j++)
                {
                    newArray[j] = false;
                }
                drumBeats[i] = newArray;
            }

            pattern = new DrumPattern(notes, MAX_BEATS);
            this.tempoController = tempoCtrl;
            this.pitchController = pitchCtrl;
            this.pitchController.reloadState();

            //16 beat stuff
            //this.pattern[0, 0] = this.pattern[0, 8] = 127;
            //this.pattern[1, 4] = this.pattern[1, 12] = 127;
            //for (int n = 0; n < pattern.Steps; n++)
            //{
                //this.pattern[2, n] = 127;
            //}

            instrumentButtonArr[0] = clipSelectButton0;
            instrumentButtonArr[1] = clipSelectButton1;
            instrumentButtonArr[2] = clipSelectButton2;
            instrumentButtonArr[3] = clipSelectButton3;

            beatButtonArr[0] = beatButton1;
            beatButtonArr[1] = beatButton2;
            beatButtonArr[2] = beatButton3;
            beatButtonArr[3] = beatButton4;
            beatButtonArr[4] = beatButton5;
            beatButtonArr[5] = beatButton6;
            beatButtonArr[6] = beatButton7;
            beatButtonArr[7] = beatButton8;

            updateSelectedClips();
            //this.tempo = 100;
            //Uncomment these lines to draw fingers on the projected screen
            //spaceProvider.CreateFingerTracker();
            //vizLayer.SpaceProvider = spaceProvider;
        }