# Sample to Synth Tools ▸ Conversions ▸ Sample to Synth… builds a MED synth instrument out of a sample: the sample is cut into up to 64 short waveforms, one after the other, and the synth's wave table steps through them, so a note **scans** through the recording one waveform every few ticks. It is the project's standalone `sample-to-synth/` tool brought into the editor, with the same controls; the result goes into an instrument slot instead of an `.oms` file. A synth plays at any pitch without the sample's length changing with it, and it is a few kilobytes where the sample may be hundreds. What it loses is resolution: each waveform is at most 128 bytes of 8-bit sound. ## Sample The sound to convert. The window opens on the current instrument when it holds a sample; the list also offers every other sample slot, and every sound in the project that no slot plays. A packed (ADPCM) sample is listed but greyed, because it cannot be read. **File…** reads a WAV, AIFF, IFF 8SVX, MAUD, MP3, MP2, Ogg or FLAC file — the same readers a sample loaded into a slot goes through — and adds it to the top of the list. A stereo sound is mixed to mono. **Sample to Synth…** is also on the right-click menu wherever a sample is listed, and opens the window on that sample: - the Instrument List's rows, docked or in its window — that instrument; - the sample editor's Commands, under Edit beside Copy to synth editor — the instrument being edited; - the Library's rows — a slot of This module as that slot, a sound in no slot as that sound, and a file, a sample in an archive or an instrument of a module opened as a folder as a file, under its name; - a sound's row on the Library's Online tab, which is downloaded first, as Load downloads it, and opened as a file. The row is greyed, saying why, where there is no sample to take: a synth, a HighLife instrument, a plugin, an empty slot or a packed sample. A hybrid's sample is taken, and its synth goes into a new slot, the hybrid left as it is. In a `.mod` every one of them is greyed with the way in, as the Tools row is. ## The picture and Use from The upper picture is the sample. **Use from** and **to** are the part of it that is used, in milliseconds; the rest is darkened in the picture. Press on the picture to bring the nearer end to the pointer, and drag it from there. Detect, Audition and the build all see only this part, so trimming off the attack and the release tail before detecting the pitch gives a much better answer. ## Read at The rate the sample is read at, 100 Hz to 192 kHz. It changes nothing in the sample's data, only the pitch and length it is taken to have: **÷2** is an octave down and twice as long, **×2** an octave up and half as long. The presets are common rates (8363, 11025, 16726, 22050, 44100 and 48000 Hz), and **Own** goes back to the sample's own rate, which the line under the row gives. ## Pitch (Hz) The pitch of the sample, 20 to 8000 Hz. The sample is resampled so that one cycle of this pitch fills one waveform exactly, which is what makes the synth play in tune: a synth note plays one waveform per cycle. **Detect** finds it with the YIN method, in the part used. It works on pitched sounds with one note at a time; noise, drums, chords and inharmonic sounds give no clear pitch, and it says so. The answer is given with its nearest note and how many cents off it is. **Tone** plays a sine at this pitch to match by ear; edit the field while it sounds and the tone follows. ## Waveforms, of, and Speed **Waveforms** is how many the scan has, 1 to 64 (MED's most). **of** is the length of each, 4 to 128 bytes; 128 is the most OctaMED takes, and a shorter waveform plays an octave higher for each halving. **Speed** is how many ticks each waveform plays for before the next — the wave table's own speed — so the whole scan lasts waveforms × speed ticks at the song's tempo. ## Fit What happens when the part used is longer or shorter than the scan. - **Stretch to the scan** spreads the whole part over the scan, however long it is. The read-out gives the ratio; far from 1, the sample is squeezed or drawn out in time and the waveforms no longer hold one cycle each. - **Truncate at its own speed** keeps the sample's speed. A longer part is cut at the end of the scan; a shorter one fills as many waveforms as it lasts, and the rest are silent. The read-out says how many waveforms would hold the part unstretched. ## Attack and Decay A volume envelope, in ticks; both 0 gives the flat table every new synth starts with. **Attack** rises from silence at the start of the note. Where the **Decay** goes depends on the scan's end: inside the scan with *End*, so the note has died away when the scan does; after the scan with *Hold last*, while the last waveform holds; and not at all with *Loop*, where it would silence every pass after the first. A synth's volume table is 128 bytes in MED. When the envelope needs more steps than that, the table steps every 2, 3 or more ticks instead of every tick, and the ramps keep their length in ticks; the read-out says when it does. ## Scan end What the wave table does after the last waveform: - **End** — the wave table's END. - **Hold last** — HLT. - **Loop** — a jump back to the first waveform, for as long as the note sounds. In MED's player, END and HLT both stop the wave table on the waveform it has reached, so End and Hold last sound the same until there is a decay: the difference is where the decay goes (above). The standalone tool's preview silenced the note at END; MED does not. ## The lower picture The synth's waveforms end to end, as they will be stored, with a line between each. All the waveforms are normalised together, so a quiet part of the sample stays quieter than a loud one, and the sound is stored as 8-bit with a little dither. The same sample and settings always give the same bytes. ## Output and Name **Output** is the slot the synth goes into: a new slot (the default), or the sample's own slot, replacing its sample. A file, a sound no slot plays and a hybrid's sample can only go into a new slot. Nothing is replaced unless its slot is chosen here: instrument racks are to let a synth made from a sample stand beside that sample in one instrument, and until they do, a new slot keeps both. Replacing a slot that holds something asks first. The instrument keeps the slot's volume and its other settings; its finetune is set to 0, because a sample's finetune records the rate it was recorded at, which a synth does not have. Either way the change is one step of Edit ▸ Undo. A `.mod` cannot hold a synth and is refused with the way in: make it a MED module first with Tools ▸ Conversions ▸ Convert to a MED Module…. ## Preview at, and the buttons **Audition** plays the part of the sample used, at the rate it is read at. **Preview** plays the synth as it will be, through the module's own player — the same synth preview as the synth editor's, running its volume and wave tables at the song's tempo — at the note chosen in **Preview at**, which starts on the note nearest the pitch. It plays before anything is applied, and it needs the song to be stopped. Unlike the standalone tool's preview, it is not an imitation: it is what the slot will play. **Apply** puts the synth in the slot. Nothing is written to an `.oms` file; the synth is part of the module and is saved with it.