Beispiel #1
0
        private void AddOnsets(SongElements songElements)
        {
            SongPropertyValues onsetValues = new SongPropertyValues("Onsets");

            List <MyPoint> amplitudePoints = amplitudeDetection.Points;

            float[] onsets = onsetDetection.Onsets;

            int samplesNotUsed = 0;

            for (int i = 0; i < onsets.Length; i++)
            {
                if (samplesNotUsed > 0)
                {
                    samplesNotUsed--;
                    continue;
                }

                if (onsets[i] > 0.01f)
                {
                    songElements.AddSingleBeat(timePerSample * i, amplitudePoints[i].Y);

                    samplesNotUsed = 4;
                }
            }
        }
Beispiel #2
0
        public SongPropertyValues CreateSongPropertyValuesTest(int index)
        {
            FrequencyBand fb = heldNoteDetection.GetFrequencyBands()[index];

            SongPropertyValues spv = new SongPropertyValues("Freqband " + fb.LeftFrequencyMargin + " - " + fb.RightFrequencyMargin);

            spv.Points = new List <Util.MyPoint>(fb.Points);

            spv.Normalize();

            rectangularDetection.RectangulateSongPropertyValues(spv);

            return(spv);
        }
Beispiel #3
0
        private void debugButton1_Click(object sender, EventArgs e)
        {
            string fileDirectory = songFile.FileDirectory;

            float valueThreshold      = (float)Convert.ToDouble(debugTextBox4.Text);
            float maximumSquaredError = (float)Convert.ToDouble(debugTextBox5.Text);

            SongPropertyValues spv = SongAnalyzer.GetSongPropertyValues(fileDirectory,
                                                                        valueThreshold, maximumSquaredError);

            if (lastSeries != null)
            {
                songValueChart.Series.Remove(lastSeries);
            }

            PlotSPVTest(spv);

            Update();
        }
Beispiel #4
0
        private void PlotSPVTest(SongPropertyValues songPropertyValues)
        {
            Series series = new Series();

            series.Name = songPropertyValues.PropertyName + DateTime.Now.Millisecond;

            foreach (MyPoint point in songPropertyValues.Points)
            {
                series.Points.AddXY(point.X, point.Y);
            }

            series.ChartArea = "ChartArea1";

            series.ChartType = SeriesChartType.FastLine;

            series.BorderWidth = 2;

            songValueChart.Series.Add(series);

            lastSeries = series;
        }