System.Collections.Generic.List.Add(monophone)

Here are the examples of the csharp api System.Collections.Generic.List.Add(monophone) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 View Source File : xylorollSignalGenerator.cs
License : Apache License 2.0
Project Creator : googlearchive

public void spawnVoices(int n, float[] adsrVol, float[] adsrDur) {
    voices = new List<monophone>();

    samplerLoad _samplerLoad = GetComponentInChildren<samplerLoad>();
    _samplerLoad.players = new clipPlayer[n];

    for (int i = 0; i < n; i++) {
      voices.Add(new monophone(Instantiate(monophonicPrefab, transform, false) as GameObject));
      voices[i].adsr.durations = adsrDur;
      voices[i].adsr.volumes = adsrVol;
      _samplerLoad.players[i] = voices[i].sampler;
    }
  }

19 View Source File : xylorollSignalGenerator.cs
License : Apache License 2.0
Project Creator : googlearchive

public void setMonophone(int v, int ID) {

    if (ID == -1) {
      if (voices[v].adsr.sustaining) {
        voices[v].adsr.hit(false);
        voices[v].releasing = true;
        monophone m = voices[v];
        voices.RemoveAt(v);
        voices.Add(m);
      }

    } else {
      voices[v].curKey = ID;
      if (oscInput) voices[v].key.UpdateKey(ID);
      else {
        float mult = voices[v].key.getMult(ID);
        voices[v].sampler.Play(mult);
      }
      voices[v].adsr.hit(true);
      voices[v].releasing = false;
      monophone m = voices[v];
      voices.RemoveAt(v);
      voices.Add(m);
    }

  }