Find this as part of IRCAM's Diphone suite. I used this to make the saxophone and shakuhachi SDIF's for the Spectral Tutorials.

**PLEASE READ**
- You need to have the SDIF framework installed in order to load AddAn.
- Version 4.2J of Diphone is compatible with Mountain Lion 10.8.5
- File format: .aif files need to be physically exported to .aiff.

You can find it here:
http://sourceforge.net/projects/sdif/files/sdif/SDIF-3.11.2/SDIF-3.11.2-
It must be placed in YourHD/Library/Frameworks/*

#Opening and Running an Analysis

- Open AddAn
- Use apple-N to open a new analysis. It opens a window like this:
[inline-center:AddAn01.png=choose your weapon]
- Choose *Harmonic* if you are analyzing a pitched instrument with a basically harmonic spectrum.
- Choose *Inharmonic* if you are analyzing something with an inharmonic spectrum, like a bell or a multiphonic.
- You will get a window like this:
[inline-center:addan-1.png=harmonic analysis]

The region to the left is a data-flow representation of the different stages of the analysis and how each relies on results from previous stages. For example, the very top (with something that looks like a time-domain waveform) represents the input sound, the one below it and to the left (which looks like vibrato as a function of time?) represents the fundamental frequency estimate, etc. The region to the right represents the same steps, but in a straight list, where you can choose which phases of the analysis will be performed and what the resulting files will be named.

- Click and drag your mono sound file from the finder onto the text field labeled "Sound Input", or click on the folder icon to the right of that text field to open a dialog box for choosing your sound file input.
- You can click on the speaker icon on the same row to hear the input sound (and click it again to stop playback).
- Now click on the "Validate" button in the lower right-hand corner, and it will fill in the names of all the SDIF files it plans to write:
[inline-center:addan-2.png=ready to go]
- For real-time synthesis, all you need is the "Partials" file, with the ".add.sdif" extension. But to get a Partials file the analysis first needs to make a "Fundamental" file and a "Peaks" file. You'll also probably want to make the "Noise" file, for which you'll need the "Synthesis" file. So I usually leave those 5 checked and uncheck the rest.

- When you uncheck any of the files, the "Run..." button turns back into a "Validate" button, so you have to hit it again. I think "Validate" is supposed to be a sort of "pre-flight" check to make sure you've got the right input files and that the analysis you're requesting looks like it will proceed properly.

- Hit "Run...". You'll see a progress bar at the bottom of the window, and red text above it telling you which phase of the analysis it's currently doing.

When it's done, the loudspeaker icons for the "Synthesis and "Noise" files go from greyed-out to black, indicating that the sound files have been created and that you can now listen to the resynthesized result of your analysis. If the analysis was successful, the "Synthesis" file will sound pretty much like your original, and the "Noise" file will have no pitched component, just noisy attacks, breath, bow scraping, etc. (Composers seem to really dig these noise files.)

More likely, your "Synthesis" will sound vaguely like the original but with a lot of extra junk, and the "Noise" file will sound like all the extra junk (but with the phase reversed, which doesn't make it sound any different from the extra junk). The proper term for that extra junk is "artifacts". See below for some ideas on what to do when your analysis has artifacts.

#Improving the Analysis Quality
Generally you will need to adjust AddAn's settings to get good results.

##Use a Preset
- Select one of the "presets", such as "Voix Grave" (for lower-pitched sounds) or "Voix Aigue" (for higher-pitched sounds), from the settings area near the top of the window.

##Get a Good Fundamental Frequency Estimate
If you still get artifacts, the easiest and most effective thing to tweak is the fundamental frequency (a.k.a. "F0") estimation. All of the later stages of the analysis rely on getting an accurate estimate of the time-varying fundamental frequency. In particular, if the true fundamental frequency stays constant (e.g., within a note) but the estimated fundamental frequency changes (e.g., because of an octave error), then the synthesis will have a weird glissando blip artifact right at that instant.

The button all the way to the right on the "Fundamental" line of the analysis window will open up a window in which you can see (and edit!) the fundamental frequency envelope. What you want to see is a graph of the pitch of the sound as a function of time. If your input sound is a single pitch, you should see a pretty much flat line (except for vibrato and other small effects like "scooping" into a note, etc.) If your input sound is a musical phase with discrete pitches, you should see something that's more or less a "step function", i.e., one small flat line for each note.

Odds are good that instead you will instead see something like this:
[inline-center:addan-3.png=yuck!]

In this chart, you can see that there are two six-second held notes at about 110 hertz, first at the beginning of the file, and then from about the 18th to 23rd seconds. But otherwise, this F0 envelope is a total mess, jumping all over the place erratically. No wonder the synthesis sounds horrible. There are two ways to improve the F0 envelope:

1. Fix it by hand.
2. Change the analysis settings

If the problems with the F0 envelope are small and you're confident that you know what the pitch-as-a-function-of-time should look like, just hand-edit the F0 trajectory. Make your life easier by first changing the magnification in the edit window.

For more systemic problems, the easiest way to improve the F0 estimate is to use your knowledge of the true pitch range of your input sound to restrict the range of allowable F0 values in the estimate. For example, the lowest note in the phrase I'm currently trying to analyze is a low E, about 41.2 Hertz. Even the "Voix Grave" preset assumes that the lowest pitch will be 110 Hertz, so I changed the limit. To do this:

- Click the center of the buttons above the data flow representation. It is the largest, and looks like a blue knob.
- This opens the settings window. Select "Extract Fundamental" from the pulldown menu.
[inline-center:addann-fund.png=fundamental settings]
- Enter the proper *Fundamental Minimal Frequency* (just below the minimum fundamental frequency you are expecting)
- Enter the proper *Fundamental Maximal Frequency* (just above the minimum fundamental frequency you are expecting)
- Re-run the analysis. NB: If you're working just with the fundamental, you may want to uncheck all of the other analysis stages, so that you don't waste processor time doing further analysis and resynthesis until you have a reasonable F0 envelope.

With these proper settings, the same input file produces this f0 envelope:
[inline-center:addan-4.png=yum!]
With this better F0 envelope, the resulting synthetic sounds are vastly improved.

- Once you're happy with your F0 estimate, un-check the "Fundamental" (or else AddAn will re-estimate the F0 the next time you "Run..." the analysis).
- If you've put a lot of effort into hand-editing your F0 envelope, I recommend that you make a manual backup of the .f0.sdif file.

#Finding your files
ResAn (and the entire Diphone package) has a special directory in which it writes all of the SDIF files that it creates:

"/Applications/Diphone Studio 4.1/ImpExport/"

The "Partial" folder contains all the .add.sdif files (which you can synthesize from Max/MSP). The "Sound" folder contains the .synth.aiff and .noise.aiff sound files.

Attachments