KnowledgeBase | K2500R | Song Mode/Sequencing


Creating a Sample From a Song (Resample)

Question:
How can I use the K2's resampling feature to convert an on-board song into an audio file?

Answer:

If you have a K2500 or K2600/2661 with the sampling option, and enough Sample RAM, you can turn a Song into a Sample, by having the K2 resample itself while it is playing the song. This can be useful if you need a quick way to convert a song to a standard sample format such as WAV or AIFF. Many people want to do this so that they can create an audio CD with WAV files they have loaded onto their computer, without the need for other digital audio recording software or hardware. Following is a step by step description of how to do this:

Please note that although this tutorial goes through the process of sampling a song which is being played from the K2's own Song Mode, the basic process is also the same if you are using an external sequencer to send MIDI data to the K2.

  1. Load the sequence Song into the K2 from disk if it is not already in memory. If your song uses samples, remember that you need to have enough sample RAM left over for the K2 to sample itself. As a rough estimate, figure about 10 meg of RAM for every stereo minute (@44.1k). Go to Song Mode and select your Song as the Current Song, if it is not already selected. Go to the MISC page and set Play Mode to Linear.

    If the very end of your song has notes with slowly decaying envelopes, or if you have a slowly decaying effect such as a hall reverb, you may need to edit the End Point of your Song. This is because of the RAM Tracks feature, which is found in the K2600 and the K2500 with an OS of 4.32 or later. Although you won't be using RAM Tracks in this case, the RAM Tracks feature will cause the sampler to Stop as soon as the End Point in the Song is reached. If notes are still decaying at that point, the sound will cut off abruptly (since the sampler stopped recording the audio). To prevent this from happening, move the End point forward for enough beats to accommodate the amount of time it takes for the audio to fade away. To do this, press Edit, then EVENT. To quickly jump to the end point, type 99999 and then Enter. Now scroll to the second column and change the End Point so that the sound has completely decayed before the end point is reached.

  2. Go to the Sample Page. Set Sample to None and Src to Int (Internal). Set Mode to Stereo. Set Time to a large enough amount to record the entire song. Set the Threshold parameter. A value between -60 and -48dB is usually sufficient. Using Threshold recording makes it easier, since it allows the K2 to start sampling as soon as you start the song (and the audio crosses the threshold amount).

  3. At this point, depending on the options you have in your instrument, there can be a couple of different ways to proceed.

    If you have a K2500 without the KDFX option, or if you have a K2600 without the DIO-26 option, the Input parameter will be disabled once you set Source to Internal. This is because without those options the audio is always converted from Digital To Analog, and therefore the Input will be Analog. If you are planning on burning an audio CD with the WAV file you are creating, you will want to set the Rate to 44.1k, since an audio CD must be at that rate.

    If you have a K2500 with the KDFX option, a K2600 with the DIO-26 option, or a K2661, then you two choices - you can set Input to Digital or Analog. To get the cleanest possible signal, you would want to choose Digital input. However, there is one disadvantage to this method - KDFX outputs only at 48kHz, and if you want to create an audio CD with your WAV files, you need it to be 44.1kHZ. Therefore, the sample would need to be converted from 48kHz to 44.1kHz after the sample is created. Once the sample is saved, you can convert it internally in the K2 using the Resample DSP function in the Sample Editor, or with external software on your computer. If you do the conversion internally, you should set the Quick parameter to 1 to get the best quality conversion. The chief disadvantage to doing it internally is that it can take a very long time for the K2 to complete the conversion, especially with longer samples. If you do the conversion externally on your computer, it will may be much quicker. But you should be sure the software that does the conversion does a high quality job, or the audio quality may be compromised.

    If you have a K2500 w/KDFX or a K2600 and you choose Digital for Input, then the Cable parameter must be set to Coaxial. The display will show LOCK - 48kHz, showing the sample input is locking to the clock of the digital out. You will notice that if you switch the Cable to Optical, the display no longer shows that it is locked. The Out parameter on the K2600 should be set to Dir (Direct). The Format parameter is unimportant in this situation. Also, you will want to make sure the Digital Out parameter (Master/MAST2 page) is set to 16 bit (which is the default). Since the Kurzweil is a 16 bit sampler, setting the Digital Out to 20 bits will only result in those last four bits being ignored, which will cause low level audio artifacts. With Digital Out set to 16 bit, the signal will be properly dithered.

    If you have a K2661 and you choose Digital for Input, the display will show LOCK - 48kHz, showing the sample input is locking to the clock of the digital out. The Format parameter is unimportant in this situation. Also, you will want to make sure the Digital Output Length parameter on the Master2 page is set to 16 bit. Since the Kurzweil is a 16 bit sampler, setting the Digital Output Length to 24 or 20 bits will only result in those last bits being ignored, which will cause low level audio artifacts. With Digital Output Length set to 16 bit, the signal will be properly dithered.

    The other option altogether is to set the Input to Analog. Because the signal is now converted from digital to analog, and then back to digital, some noise may be added. But if you make sure to set the gain so the signal level in the loudest passages is as close to possible at 0dB, and if you don't have very quiet passages in your song, this noise may not be noticeable at all. The advantage to this method is that you can set the sample rate to 44.1kHz, so no rate conversion after sampling is required.

    If Analog is chosen for Input, then the Monitor parameter is disabled, (there is no need to monitor the input since you can already listen to the output of the instrument. (In some older versions of the K2500, the Monitor parameter was not disabled, but if you have any early version of the OS, you should update your unit. )

  4. At this point, if you have the Input set to Analog, you will want to check the level of your signal and change the Gain parameter, if needed. You can start the Song by pressing the dedicated Play button, or if you have a rack, press the Up and Down arrow keys simultaneously. You want to make sure to check the loudest section of your song. (If it is a lengthy song and you know where this section is, you can speed up the process by going to Song Mode and setting the Locate Parameter to the appropriate bar number before starting the song.) You want the meters to be as close to 0dB as possible, without pinning the meters. Don't worry if it occasional clips the meters - a small number of clips is not likely to be noticeable. Since the Gain parameter is adjustable only in 7dB increments, you may find that you can't get the signal close to 0dB without too much clipping. Don't worry - after sampling you can Normalize the sample to get the best possible signal level. Once you have the Gain set as needed, stop the song.

    If the Input is set to Digital, then no adjustment of Gain is possible on the Sample Page. You can still see the levels by watching the meters when the Song is playing. If the signal seems too low, or is clipping the meters a lot, then you can go to the MIDI Channels page and use the OutGain parameter to boost or cut the Output on a per channel basis. Don't forget to adjust all 16 channels (or all channels being used in your song) so that everything is adjusted the same amount.

  5. Now press the Record soft button. Start the Song (by pressing the dedicated Play button, or if you have a rack, press the Up and Down arrow keys) and the unit will begin sampling once the audio threshold has been crossed. If you have a K2600, or a K2500 with v4.32 or later, once the Song stops, the sampling will also stop. If you have an earlier version of the K2500 OS, then you will need to press the Stop soft button to stop the sampling. (One note - if the amount of sample time you chose was not as long as the song, the sampling will stop when it reaches that amount, so make sure you have set your time to be longer than the song.)

  6. The K2 now asks you to strike a root key. You can press the Default button or strike any key. The root key is really not important for the purposes of saving a WAV file for burning an audio CD, since it will never be used. But since you may need to edit the sample before saving it, a good idea is to always use C4, making it easy to remember.

  7. Next the K2 asks if you want to save the sample. If you had Input set to Analog, the display will also show you either the number of clips or the maximum dB level. A small number of clips (less than a dozen) is OK, but if there is a larger number, you might elect not to save the sample and try again with the Gain parameter turned down. If the display shows a maximum dB level below -3 or -4 dB, then you can use the Normalize DSP function to bring up the level of the entire sample. This is discussed in step 9. Assuming the sample does not have too many clips, press yes to save the sample. You will next get the standard Save dialog, allowing you to choose where you want to save the sample and name the sample, if desired.

    If you had Input set to Digital, then the number of clips/maximum dB report is not displayed. So for Digital sampling, our best bet is to use the meters prior to sampling to help set your levels, as mentioned above in step 4.

  8. Once you have saved the sample, if you have the RAM Tracks feature in your unit, the K2 will ask if you want to place the sample into the song. Press No. (The RAM Tracks feature places a sample in a song automatically so that the sample can be used along with other tracks of MIDI info. Although, there is no reason to do this for the application we are covering in this tutorial, you CAN use this resampling technique along with RAM Tracks during the process of creating the song. For example, if your song is using up a lot of your polyphony, due to using a KB3 Program or other programs with many layers, you can resample your tracks and place that sample into the song. Now you can mute or delete the original tracks. Your stereo resample will use only 2 voices of polyphony and you can now record new tracks to play along with the sample.)

  9. The K2 now returns to the Sample page. You can hear the sampled song play back by striking the root key (C4 if you pressed Default). The sample is actually playing back through a temporary program while on this page, which uses the parameters from Program 199 Default Program. Since this program has 35dB of Velocity Tracking on the F4AMP page, you will not hear the sample played back at full volume unless you strike the key hard enough to send a velocity of 127. (Actually, even at a velocity of 127, it will sound softer than the song did when playing back in Song mode. This is because the K2 is designed to allow 48 voices to play without clipping, and you are only playing two voices. But once you save the sample and export it, none of this will matter - the sample will playback at full volume.)

  10. At this point you may need to edit your sample in one or more ways.

    Normalizing the Sample

    If the maximum dB level shown in step 7 was too low, you will want to Normalize the sample. Press Edit (which brings you to the TRIM page), then DSP. Assuming you haven't been doing any other DSP Sample editing, the K2 will come up on the Normalize function. This function will increase the amplitude of the entire sample (assuming you don't change the Start or End points on this page), bringing the signal level up, just before the point at which the loudest part of the sample would clip. Press Go. For long samples this processing can take several minutes. Once it is finished, the K2 asks if you want to keep the change. Press Yes, then Replace. After a short wait (longer for lengthier songs), the display returns to the Normalize page. Press Done to return to the TRIM page.

    Trimming the Sample

    If you edited the End Point of your song so that it was long past the point at which audio had decayed away, or if you were pressing Stop manually to stop sampling, you may have an end point which is a number of seconds past where the audio has decayed below an audible level. Therefore, you may need to edit the End point of the sample so there is no "dead space" at the end of the sample, especially because this will make the size of the WAV file larger than it needs to be.

    Here is a fast way to trim the sample:

    Go the TRIM page in the sample editor if you are not already there. You will probably want the display to show Seconds instead of Number of Samples (the Quick Access button will switch between the two methods). Change the Start point to an amount a few seconds before the End point. Scroll over to the Loop Point and press Link (the Song button), then scroll to End and press Link again. This links the Loop and End points so that moving one also moves the other. The reason you want to do this is that all data is saved within the four points, so if you shorten the End but not the Loop, you won't end up making the file size any smaller.

    Now strike your root key. The sample will play from the Start point you just chose until the End. If you don't hear anything, the start point may be past the point at which audio had decayed away. In that case, you can highlight Start again and move it to an earlier point. Now, with End highlighted, you can adjust the End point, striking the key and listening, until you have the End set just past the point at which the audio has decayed below an audible point. Once you have the End point set, don't forget to go back and set Start back to 0. Then press Exit and save the sample.

    Changing the Sample Rate

    As discussed in Step 3, if you have sampled with the Input set to Digital, the sample Rate is fixed at 48kHz. Since audio CDs need to have the sample rate at 44.1kHz, you would need to convert the sample rate. If you choose to do this in the K2, you would use the Resample DSP function. To do this, press the DSP button from within the Sample editor, then change the Function parameter to Resample. Set the New Rate parameter to 44100Hz and set Quick to 1. Then press Go. Please be aware that this process can take a very long time, especially with longer samples. Once it is finished, the K2 asks if you want to keep the change. Press Yes, then Replace. After a short wait (longer for lengthier songs), the display returns to the Resample page. Press Done to return to the TRIM page.

  11. Once your sample is edited to your satisfaction, you can export it as a WAV File to disk. Obviously you will need a SCSI drive to save such a large file, and you will want it formatted in DOS so that the computer can recognize the disk. If you have any questions on this, please see our SCSI Basics page. Press Disk and select the correct SCSI ID for the drive. Press Save, then Export. Press WAV or AIFF, depending on the format you need (WAV is more likely what you will want). If you have more than one sample in the instrument, you will need to select the sample you want to export. Press OK. Name the Sample, and then press OK to save the sample to disk.

  12. Once the sample is exported, you can load the file onto your computer (this may require adding a SCSI host card to your computer to attach the drive). It is beyond the scope of this tutorial to explain what is need to burn the file or files as a CD, but a couple of things are worth mentioning.

    It is possible that some software may not recognize the file as a valid WAV or AIFF file because the file saved by the K2 will have no Type or Creator. There may also be some subtle differences in file formats.

    So if you are having problems getting your desired application to recognize the exported K2 file, try a different program. Programs designed to read many different types of audio formats and convert them to other formats are likely to read the exported file without problems.


Need more info? Check out the following links: