sound.spectrogram
Class NoteEvent

java.lang.Object
  extended by sound.spectrogram.NoteEvent

public class NoteEvent
extends java.lang.Object

Copyright 2005, DocJava, Inc. User: dlyon Date: Nov 13, 2006 Time: 7:48:29 PM


Constructor Summary
NoteEvent()
           
NoteEvent(double[] audio)
           
 
Method Summary
 double[] characterizeNoise(double fractionalPartOfN)
          Enter in the first n samples that contain noise;
 void checkInputSignal(double[] audioData, double avgPower)
           
 void computeNoteNumber()
          This method will use the audio sample to compute the midi note number;
static double[] get10StrongestHarmonicsTimes(double[] psd, int offset)
           
 double[] getAudioData()
           
 double getAveragePower(double[] audioData)
           
 NoteEvent getNoteEvent(double fractionalPartOfN)
           
 NoteEvent getNoteEvent(double startTimeInSeconds, double endTimeInSeconds)
          get a Sub-noteEvent.
 NoteEvent getNoteEvent(int start, int n)
          get a Sub-noteEvent.
 NoteEvent[] getNoteEvents()
           
 NoteEvent[] getNoteEvents2()
           
static int[] getNStrongestFrequencies(double[] psd, int numberOfHarmonics)
           
static int[] getNStrongestHarmonicLocations(double[] psd, int numberOfHarmonics)
           
static double[] getNStrongestHarmonics(double[] psd, int numberOfHarmonics)
           
 double[] getPsdNormalized()
          Copy internal array, do not corrupt data.
 boolean isNoise(NoteEvent ne)
           
 void lyonWindowNoteEvent()
           
static void main(java.lang.String[] args)
           
 void openSoundFile()
           
 void playSample()
           
 void saveDouble()
           
 void showFFT(java.lang.String title)
           
 void showFile()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoteEvent

public NoteEvent(double[] audio)

NoteEvent

public NoteEvent()
Method Detail

saveDouble

public void saveDouble()

getAudioData

public double[] getAudioData()

openSoundFile

public void openSoundFile()

playSample

public void playSample()

showFile

public void showFile()

showFFT

public void showFFT(java.lang.String title)

getAveragePower

public double getAveragePower(double[] audioData)

checkInputSignal

public void checkInputSignal(double[] audioData,
                             double avgPower)

getNoteEvents

public NoteEvent[] getNoteEvents()

getNoteEvents2

public NoteEvent[] getNoteEvents2()

computeNoteNumber

public void computeNoteNumber()
This method will use the audio sample to compute the midi note number;


getNoteEvent

public NoteEvent getNoteEvent(double fractionalPartOfN)
Parameters:
fractionalPartOfN -
Returns:
NoteEvent starting at location 0 and ending at n*fractionalPartOfN

getNoteEvent

public NoteEvent getNoteEvent(double startTimeInSeconds,
                              double endTimeInSeconds)
get a Sub-noteEvent.

Parameters:
startTimeInSeconds - at sample start
endTimeInSeconds - get n samples
Returns:
a note event from start to start+n.

getNoteEvent

public NoteEvent getNoteEvent(int start,
                              int n)
get a Sub-noteEvent.

Parameters:
start - at sample start
n - get n samples
Returns:
a note event from start to start+n.

characterizeNoise

public double[] characterizeNoise(double fractionalPartOfN)
Enter in the first n samples that contain noise;

Parameters:
n -
Returns:
noise data

getNStrongestFrequencies

public static int[] getNStrongestFrequencies(double[] psd,
                                             int numberOfHarmonics)

getNStrongestHarmonicLocations

public static int[] getNStrongestHarmonicLocations(double[] psd,
                                                   int numberOfHarmonics)

getNStrongestHarmonics

public static double[] getNStrongestHarmonics(double[] psd,
                                              int numberOfHarmonics)

isNoise

public boolean isNoise(NoteEvent ne)

getPsdNormalized

public double[] getPsdNormalized()
Copy internal array, do not corrupt data.

Returns:
a PSD.

lyonWindowNoteEvent

public void lyonWindowNoteEvent()

get10StrongestHarmonicsTimes

public static double[] get10StrongestHarmonicsTimes(double[] psd,
                                                    int offset)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
                 throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException