2021-02-20

# instruments

• model

• instrument

• cluster ...

• envelope ...

• sine(amp, frq, phs) / filtered_noise(amp, frq_start, frq_end) ...
• notes

• partials summed make complex wave shapes

• using clusters to build instruments works, because even instruments are made of some distinguishable objects

• partials in a cluster should be similar enough to each other so they are not recognised as separate sounds, but different enough that they arent recognized as mere amplification

# choosing partial frequencies

• "The relative amplitudes (strengths) of the various harmonics primarily determine the timbre of different instruments and sounds, though onset transients, formants, noises, and inharmonicities also play a role."
• harmonics are multiples of the fundamental (pitch) frequency. the fundamental is the frequency at which the entire wave vibrates
• multiples and added divisions can be used
• variables to select a partial: fundamental + divisions + shift
• irrational frequencies have their period never restart at the same time as the fundamental again
• mixing odd and even divisions is less harmonic
• examples of subdivisions, times frequency:

• 1/1, 1/1 + 1/2, 2/1
• 1/1, 1/1 + 1/3, 1/1 + 2/3, 2/1
• 1/1, 1/1 + 1/4, 1/1 + 2/4, 1/1 + 3/4, 2/1
• relations to music theory

• an octave is a doubling in frequency
• a common scale divides octaves into twelve tones. without just intonation, these intervals are historically not equally spaced
• a perfect fifth is a combination that is periodic on two periods of the lower note, a 2:3 frequency relation. the beginning of the second repetition of the fundamental is at the center of the second repetition of the other tone
• some possible partial frequency relations

• equidistant

• increasing distance

• decreasing distance

• varying distance

• sparse

• dense

# statistics to guide the automatic generation of data arrays for sound parameters

• statistics are a digest/abstraction of the actual details of a pattern
• they can be used to compare or generate patterns (monte carlo method)
• statistics can be a target for a generator
• it can also be used as an analysis step to make parts of patterns more similar or to blend them together
• note that pointwise interpolation is another method to create similar patterns
• statistics on the differences between values can also be useful
• some interesting statistical methods

• standard deviation: the variation from the mean (variance) with reduced bias to extremes
• arithmetic mean: one share of the total sum equally distributed. the point where the sum of smaller values matches the sum of larger values
• median: the center between higher and lower values. the point where the count of smaller values matches the count of larger values
• range: the difference between the maximum and minimum
• minimum: the minimum value in the dataset
• maximum: the maximum value in the dataset
• kurtosis

• describes the distribution of numbers. for example, if values are spread out and more equally likely, or if there are peaks in the distribution, which would mean that a range of values appears in the dataset more often
• mean((x - mean(data)) ** 4) / (mean((x - mean(data)) ** 2) ** 2)
• skewness

• describes the distribution of numbers. gives an indication about if there are more low or more high numbers
• mean((x - mean(data)) ** 3) / (mean((x - mean(data)) ** 2) ** 3/2)
• center of mass

• the distribution of mass is balanced around the center of mass, and the average of the weighted position coordinates of the distributed mass defines its coordinates.
• sum(n x(n)) / sum(x(n))
• the number of unique subsequences as a potential statistic

• the count of repetitions of overlapping subsequences of length 0..n

• can find the subpattern lengths with the highest proportion of unique subpatterns relative to the possible unique subpatterns

• examples

• low: 11111 112112

• high: 12345 112212

# autocorrelation vs absolute differences

• autocorrelation gives a degree of difference with large local difference being pronounced to differentiate it from many small differences.
• correlation is -1 to 1
• correlation only tests linear dependence. (1 2 3) and (4 5 6) are 1
• mean absolute difference goes to infinity

# general

• the choice and availability of all sine configuration details before synthesis allows perfect analysis/knowledge unachivable by sound analyis with the fast fourier transform and other methods

• this freedom is not necessarily lost even when samples are used as a basis to choose parameters, unless the goal is an exact recreation of the source material
• even if sines can therotically represent triangles (with infinite sines), a triangle is the ideal (even if impossible) shape

• summing sines can match the limits of reproducibility that exist anyway
• using the ideal shapes might lead to aliasing
• data types

• continuous: sample -1..1; amplitude: 0..1
• discrete: sampling-time
• one can imagine a spectrum between harmonicity and noise, where harmonic sounds dissolve into noise
• real human-like complexity in patterns is a variety of, and layers of, modifications over time. it is not the number of unique subsequences
• panning effects can be left to right then again left to right, or left to right then back from right to left
• to share parameter values, sound generators dont need to somehow trigger other sound generators (inefficient, possibly cylic). instead the values can be shared from a parent context
• partials can be more causative/dependent/similar or more correlative/independent/dissimilar