Blender 2.28 Audio Sequencer documentation ========================================== 1. Overview 2. Using the audio features 1. Audio sequencer settings 2. Using audio strips 3. Audio strip properties 4. Volume IPOs 5. Mixing buffer size 3. Implementation 4. Known bugs / limitations 1. Overview =========== instinctive-Blender adds global audio sequencing / syncing support to Blender. This eliminates the need for external lipsync tools like Magpie, enables users to composite audio and video inside Blender without the need for external compositing applications, and makes work with Blender a lot easier on the whole, especially if the audio material already exists, and the video is to be done. Key features: - Ability to use any number of audio strips in the sequence editor. - Non-destructive Cut/Copy/Paste/Gain/Panning for audio strips - Non-destructive Volume envelopes per strip - 44.1kHz or 48kHz (16-bit stereo) mixing - Full Video->Audio sync support: Automatic framedrop if the video can't keep up with the audio - Framerate set by Frs/sec button in the Display buttons (F10) is now used everywhere - Audio mix from the sequence editor can be heard in ALL Blender windows (this includes 3d views) - Imports 16-bit mono or stereo samples at any sampling rate - Automatic resampling of imported sample data (horrible linear scaling) - Scrubbing (audio preview) of the audio mix at the current frame position whenever the user moves the frame bar (IPO, NLA, Sequence, Action window) or uses the cursor keys to change frames - Wave preview in audio strips 2. Using the audio features =========================== 2.1. Audio sequencer settings ----------------------------- First of all, let's take a look at the "Audio sequencer settings" menu, which is accessed via the Sound buttons (little speaker icon): - Mixing/Sync: 44.1 kHz: Set the global mixing rate to 44.1 kHz. This is the standard sampling rate used for most applications, including audio CDs. 48.0 kHz: Set the global mixing rate to 48 kHz. Recalc: When this button is clicked, Blender will resample ALL loaded audio strips to match the new sampling rate. Resampling is currently done using a horrible linear scaling algorithm, so it is better to use samples that natively have the correct rate. Resampling is done non-destructively, the original sample is always retained. NOTE: You HAVE to use this function after changing the global mixing rate, or your audio sequence will be completely out of sync! Sync: When activated, the global framerate is synced to the sample clock. Frames get dropped when the video can't keep up with the audio. You can deactivate Sync if you want EVERY frame to be calculated and displayed. This is most useful for the sequence editor, if you want to have Blender cache all images in a sequence. This button is duplicated in the Anim buttons (F7). Scrub: When this button is activated, you will be able to hear a tiny part of the audio at the current frame whenever you change the frame number. This applies to moving the frame bar in IPO-, NLA-, Action- or Sequence editor windows, or using the cursor keys to change the current frame. Very useful for knowing "where you are". - Main mix: Main (dB): Set the master gain in dB. Use this slider for globally scaling the volume of your audio. You should set this slider low enough to avoid clipping, but as high as possible to reduce noise. NOTE: The setting of this slider also applies to the MIXDOWN function (explained below) Mute: Mute all audio (but still sync) MIXDOWN: Probably the most important function. This is the audio counterpart of the 'ANIM' button in the Display buttons. When you press this button, Blender will write a .WAV file to the "Output" (formerly Pics) directory set in the Display buttons. The file will be named just like an AVI file (0001_0250.wav for Startframe 1 and Endframe 250), and will contain the complete audio of the current scene as a single WAV file. This WAV file can then be mastered externally and merged into the final movie file. 2.2. Using audio strips ----------------------- Enter the sequence editor (in the default setup, the corresponding Screen setup is called "Screen.002"), and add a sequence strip with SHIFT-AKEY, and choose "Audio". Select a WAV file of your choice. Note that ONLY 16-bit files are supported. You should now have an audio strip which you can place just like a usual scene/image strip. It is possible to move the left and right handles of the audio strip to select any desired part of the audio. This operation is non-destructive, the handles can be readjusted at any time just like with conventional strips. You can place several audio strips on seperate layers. They will be mixed accordingly. Duplicating and moving strips works exactly like with image strips. Duplicating an audio strip does NOT duplicate its data. 2.3. Audio strip properties --------------------------- To access an audio strip's settings, highlight it with RIGHT-CLICK, and press NKEY. Possible adjustments are: - Name: Sets the name to be displayed in the strip - Gain (dB): Set the gain of the strip. Negative values attenuate, positive values increase the volume. Non-destructive. - Pan: Set the panning of the strip. -1 is hard left, +1 is hard right. - Mute: Mute the strip. You can also press MKEY while the strip is active to mute it. 2.4. Volume IPOs ---------------- Each audio strip can have an independant Volume IPO assigned to it, which can be used to scale its volume over time. To add a volume IPO to an audio strip: - Highlight an audio strip - Select "ADD NEW" in the IPO window (be sure that the IPO type reads "Fac") - Use CTRL-LEFTMOUSE to add vertices to the IPO. IPO frames 1-100 correspond to the whole sample length, 1.0 is full volume, 0.0 is completely silent. 2.5. Mixing buffer size ----------------------- The mixing buffer size is crucial to the correct and accurate operation of the audio system. To adjust the mixing buffer size, drag down the Info window (where all the user preferences are set), you will find a set of yellow buttons there which are labelled 'Mixbuf 256', '512', '1024', and '2048'. You should try to start with the smallest possible setting, 256 (the default). It gives you the fastest and most accurate response. Though with heavy scenes, it can lead to buffer underruns, which can be heard as clicks in the audio. Bigger buffers mean less accurate video->audio sync. Try to use the lowest possible setting that still guarantees a continous audio buffer fill even for big scenes. 3. Implementation ================= Hmmm... Probably still some bugs left, as a first comment :) I used the standard bSound struct to load and store the samples for the sequencer. bSounds used in sequence strips get their SOUND_FLAGS_SEQUENCE bit set so they are hidden from the sound buttons. I've added a bunch of stuff to DNA... as an example, Blender needs to store a temporary version of the sample that is converted to the mixing rate (as we don't want on-the-fly conversion while mixing -- too slow), so there's a new pointer in the bSound struct... Whenever sequence sample data is used, audio_makestream() is called to be sure that the sound has a corresponding stream (converted to global mixrate), and if not, it is created. CFRA is not incremented anymore in the anim loop, but directly set to the return value of audiostream_pos(), which calculates it from the current audio stream position (duh...)... Most calculations (Start frame of a sound (left handle of strip), end frame, IPOs) are only done with frame-based accuracy... So you might hear clicks at the beginning and end of audio strips if the signal starts instantly and continues till the end. The mixing is better in MIXDOWN mode (WAV-File output), as the mixing buffer size is decreased to 64 bytes, and some calculations can then be done independantly from CFRA. Well, for more questions, just ask me :) 4. Known bugs / limitations =========================== - Only 'genuine' Microsoft PCM RIFF little-endian files are supported by Blender's WAV loader (this is not an instinctive-blender specific limitation, though). - Only 16 bit audio data is supported - Saving ~/.B.blend (CTRL-U) when audio strips are loaded will crash Blender on the next startup. This is very strange, considering that that same .B.blend loads fine when loaded with the usual "Load file" function. - Poor soundcards will give poor results. Don't expect your on-board AC97 chip to work at all.