## 3 Onset Detection  
The onset detection algorithm is based on the onset detection algorithm used by [PERSON] [50], with some modifications and improvements. The approach used is based on spectral flux as the onset detection function, defined as follows:  
\[SF[n]=\sum_{k=0}^{N}H(|X[n,k]|-|X[n-1,k]|) \tag{3}\]  
where \(H(x)=\frac{x+|x|}{2}\) is the half wave rectifier function, \(X(n,k)\) represents the \(k\)th bin of the \(n^{th}\) frame of short time Fourier transform (STFT) of the input \(x[n]\). Linear magnitude is used instead of logarithmic. \(N\) is the Hamming window size. The experiments performed use a 46 ms frame size (i.e., \(N=2048\) samples, with sampling rate \(f_{s}=44,100\) Hz) and a 11.6 ms hop size (\(h=512\) samples). As in [50], in order to reduce the false-positive rate, the onset detection function \(SF(n)\) is smoothed using a Butterworth filter defined by \(H(z)=\frac{0.1173+0.2347z^{-1}+0.1174z^{-2}}{1-0.8252z^{-1}+0.2946z^{-2}}\). To avoid phase distortion (which would deviate the time of the detected onsets), the input data are filtered in both the forward and backward directions. The result has precisely zero phase distortion, with the magnitude being the square magnitude of the filter response and with the order of the filter being double the order specified by \(H(z)\). We also used an envelope function \(EH[p]\), where \(p\) represents the discrete time variable of the input signal \(x[p]\) (The input signal is in time domain \(x[n]\), represented as \(x[p]\), because the variable n now represents the frame number and not the discrete time.) and the envelope function is calculated over the input time signal \(x[p]\), using Hilbert transformation for discrete time signals [51]. Figure 2: Block diagram of our multi-pitch estimation (MPE) system with multiple classifiers: first, an onset detector is applied to the input audio signal to infer where are the musical notes; then, an audio frame with 4096 audio samples (93 milliseconds) is extracted, starting at the onset time; the extracted audio fragment is then transformed to 5 different representations in the frequency domain, resulting in 5 different inputs (\(I_{1}\dots I_{5}\)); and these 5 inputs are fed into the 61 evolved classifiers, so that they can identify whether the corresponding musical notes are present in the extracted audio frame. Each of the 61 classifiers has a binary output. The onsets are detected using a peak-picking algorithm to find a local maximum. A peak at instant \(t=\frac{\pi H}{f_{s}}\) is chosen as an onset if the following conditions are met:  
1. \(SF[n]\geq SF[k]\)\(\forall\)\(k:n-w\leq k\leq n+m\)
2. \(SF[n]>\frac{\sum_{k=m+m}^{k+w}SF[k]}{mw+w+1}\times\mathit{thres}+\delta\)
3. \(\frac{\sum_{k=m+1}^{n+N}ET[k]}{N}>\theta\)  
where \(w=6\) is the window size to achieve the local maxima, \(m=4\) is a multiplier so that the average should be calculated in a broader area before the peak, \(\mathit{thres}=2.0\) is a threshold value relative to the local average that a peak must reach in order to be sufficiently prominent to be selected as an onset, and \(\delta=10^{-20}\) is a residual that is combined with \(\theta=0.01\) to avoid false-positive detection in silent regions of the signal. All these parameters were adjusted empirically on previously performed tests using a collection of several piano compositions played by different pianos. Figure 3 shows an example of a sound sample of 2.1 seconds with 3 onsets detected for frames  
CGP is called \"Cartesian\" because it considers a grid of nodes that are addressed in a Cartesian coordinate system. Each node may contain additional genes for encoding additional parameters that might be necessary for specific functions, for instance, a threshold value. Typically, all functions have as many inputs as the maximum function arity and unused connections are ignored. As in any evolutionary algorithm, each individual encodes a possible solution to the problem addressed. The set of individuals is called the population.