Wednesday, June 17, 2015

Audio Data from Genetic Code[For An Actual Purpose]

Right, so as I mentioned in the post on the Basic Audio Analysis tool I mentioned Hamming distances. I wrote the Audio Analysis tool because it could also be used with the VD genetics tools that I have been working on and describing at the linked location. Now the method I demonstrated is also useful for returning the Ham function back to the top of the program so to speak(so that it can be analyzed or cross analyzed) and to use the other functions as well, for instance the Ham of the Distance function of each waveform would be useful for a more accurate comparison of the two as it equalizes them using abs val.


And now we import the data:

Recall that the data is in the format of:


Unfortunately this post is more of a how to so far but, what the hell I guess they all are. Anyway now for how to do this with genetic data(still a How To, I suppose):

Just write a good old formula( probably 20 or 4 depending on whether you are messing with Aminos or Nucleics. Lets do nucleics for simplicity:

rtf.Text=
"a
c
t
g
g
t
c
a
c
g
t
a
g
c
a
t"
'you can use an array or manually add in the \n via replace(all,any,any +\n)
'now I mention the above comment because if using the aminos the vals will be over double digits and thus
'the lines must be used or commas or colons or # or % or &(you get the idea hopefully)
rtf.Text=Replace(rtf.Text,"a","1")
rtf.Text=Replace(rtf.Text,"g","2")
rtf.Text=Replace(rtf.Text,"c","3")
rtf.Text=Replace(rtf.Text,"t","4")
'note that base pairs add to 5, just an easy checking method for later more complex operations which are profitable financially and thus will not be blogged about
Now these are numbers so just run the audacity operation on them export as a .wav file, and then run through the program. There you go, audio from genetic data and you can calculate Hamm(kinda) and perform other useful operations on the data. Cheers!

UniPirate: Downloading and Sorting Big Data(Protein Database)

I started to download more of the protein codes, but rather than make a regex script to mess with them after(delete HTML, JS, and bank data) I decided to just use regex while the file is in the prog RAM(ha) and delete it then using Replace(string,"X","Y").

Here I am just checking the packets from the server in the background (to look for the signatures of this mess:
which appears when the p# or http://www.(baseurl)/P99314 does not exist in the data base, it has a distinct error code in the html though note <title>Error</title> so, a

if(WebBrowser.DocumentText.Contains("Error")=True){
main()
}

is a simple way to just jump over empty slots. The database is so huge that we really don't need to systematically go through, in fact the empty slots are not all at large numbers they appear to vary throughout, and a shotgun blast(i.e. bad aim, through a random number generator) is the easisest method as it contains the fairest distribution from multiple organism types. See downloading the .fasta provides this info along with some other information about the string:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY><PRE>&gt;sp|P42889|COL_MYOCO Colipase OS=Myocastor coypus GN=CLPS PE=1 SV=1
MEKVLALVLLTLAVAYAAPDPRGLIINLDNGELCLNSAQCKSQCCQHDSPLGLARCADKA
RENSGCSPQTIYGIYYLCPCERGLTCDGDKSIIGAITNTNYGICQDPQSKK
</PRE></BODY></HTML>

So basically we have to remove all this nonsense(the Html to begin with) which is simple enough.

       
        rtf.Text = Replace(rtf.Text, "bothersometext", "")
so on and so forth for whatever might be in the way. Then we need to organize them based on animal, super easy, the likely hood of the genetic code spelling MOUSE, is pretty low there are some 20 amino acids so that's .05^5 or about 0.00000003125,and since probabilities don't really matter since it doesn't limit it from happening, just take my word that it is unlikely(the strings are small too so each time is a new instance so it is really unlikely). Now you can avoid this problem all together if you set the Regex(this is default in vb,C# etc) so that capitalization is ignored as the majority of the OS names(organism) are spelt like:

Mouse
Human

and ussually latin names are included so you can really cover your bases if you like or truly guarantee by using a different alphabet and by that I mean numbers(the organism identifier number string).


In order to sort the files:



Now for performance, it may be best to take each findstr instance and use it as its own separate program or process so as to maximize distribution over the multiple cores of the cpu. It truly depends on the list of OS's and the size of the data.

I will be writing up a renaming program at some point so that:

|P42889|COL_MYOCO Colipase OS=Myocastor coypus GN=CLPS PE=1 SV=1
MEKVLALVLLTLAVAYAAPDPRGLIINLDNGELCLNSAQCKSQCCQHDSPLGLARCADKA
RENSGCSPQTIYGIYYLCPCERGLTCDGDKSIIGAITNTNYGICQDPQSKK

is saved as Colipase in C:\Myocastor_coypus ( the latter of the two operations is already performed by doghunter.bat which is the program shown above in the Gvim window.



Oh, and to answer questions before they present themselves. Yes, the operation above is a copy operation and not a cut. I do this so as to preserve originals of the files to have a fall back in case something goes terrible wrong <program|original|end> is better than <download|program|original> and then an<program|original|end>. Just for safety, good practice when working with a database the size of all the proteins ever sequenced and publicly stored.

Basic Audio Forensic Analysis Program

During a talent show at school I tried my hand at rapping and during a speed rap section the camera sampling rate blended words and an innocent and rather clever phrase was picked up as something entirely different(Yes I rapped).

Having another recording from an alternate source I set out to prove that there was a significant difference between the two recordings the reason however I would leave up to them, though in a coming post I think I'll make a digital forensics package(for files that is). Anywho lets get to it:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AudioAnalysis
{
    public partial class Form1 : Form
    {
        public Form1()
        {
           // reader2.Text = track0.Value.ToString();
                     InitializeComponent();
        }

        private void openWaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
            OpenFileDialog open = new OpenFileDialog();
            open.Filter = "Wave File (*.wav)|*.wav;";
            if (open.ShowDialog() != DialogResult.OK) return;

            waveViewer1.SamplesPerPixel = 450;
            waveViewer1.WaveStream = new NAudio.Wave.WaveFileReader(open.FileName);
            

            chart1.Series.Add("wave");
            chart1.Series["wave"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
            chart1.Series["wave"].ChartArea = "ChartArea1";

            NAudio.Wave.WaveChannel32 wave = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(open.FileName));

            byte[] buffer = new byte[track.Value];
            int read = 0;

            while (wave.Position < track.Value)
            {
                read = wave.Read(buffer, 0, track.Value);

                for (int i = track0.Value; i < read / 4; i++)
                {
                    chart1.Series["wave"].Points.Add(BitConverter.ToSingle(buffer, i * 4));
                    string stringy = (10*BitConverter.ToSingle(buffer, i * 4)).ToString();
                    outsalot.AppendText(stringy + "\n");
                    bar.Value = i;
                    if (bar.Value == bar.Maximum-1) { bar.Value = 0; }
                }
            }
        }

        private void readout_TextChanged(object sender, EventArgs e)
        {
            track.Value = Int32.Parse(readout.Text);
        }

        private void track_Scroll(object sender, EventArgs e)
        {
            readout.Text = track.Value.ToString();
            bar.Maximum = track.Value/4;
        }

        private void chart1_Click(object sender, EventArgs e)
        {

        }

        private void logToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
        }

        private void track0_Scroll(object sender, EventArgs e)
        {

            reader2.Text = track0.Value.ToString();
           
        }

        private void reader2_TextChanged(object sender, EventArgs e)
        {
            track0.Value = Int32.Parse(reader2.Text);

            
        }

        private void hAMToolStripMenuItem_Click(object sender, EventArgs e)
        {

            for (int vxl = 0; vxl < outsalot.Lines.Length-5; vxl = vxl + 1)
            {
               string hamm = (float.Parse(outsalot.Lines[vxl]) - float.Parse(outsytwo.Lines[vxl])).ToString();
               hamming.Text = hamming.Text + hamm+"\n";
               bar.Maximum = outsalot.Lines.Length - 5;
               bar.Value = vxl;
               if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }
        

            }
        
        }

        private void move_Click(object sender, EventArgs e)
        {
            outsytwo.Text = outsalot.Text;
                outsalot.ResetText();
                chart1.Series.Clear();
        }

        private void diracΔToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
            for (int vxl = 0; vxl < outsalot.Lines.Length ; vxl = vxl + 1)
            {
                string hamm = ((float.Parse(outsalot.Lines[vxl]) - Int32.Parse(outsytwo.Lines[vxl]))/Math.Abs((float.Parse(outsalot.Lines[vxl]) - Int32.Parse(outsytwo.Lines[vxl])))).ToString();
             
                hamming.Text = hamming.Text + hamm + "\n";
                bar.Maximum = outsalot.Lines.Length;
                bar.Value = vxl;
                if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }


            }
        }

        private void differenceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            for (int vxl = 0; vxl < outsalot.Lines.Length-1; vxl = vxl + 1)
            {
                string one = ((float.Parse(outsalot.Lines[vxl]) - float.Parse(outsalot.Lines[vxl+1]))) .ToString();
                

                hamming.Text = hamming.Text + one + "\n";
                bar.Maximum = outsalot.Lines.Length;
                bar.Value = vxl;
                if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }


            }
            outsalot.Text=hamming.Text;
            hamming.Text="";
                        for (int vxl = 0; vxl < outsalot.Lines.Length-1; vxl = vxl + 1)
            {
                string two = ((float.Parse(outsytwo.Lines[vxl]) - float.Parse(outsytwo.Lines[vxl + 1]))).ToString();
                

                hamming.Text = hamming.Text + two+ "\n";
               
                bar.Maximum = outsytwo.Lines.Length;
                bar.Value = vxl;
                if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }


            }
             outsytwo.Text=hamming.Text;
             hamming.Text = "";
        }

        private void hamming_TextChanged(object sender, EventArgs e)
        {
            hamming.Text = hamming.Text.Replace("NaN", "0");
        }
        }
        }

So the basic idea was to load the audio, split db and pitch into to sections(which is why I switched to the MS Studio C# collection as it has this lib function built in. Simple from here, we just break this down into text and output to two textboxes:

Sure, yeah, I could easily have used two strings to hold the data but the text box will come in handy later and it is useful for later running through the data and selecting rows. So we want to calculate the Hamming Distance so, made a File>HAM, option:

        private void hAMToolStripMenuItem_Click(object sender, EventArgs e)
        {

            for (int vxl = 0; vxl < outsalot.Lines.Length-5; vxl = vxl + 1)
            {
               string hamm = (float.Parse(outsalot.Lines[vxl]) - float.Parse(outsytwo.Lines[vxl])).ToString();
               hamming.Text = hamming.Text + hamm+"\n";
               bar.Maximum = outsalot.Lines.Length - 5;
               bar.Value = vxl;
               if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }
        

            }
        
        }

which really just subtracts the two waveforms. How? well you need to open the two separate waveforms which is where the empty white textbox and the [Move] <button> come into play. Press the move button, open the second wave form and calculate the HAM.(Again File>HAM though hopefully you recall).

Also I should point out, I did not take the time to fix the scrolling bars at the top(these select how much of the WaveForm(.wav) files you wish to analyse. So what you need to do before even opening the first WAV is to move these around until numbers appear in the text box(I recommend 0 left and 16384 right, and just cut the audio so that they are in the same place on something like audacity). Now about what I just said about cutting them to the same place. You don't really need to. To check for changes that are not Amplitudinal(new word) then this is just a quick mathematical operation on the Hammed functions(not the difference of the WAV's). If the difference between each can be attributed to a multiplicative factor ie our strings are:

363693639
121231213

Then we can say that the only difference is caused by an audio gain function, whose multiplier is 3.

The DiracΔ function starts to hit on that:

        private void diracΔToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
            for (int vxl = 0; vxl < outsalot.Lines.Length ; vxl = vxl + 1)
            {
                string hamm = ((float.Parse(outsalot.Lines[vxl]) - Int32.Parse(outsytwo.Lines[vxl]))/Math.Abs((float.Parse(outsalot.Lines[vxl]) - Int32.Parse(outsytwo.Lines[vxl])))).ToString();
             
                hamming.Text = hamming.Text + hamm + "\n";
                bar.Maximum = outsalot.Lines.Length;
                bar.Value = vxl;
                if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }


            }
        }
It takes the vals, subtracts and divides by the absolute in order to work with multiplicatives. Does this have anything to do with DiracΔ functions. Not really I was just playing on the fact that the entire issue(dispute) is probably due to the lower sampling rate of the microphones used by the aggressors. 

Now the difference function( FILE>Difference), wait hold up, here is a pic of the menu for refs:
Right, and here is the code for Difference:

 private void differenceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            for (int vxl = 0; vxl < outsalot.Lines.Length-1; vxl = vxl + 1)
            {
                string one = ((float.Parse(outsalot.Lines[vxl]) - float.Parse(outsalot.Lines[vxl+1]))) .ToString();
                

                hamming.Text = hamming.Text + one + "\n";
                bar.Maximum = outsalot.Lines.Length;
                bar.Value = vxl;
                if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }


            }
            outsalot.Text=hamming.Text;
            hamming.Text="";
                        for (int vxl = 0; vxl < outsalot.Lines.Length-1; vxl = vxl + 1)
            {
                string two = ((float.Parse(outsytwo.Lines[vxl]) - float.Parse(outsytwo.Lines[vxl + 1]))).ToString();
                

                hamming.Text = hamming.Text + two+ "\n";
               
                bar.Maximum = outsytwo.Lines.Length;
                bar.Value = vxl;
                if (bar.Value == outsalot.Lines.Length - 10) { bar.Value = 0; }


            }
             outsytwo.Text=hamming.Text;
             hamming.Text = "";
        }
Difference differs(ha) from the other functions in that it works or acts upon only one waveform(at a time and we could run Difference on the Hamming distance function of the two waveforms). It subtracts element [x] from element [x+1] all the way to [(max(x)-1)-(max(x)-2)], the reason being that the differences between successive elements should be the same in each waveform if they have not been tampered with and there is not too many confounding variables from outside sources(audience etc).

Now I ussually do not write up the code for the visuals but in this case it is useful as I did utilize a split container to hold everything. You can delete the db graph(top one) as it does nothing for us(volume is not entirely useful when we are talking about vocal modification, although we can sort of use it to mess with the difference functions we talked about earlier as I described them in terms of db and not pitch though they are currently programmed to work on pitch. To work on db you need to convert arrays to txt \n format).

namespace AudioAnalysis
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.openWaveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.hAMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.diracΔToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.differenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.logToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.move = new System.Windows.Forms.Button();
            this.outsalot = new System.Windows.Forms.RichTextBox();
            this.waveViewer1 = new NAudio.Gui.WaveViewer();
            this.hamming = new System.Windows.Forms.RichTextBox();
            this.outsytwo = new System.Windows.Forms.RichTextBox();
            this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
            this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
            this.track = new System.Windows.Forms.TrackBar();
            this.readout = new System.Windows.Forms.TextBox();
            this.bar = new System.Windows.Forms.ProgressBar();
            this.track0 = new System.Windows.Forms.TrackBar();
            this.reader2 = new System.Windows.Forms.TextBox();
            this.menuStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.track)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.track0)).BeginInit();
            this.SuspendLayout();
            // 
            // menuStrip1
            // 
            this.menuStrip1.BackColor = System.Drawing.Color.WhiteSmoke;
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem,
            this.logToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(1091, 24);
            this.menuStrip1.TabIndex = 0;
            this.menuStrip1.Text = "menuStrip1";
            // 
            // fileToolStripMenuItem
            // 
            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openWaveToolStripMenuItem,
            this.hAMToolStripMenuItem,
            this.diracΔToolStripMenuItem,
            this.differenceToolStripMenuItem});
            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
            this.fileToolStripMenuItem.Text = "File";
            // 
            // openWaveToolStripMenuItem
            // 
            this.openWaveToolStripMenuItem.Name = "openWaveToolStripMenuItem";
            this.openWaveToolStripMenuItem.Size = new System.Drawing.Size(135, 22);
            this.openWaveToolStripMenuItem.Text = "Open Wave";
            this.openWaveToolStripMenuItem.Click += new System.EventHandler(this.openWaveToolStripMenuItem_Click);
            // 
            // hAMToolStripMenuItem
            // 
            this.hAMToolStripMenuItem.Name = "hAMToolStripMenuItem";
            this.hAMToolStripMenuItem.Size = new System.Drawing.Size(135, 22);
            this.hAMToolStripMenuItem.Text = "HAM";
            this.hAMToolStripMenuItem.Click += new System.EventHandler(this.hAMToolStripMenuItem_Click);
            // 
            // diracΔToolStripMenuItem
            // 
            this.diracΔToolStripMenuItem.Name = "diracΔToolStripMenuItem";
            this.diracΔToolStripMenuItem.Size = new System.Drawing.Size(135, 22);
            this.diracΔToolStripMenuItem.Text = "DiracΔ";
            this.diracΔToolStripMenuItem.Click += new System.EventHandler(this.diracΔToolStripMenuItem_Click);
            // 
            // differenceToolStripMenuItem
            // 
            this.differenceToolStripMenuItem.Name = "differenceToolStripMenuItem";
            this.differenceToolStripMenuItem.Size = new System.Drawing.Size(135, 22);
            this.differenceToolStripMenuItem.Text = "Difference";
            this.differenceToolStripMenuItem.Click += new System.EventHandler(this.differenceToolStripMenuItem_Click);
            // 
            // logToolStripMenuItem
            // 
            this.logToolStripMenuItem.Name = "logToolStripMenuItem";
            this.logToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
            this.logToolStripMenuItem.Text = "Log";
            this.logToolStripMenuItem.Click += new System.EventHandler(this.logToolStripMenuItem_Click);
            // 
            // splitContainer1
            // 
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 24);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.move);
            this.splitContainer1.Panel1.Controls.Add(this.outsalot);
            this.splitContainer1.Panel1.Controls.Add(this.waveViewer1);
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.Controls.Add(this.hamming);
            this.splitContainer1.Panel2.Controls.Add(this.outsytwo);
            this.splitContainer1.Panel2.Controls.Add(this.chart1);
            this.splitContainer1.Size = new System.Drawing.Size(1091, 461);
            this.splitContainer1.SplitterDistance = 227;
            this.splitContainer1.TabIndex = 1;
            // 
            // move
            // 
            this.move.Location = new System.Drawing.Point(926, 180);
            this.move.Name = "move";
            this.move.Size = new System.Drawing.Size(153, 23);
            this.move.TabIndex = 2;
            this.move.Text = "Move";
            this.move.UseVisualStyleBackColor = true;
            this.move.Click += new System.EventHandler(this.move_Click);
            // 
            // outsalot
            // 
            this.outsalot.Location = new System.Drawing.Point(926, 3);
            this.outsalot.Name = "outsalot";
            this.outsalot.Size = new System.Drawing.Size(153, 174);
            this.outsalot.TabIndex = 1;
            this.outsalot.Text = "";
            // 
            // waveViewer1
            // 
            this.waveViewer1.Location = new System.Drawing.Point(0, 6);
            this.waveViewer1.Name = "waveViewer1";
            this.waveViewer1.SamplesPerPixel = 128;
            this.waveViewer1.Size = new System.Drawing.Size(920, 195);
            this.waveViewer1.StartPosition = ((long)(0));
            this.waveViewer1.TabIndex = 0;
            this.waveViewer1.WaveStream = null;
            // 
            // hamming
            // 
            this.hamming.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
            this.hamming.ForeColor = System.Drawing.SystemColors.Menu;
            this.hamming.Location = new System.Drawing.Point(788, 4);
            this.hamming.Name = "hamming";
            this.hamming.Size = new System.Drawing.Size(132, 213);
            this.hamming.TabIndex = 2;
            this.hamming.Text = "";
            this.hamming.TextChanged += new System.EventHandler(this.hamming_TextChanged);
            // 
            // outsytwo
            // 
            this.outsytwo.Location = new System.Drawing.Point(926, 4);
            this.outsytwo.Name = "outsytwo";
            this.outsytwo.Size = new System.Drawing.Size(162, 213);
            this.outsytwo.TabIndex = 1;
            this.outsytwo.Text = "";
            // 
            // chart1
            // 
            chartArea1.Name = "ChartArea1";
            this.chart1.ChartAreas.Add(chartArea1);
            this.chart1.Location = new System.Drawing.Point(0, 0);
            this.chart1.Name = "chart1";
            this.chart1.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.EarthTones;
            this.chart1.Size = new System.Drawing.Size(782, 201);
            this.chart1.TabIndex = 0;
            this.chart1.Text = "chart1";
            this.chart1.Click += new System.EventHandler(this.chart1_Click);
            // 
            // track
            // 
            this.track.Location = new System.Drawing.Point(519, 0);
            this.track.Maximum = 16384;
            this.track.Name = "track";
            this.track.Size = new System.Drawing.Size(303, 45);
            this.track.TabIndex = 1;
            this.track.Value = 16384;
            this.track.Scroll += new System.EventHandler(this.track_Scroll);
            // 
            // readout
            // 
            this.readout.BackColor = System.Drawing.SystemColors.HotTrack;
            this.readout.ForeColor = System.Drawing.SystemColors.Menu;
            this.readout.Location = new System.Drawing.Point(464, 4);
            this.readout.Name = "readout";
            this.readout.Size = new System.Drawing.Size(49, 20);
            this.readout.TabIndex = 2;
            this.readout.TextChanged += new System.EventHandler(this.readout_TextChanged);
            // 
            // bar
            // 
            this.bar.Location = new System.Drawing.Point(816, 0);
            this.bar.Name = "bar";
            this.bar.Size = new System.Drawing.Size(272, 23);
            this.bar.TabIndex = 3;
            // 
            // track0
            // 
            this.track0.BackColor = System.Drawing.SystemColors.Control;
            this.track0.Location = new System.Drawing.Point(82, -2);
            this.track0.Maximum = 16384;
            this.track0.Name = "track0";
            this.track0.Size = new System.Drawing.Size(303, 45);
            this.track0.TabIndex = 4;
            this.track0.Scroll += new System.EventHandler(this.track0_Scroll);
            // 
            // reader2
            // 
            this.reader2.BackColor = System.Drawing.Color.Maroon;
            this.reader2.ForeColor = System.Drawing.SystemColors.Menu;
            this.reader2.Location = new System.Drawing.Point(388, 4);
            this.reader2.Name = "reader2";
            this.reader2.Size = new System.Drawing.Size(49, 20);
            this.reader2.TabIndex = 5;
            this.reader2.TextChanged += new System.EventHandler(this.reader2_TextChanged);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1091, 485);
            this.Controls.Add(this.reader2);
            this.Controls.Add(this.track0);
            this.Controls.Add(this.bar);
            this.Controls.Add(this.readout);
            this.Controls.Add(this.track);
            this.Controls.Add(this.splitContainer1);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "Form1";
            this.Text = "AudioAnalysis";
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.track)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.track0)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem openWaveToolStripMenuItem;
        private System.Windows.Forms.SplitContainer splitContainer1;
        private NAudio.Gui.WaveViewer waveViewer1;
        private System.Windows.Forms.DataVisualization.Charting.Chart chart1;
        private System.Windows.Forms.ToolStripMenuItem logToolStripMenuItem;
        private System.Windows.Forms.BindingSource bindingSource1;
        private System.Windows.Forms.TrackBar track;
        private System.Windows.Forms.TextBox readout;
        private System.Windows.Forms.RichTextBox outsalot;
        private System.Windows.Forms.ProgressBar bar;
        private System.Windows.Forms.RichTextBox outsytwo;
        private System.Windows.Forms.TrackBar track0;
        private System.Windows.Forms.TextBox reader2;
        private System.Windows.Forms.ToolStripMenuItem hAMToolStripMenuItem;
        private System.Windows.Forms.RichTextBox hamming;
        private System.Windows.Forms.Button move;
        private System.Windows.Forms.ToolStripMenuItem diracΔToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem differenceToolStripMenuItem;
    }
}

Faster Taskkill 4 Windows

Came back from vacation computer was running slow wrote up a quick fix for closing processes after being annoyed by having to constantly type: taskkill /im %progname%.exe -f.

@echo off
goto check_Permissions

:check_Permissions
    echo Administrative permissions required for some operations. checking permissions
echo ..
echo ...
echo ....
echo ............

    net session >nul 2>&1
    if %errorLevel% == 0 (
        echo Administrative methods enabled.
    ) else (
        echo Permissions inadequate for closing restricted progs.
    )
echo continue?
    pause
@echo off
echo type 46692 to exit without a mouse
echo continue?
pause
@echo off
:A
Color 0F
tasklist
color 0E
set /p progn=prog:
IF %progn% EQU 46692 goto B
taskkill /im %progn%.exe -f
pause
goto A
:B
exit
Now that I have returned the posts should be more diverse than just MuBox stuff, was using those while I was gone.