Esempio n. 1
0
        public string GetParam(int start, int length, double tempo, double basePitch = 0)
        {
            int        end  = Math.Min(start + length, this.pitchList.Count);
            int        pLen = this.getPointLength(length, tempo);
            int        i;
            double     multiple = pLen / length;
            List <int> points   = new List <int>();

            if (start >= 0 && end <= this.pitchList.Count)
            {
                for (i = 0; i < length; i++)
                {
                    if (this.pitchList[start + (int)(i * multiple)] == 0)
                    {
                        points.Add(Convert.ToInt32(basePitch * 10));
                    }
                    else
                    {
                        points.Add(Convert.ToInt32((this.pitchList[start + (int)(i * multiple)] - basePitch) * 10));
                    }
                }
                return(PitchParamUtils.Encode(points));
            }
            return(null);
        }
Esempio n. 2
0
        public void Append(string pitchData, int length, double basePitch = 0, int offset = 0)
        {
            List <int> points = PitchParamUtils.Decode(pitchData);

            this.Append(points, length, basePitch, offset);
            points = null;
        }