Difference between revisions of "Proposal Crossfade"

From Audacity Wiki
Jump to: navigation, search
(External References)
(Current Implementations: spelling consistency with the Nyquist effect as listed on the Forum linh)
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{intro|This page is intended to compare existing or theoretical implementations of cross-fade, and to generate a discussion on future implementation of fades and cross-fades in Audacity, so we can make good design choices.|}}  
+
{{Proposal_Header|This page is a proposal for a simplified interface for cross-fading from one track to another. }}
  
 +
__NOTOC__
  
== Purpose ==
 
This page is for community discussion of cross-fade.  Most of the content (as of April 18th 2008) was added by a potential [[GSoC Ideas|GSoC]] student.  We are trying to evolve the page away from being 'like a GSoC proposal', and towards being an open proposed feature discussion.  The student (Jeffrey) knows how to use this page, he's not about to paste it all back into his application to us!, and if discussions of options here lead to significant changes in the scope of what ''he'' plans to do ''for GSoC'' then those changes need to be written up in clear in his student application.  This is a companion page to the [[Label Track]] page and has a similar intent.
 
  
== Why Cross-Fade? ==
 
  
Here is a link to the original project suggestion on the Audacity GSoC ideas page. [[GSoC_Ideas#Intuitive_cross-fading]]
+
== Proposed Feature ==
 +
 
 +
Simple to use interface to fade out one track and fade in another.
 +
 
 +
 
 +
== Developer/QA Backing ==
 +
 
 +
* [[User:Vaughan|Vaughan Johnson]]
 +
* [[DominicMazzoni|Dominic Mazzoni]]
 +
* [[User:donfede|Federico Grau]]
 +
* Peter Sampson
 +
* Gale Andrews
 +
 
 +
== Use Cases ==
 +
 
 +
* One of the most common operations people want to do when mixing audio is to smoothly transition between two sound clips.
 +
 
 +
Project suggestion GSoC ideas page: [[GSoC_Ideas_2008#Intuitive_cross-fading]]
 +
 
  
 
== Core Features ==
 
== Core Features ==
  
The basic functionality is implied by the the cross-fade mockup at http://limpet.net/mbrubeck/temp/cross-fade/.
+
The basic functionality is implied by the the crossfade mockup at http://limpet.net/mbrubeck/temp/cross-fade/.
  
Cross-fade functionality - A single linked fade. Three fade shapes will be selectable.
+
Interface
 +
*Initial creation - There are two ways that this is done in existing software. In the first, an overlapping region of two clips is selected and some key press or menu selection pops up a crossfade creation window. In the second, dragging clips over each other to create an overlapping region creates a crossfade automatically. I think that the second option is the best choice for the first stage of implementation. It offers a smoother user experience at the expense of immediate fine control over fade options.
 +
*When a modifier is held down (I propose ctrl-shift), clips dragged into each other will no longer be forced to respect each others' boundaries. Instead, an overlap region will be created and a crossfade applied between the two clips. By default, the crossfade will extend from the left-most point of the right-hand clip to the right-most point of the left-hand clip.
 +
*Clicking and dragging dotted lines that mark the fade boundaries will resize the fade so that the fade interval can be any continuous interval of the overlap region.
 +
*Clicking and dragging inside the fade region will slide the fade within the overlap region.
 +
*Clicking and dragging a boundary of the overlap region (as marked by either a background color change or another set of vertical lines) will slide the clip that forms the opposite side of the overlap. Extending an overlap region in this way will be capped at the point where one clip would be completely contained in another.
 +
*Right-clicking anywhere inside the overlap region will pop up a menu from which the user can choose between fade shapes.
 +
 
 +
 
 +
Crossfade functionality  
 +
In the first development stage, the fade-in and fade-out will be linked according to selected fade type. Three fade shapes will be offered.
 
* Linear - A constant-gain cross fade in which a linear envelope decreasing from 1 to 0 over the course of the fade is applied to the left-hand clip and a linear envelope increasing from 0 to 1 is applied to the right-hand clip.
 
* Linear - A constant-gain cross fade in which a linear envelope decreasing from 1 to 0 over the course of the fade is applied to the left-hand clip and a linear envelope increasing from 0 to 1 is applied to the right-hand clip.
* Logarithmic - A constant-power cross fade in which a logarithmically decreasing envelope is applied to the left-hand clip and the mirror image of this envelope is applied to the right-hand clip.
+
* Exponential - A constant-power cross fade in which a exponentially decreasing envelope is applied to the left-hand clip and the mirror image of this envelope is applied to the right-hand clip.
 
* S-Curve - A commonly discussed fade shape - see for instance http://transom.org/tools/editing_mixing/200309.stupidfadetricks.html. An envelope of 1/2+1/2 cos (2*pi*w/T) is applied to the left-hand clip where w is the number of samples from the start of the fade and T is the fade length in samples. The mirror image of this envelope is applied to the right-hand clip.  
 
* S-Curve - A commonly discussed fade shape - see for instance http://transom.org/tools/editing_mixing/200309.stupidfadetricks.html. An envelope of 1/2+1/2 cos (2*pi*w/T) is applied to the left-hand clip where w is the number of samples from the start of the fade and T is the fade length in samples. The mirror image of this envelope is applied to the right-hand clip.  
  
 
Display  
 
Display  
* Fade representation - A line will cut through the track display from the top at the fade start point to the bottom at the fade end point. Below the line, the left-hand clip will be rendered. Above the line, the right-hand clip will be rendered. For the linear and S-curve cross-fades, the two envelopes being applied to the clips sum to 1. This means that a single line shaped like the fade-out envelope is enough to completely visualize the cross-fade. In the logarithmic case, this is no longer true. More thought will need to be given to how to indicate that a logarithmic fade is being applied in a way that is consistent with what is actually being done. Dotted gray vertical lines will mark the start and end of the fade.  
+
* Fade representation - Most existing software renders waveform data from both overlapping clips and then overlays plots of both the fade-in and fade-out envelopes. Brubeck's proposed display instead has a line cut through the track display from the top at the fade start point to the bottom at the fade end point. Below the line, the left-hand clip is rendered. Above the line, the right-hand clip was rendered. This would look cooler, but non-constant-gain crossfades can't be accurately represented in this way. (For the linear and S-curve crossfades, the two envelopes being applied to the clips sum to 1. This means that a single line shaped like the fade-out envelope is enough to completely visualize the crossfade. In the exponential case, this is no longer true.) I propose implementing both display systems and allowing users to choose which they prefer from the fade options menu that pops up on a right-click.
* Overlap extent - Since it will be possible for clips to overlap for longer than the actual duration of the fade, the total extent of the overlap needs to be displayed. I propose changing the track background to an unobtrusive light color inside overlapping regions. Waveform data for the (enveloped into silence) portion of a clip that extends past the fade boundary will be rendered in a different colour too. (Alternatively, if this turns out to be too obtrusive, this data could simply not be rendered.) To ensure that the existence of cross-fade is visible no matter how far out the user zooms, this background color change will have a minimum pixel width (possibly a single pixel).
+
* Overlap extent - Since it will be possible for clips to overlap for longer than the actual duration of the fade, the total extent of the overlap needs to be displayed. I propose changing the track background to an unobtrusive light color inside overlapping regions. Waveform data for the (enveloped into silence) portion of a clip that extends past the fade boundary will be rendered in a different color too. (Alternatively, if this turns out to be too obtrusive, this data could simply not be rendered.) To ensure that the existence of crossfade is visible no matter how far out the user zooms, this background color change will have a minimum pixel width (possibly a single pixel).
 
** How about replacing the color change used to indicate a fade with a small clickable icon?  Clicking the icon could be used to select options such as 'locking in' the fade, so that the two clips are joined.
 
** How about replacing the color change used to indicate a fade with a small clickable icon?  Clicking the icon could be used to select options such as 'locking in' the fade, so that the two clips are joined.
** Hmm.  Colour choices will need to be discussed.  New developers tend to over-use red - They want to draw attention to new features.  We have found that shades of blue and grey tend to give a more restful interface than an overly colourful one, with colour for various 'modes' being used with great care.  Often icons and shape changes give better visual cues than a colour-coding can.
+
***The color change indicates the total extent of overlap rather than the fade length, an important distinction when these lengths are not the same. If an icon were used, vertical lines could indicate overlap length, but this would not be ideal. Perhaps a slightly different shade of gray for the background color change would be acceptable? Also, would the icon scale with zoom level? --[[User:Jeff Hussmann|Jeff Hussmann]] 19:07, 18 April 2008 (PDT)
 
+
** Hmm.  Colour choices will need to be discussed.  New developers tend to over-use red - They want to draw attention to new features.  We have found that shades of blue and grey tend to give a more restful interface than an overly colorful one, with color for various 'modes' being used with great care.  Often icons and shape changes give better visual cues than a color-coding can.
Interface
+
***I am leaning towards simply not rendering silenced overlap regions in the Brubeck display mode. This would eliminate the red. --[[User:Jeff Hussmann|Jeff Hussmann]] 19:07, 18 April 2008 (PDT)
*When a modifier is held down (I propose ctrl-shift), clips dragged into each other will no longer be forced to respect each others boundaries. Instead, an overlap region will be created and a cross-fade applied between the two clips. By default, the cross-fade will extend from the left-most point of the right-hand clip to the right-most point of the left-hand clip. Clicking and dragging the dotted lines that mark the fade boundaries will resize the fade so that the fade interval can be any continuous interval of the overlap region. Clicking and dragging a boundary of the overlap region (as marked by the background color change) will slide the clip that forms the opposite side of the overlap. Extending and overlap region in this way will be capped at the point where one clip would be completely contained in another. Right-clicking anywhere inside the overlap region will pop up a menu from which the user can choose between the three fade shapes.
 
  
 
A mock-up of this display and interface can be found at http://www.duke.edu/~jah36/audacity_GSoC/background.PNG.
 
A mock-up of this display and interface can be found at http://www.duke.edu/~jah36/audacity_GSoC/background.PNG.
Line 32: Line 57:
  
 
A series of incremental features additions:
 
A series of incremental features additions:
*Default settings - The basic setup is geared towards artistic uses of cross-fades rather than utilitarian clean up procedures. To remedy this, an option will be added to the preferences menu to toggle automatic usage of a default set of parameters whenever a clip slide triggers cross-fade creation. In particular, default overlap and fade lengths will be set to allow rapid, repeated application of the same type of fade with a single mouse drag (for example, to apply a basic click removal fade to merge two clips).
+
*Default settings - The basic setup is geared towards artistic uses of crossfades rather than utilitarian clean up procedures. To remedy this, an option will be added to the preferences menu to toggle automatic usage of a default set of parameters whenever a clip slide triggers crossfade creation. In particular, default overlap and fade lengths will be set to allow rapid, repeated application of the same type of fade with a single mouse drag (for example, to apply a basic click removal fade to merge two clips).
** A 'would be nice' is a button on the edit toolbar to allow quick selection of cross-fade mode.  Could operate by popping up a dialog with the fade options.  Or maybe after clicking the icon on the fade, the next auto-cross-fade we do behaves like the last one, and if we don't like that we have to click the icon to change it....
+
** A 'would be nice' is a button on the edit toolbar to allow quick selection of crossfade mode.  Could operate by popping up a dialog with the fade options.  Or maybe after clicking the icon on the fade, the next auto-crossfade we do behaves like the last one, and if we don't like that we have to click the icon to change it....
* (optional, if time permits) Envelope variation - The user will be given the ability to create arbitrary (single-linked) fade shapes by clicking and dragging points on the line that cuts through the cross-fade region.  
+
* (optional, if time permits) Envelope variation - The user will be given the ability to create arbitrary (single-linked) fade shapes by clicking and dragging points on the line that cuts through the crossfade region.  
* (optional, if time permits) Non-linked fade - A preference menu option will be provided to unlink the fade-in and fade-out envelopes from each other, allowing each one to be independently shaped and sized. Note that this option will dramatically change the way the cross-fade is displayed.
+
* (optional, if time permits) Non-linked fade - A preference menu option will be provided to unlink the fade-in and fade-out envelopes from each other, allowing each one to be independently shaped and sized. Note that this option will dramatically change the way the crossfade is displayed.
 +
 
 +
 
 +
 
 +
== Current Implementations ==
 +
 
 +
There is a Nyquist cross-fade plug-in available on the [https://forum.audacityteam.org/viewtopic.php?f=42&t=61498| Audacity Forum]
  
 
==External References==
 
==External References==
Some discussions of cross-fade uses, fade shapes, and glimpses of other programs' fading interfaces:
+
Some discussions of crossfade uses, fade shapes, and glimpses of other programs' fading interfaces:
  
 +
* http://www.cumbrowski.com/lp/audacitycrossfade.asp (Adobe Premiere CS3)
 
* http://www.soundonsound.com/sos/mar00/articles/stereoedit.htm
 
* http://www.soundonsound.com/sos/mar00/articles/stereoedit.htm
 
* http://www.transom.org/tools/editing_mixing/200111.voiceediting.jtowne.html
 
* http://www.transom.org/tools/editing_mixing/200111.voiceediting.jtowne.html
Line 51: Line 83:
 
*http://books.google.com/books?id=iGV0pgXqXVAC&pg=PA170&lpg=PA170&dq=sonar+cross+fade&source=web&ots=feXK1TiMY6&sig=_2QopteH_0wXKzgusmyoLZPkqAc&hl=en#PPA169,M1
 
*http://books.google.com/books?id=iGV0pgXqXVAC&pg=PA170&lpg=PA170&dq=sonar+cross+fade&source=web&ots=feXK1TiMY6&sig=_2QopteH_0wXKzgusmyoLZPkqAc&hl=en#PPA169,M1
 
** Equivalent section from a book on Digital Performer.
 
** Equivalent section from a book on Digital Performer.
 +
* Not a web page, but an image of {{external|[http://www.goldwave.com/ Goldwave]}}'s simple crossfade, which fades clipboard content into the beginning or end of a track open in the editor as an effect. "Preview the crossfade using the play button. Only the overlapped, crossfaded area is previewed. Note that you'll need to press the play button again to preview changed settings."
 +
:[[Image:Goldwave_Crossfade.png|320px|Goldwave Crossfade Effect Interface]]
 +
<br clear="all" /> 
  
 
Do any of these use translucency of the clips, and if so, does that work well or not?   
 
Do any of these use translucency of the clips, and if so, does that work well or not?   
Line 57: Line 92:
  
 
* The interface needs to cope with both crossfades that are within the clips and cases where the crossfade would go beyond the end of the clip.
 
* The interface needs to cope with both crossfades that are within the clips and cases where the crossfade would go beyond the end of the clip.
* For artefact removal, being able to overlap the clips at high-resolution, so that the waves are in sync, and to then move the centre of the cross fade without moving the clips is a plus.
+
** Do you mean cases where the clip would go beyond the end of the crossfade? --[[User:Jeff Hussmann|Jeff Hussmann]] 10:11, 19 April 2008 (PDT)
 +
* For artifact removal, being able to overlap the clips at high-resolution, so that the waves are in sync, and to then move the centre of the cross fade without moving the clips is a plus.
 
* ...other insights.
 
* ...other insights.
  
Line 63: Line 99:
 
* ...How these affect/do-not-affect proposed interface.
 
* ...How these affect/do-not-affect proposed interface.
  
==Feature Request 'Cross Fade'==
+
==Feature Requests about Crossfade==
* ...Relevant text distilled from our feature requests pages
+
There are only these references:
 +
*"Extend batch processing to include features dependent on selecting parts of tracks (e.g. trim, fades)" (26 votes).
 +
*"Add crossfade when looping to prevent possible clicks/pops." (from Release Checklist Not Aiming).
 +
* Anecdotally, a few users would prefer "Cross Fade In" and "Cross Fade Out" were not called  that because they are only a smoother fade.
 +
 
  
 
==Other Topics==
 
==Other Topics==
** undo-stack
+
* undo-stack
** stereo track support
+
* stereo track support
*** display different from mono tracks
+
** display different from mono tracks
*** picker for fade type
+
** picker for fade type
  
  
** files/classes affected
+
* files/classes affected
*** planned changes to affected files
+
** Initial work on changing clip sliding behavior can be found at http://www.duke.edu/~jah36/audacity_GSoC/
 +
** I tentatively plan on each WaveTrack maintaining a list of OverlapRegion objects (similar to the list of WaveClips currently maintained) that would contain the necessary rendering and crossfade application information.
  
  
Line 80: Line 121:
 
** fade in/out with out another clip
 
** fade in/out with out another clip
  
 
+
{{Proposal}}
[[Category:Feature Planning]]
 

Latest revision as of 09:08, 1 May 2018

Proposal pages help us get from feature requests into actual plans. This page is a proposal for a simplified interface for cross-fading from one track to another.
Proposal pages are used on an ongoing basis by the Audacity development team and are open to edits from visitors to the wiki. They are a good way to get community feedback on a proposal.


  • Note: Proposals for Google Summer of Code projects are significantly different in structure, are submitted via Google's web app and may or may not have a corresponding proposal page.



Proposed Feature

Simple to use interface to fade out one track and fade in another.


Developer/QA Backing

Use Cases

  • One of the most common operations people want to do when mixing audio is to smoothly transition between two sound clips.

Project suggestion GSoC ideas page: GSoC_Ideas_2008#Intuitive_cross-fading


Core Features

The basic functionality is implied by the the crossfade mockup at http://limpet.net/mbrubeck/temp/cross-fade/.

Interface

  • Initial creation - There are two ways that this is done in existing software. In the first, an overlapping region of two clips is selected and some key press or menu selection pops up a crossfade creation window. In the second, dragging clips over each other to create an overlapping region creates a crossfade automatically. I think that the second option is the best choice for the first stage of implementation. It offers a smoother user experience at the expense of immediate fine control over fade options.
  • When a modifier is held down (I propose ctrl-shift), clips dragged into each other will no longer be forced to respect each others' boundaries. Instead, an overlap region will be created and a crossfade applied between the two clips. By default, the crossfade will extend from the left-most point of the right-hand clip to the right-most point of the left-hand clip.
  • Clicking and dragging dotted lines that mark the fade boundaries will resize the fade so that the fade interval can be any continuous interval of the overlap region.
  • Clicking and dragging inside the fade region will slide the fade within the overlap region.
  • Clicking and dragging a boundary of the overlap region (as marked by either a background color change or another set of vertical lines) will slide the clip that forms the opposite side of the overlap. Extending an overlap region in this way will be capped at the point where one clip would be completely contained in another.
  • Right-clicking anywhere inside the overlap region will pop up a menu from which the user can choose between fade shapes.


Crossfade functionality In the first development stage, the fade-in and fade-out will be linked according to selected fade type. Three fade shapes will be offered.

  • Linear - A constant-gain cross fade in which a linear envelope decreasing from 1 to 0 over the course of the fade is applied to the left-hand clip and a linear envelope increasing from 0 to 1 is applied to the right-hand clip.
  • Exponential - A constant-power cross fade in which a exponentially decreasing envelope is applied to the left-hand clip and the mirror image of this envelope is applied to the right-hand clip.
  • S-Curve - A commonly discussed fade shape - see for instance http://transom.org/tools/editing_mixing/200309.stupidfadetricks.html. An envelope of 1/2+1/2 cos (2*pi*w/T) is applied to the left-hand clip where w is the number of samples from the start of the fade and T is the fade length in samples. The mirror image of this envelope is applied to the right-hand clip.

Display

  • Fade representation - Most existing software renders waveform data from both overlapping clips and then overlays plots of both the fade-in and fade-out envelopes. Brubeck's proposed display instead has a line cut through the track display from the top at the fade start point to the bottom at the fade end point. Below the line, the left-hand clip is rendered. Above the line, the right-hand clip was rendered. This would look cooler, but non-constant-gain crossfades can't be accurately represented in this way. (For the linear and S-curve crossfades, the two envelopes being applied to the clips sum to 1. This means that a single line shaped like the fade-out envelope is enough to completely visualize the crossfade. In the exponential case, this is no longer true.) I propose implementing both display systems and allowing users to choose which they prefer from the fade options menu that pops up on a right-click.
  • Overlap extent - Since it will be possible for clips to overlap for longer than the actual duration of the fade, the total extent of the overlap needs to be displayed. I propose changing the track background to an unobtrusive light color inside overlapping regions. Waveform data for the (enveloped into silence) portion of a clip that extends past the fade boundary will be rendered in a different color too. (Alternatively, if this turns out to be too obtrusive, this data could simply not be rendered.) To ensure that the existence of crossfade is visible no matter how far out the user zooms, this background color change will have a minimum pixel width (possibly a single pixel).
    • How about replacing the color change used to indicate a fade with a small clickable icon? Clicking the icon could be used to select options such as 'locking in' the fade, so that the two clips are joined.
      • The color change indicates the total extent of overlap rather than the fade length, an important distinction when these lengths are not the same. If an icon were used, vertical lines could indicate overlap length, but this would not be ideal. Perhaps a slightly different shade of gray for the background color change would be acceptable? Also, would the icon scale with zoom level? --Jeff Hussmann 19:07, 18 April 2008 (PDT)
    • Hmm. Colour choices will need to be discussed. New developers tend to over-use red - They want to draw attention to new features. We have found that shades of blue and grey tend to give a more restful interface than an overly colorful one, with color for various 'modes' being used with great care. Often icons and shape changes give better visual cues than a color-coding can.
      • I am leaning towards simply not rendering silenced overlap regions in the Brubeck display mode. This would eliminate the red. --Jeff Hussmann 19:07, 18 April 2008 (PDT)

A mock-up of this display and interface can be found at background.PNG.

Non Core

A series of incremental features additions:

  • Default settings - The basic setup is geared towards artistic uses of crossfades rather than utilitarian clean up procedures. To remedy this, an option will be added to the preferences menu to toggle automatic usage of a default set of parameters whenever a clip slide triggers crossfade creation. In particular, default overlap and fade lengths will be set to allow rapid, repeated application of the same type of fade with a single mouse drag (for example, to apply a basic click removal fade to merge two clips).
    • A 'would be nice' is a button on the edit toolbar to allow quick selection of crossfade mode. Could operate by popping up a dialog with the fade options. Or maybe after clicking the icon on the fade, the next auto-crossfade we do behaves like the last one, and if we don't like that we have to click the icon to change it....
  • (optional, if time permits) Envelope variation - The user will be given the ability to create arbitrary (single-linked) fade shapes by clicking and dragging points on the line that cuts through the crossfade region.
  • (optional, if time permits) Non-linked fade - A preference menu option will be provided to unlink the fade-in and fade-out envelopes from each other, allowing each one to be independently shaped and sized. Note that this option will dramatically change the way the crossfade is displayed.


Current Implementations

There is a Nyquist cross-fade plug-in available on the Audacity Forum

External References

Some discussions of crossfade uses, fade shapes, and glimpses of other programs' fading interfaces:

Goldwave Crossfade Effect Interface


Do any of these use translucency of the clips, and if so, does that work well or not?

Insights From These Links

  • The interface needs to cope with both crossfades that are within the clips and cases where the crossfade would go beyond the end of the clip.
    • Do you mean cases where the clip would go beyond the end of the crossfade? --Jeff Hussmann 10:11, 19 April 2008 (PDT)
  • For artifact removal, being able to overlap the clips at high-resolution, so that the waves are in sync, and to then move the centre of the cross fade without moving the clips is a plus.
  • ...other insights.

Summary From These Links

  • ...How these affect/do-not-affect proposed interface.

Feature Requests about Crossfade

There are only these references:

  • "Extend batch processing to include features dependent on selecting parts of tracks (e.g. trim, fades)" (26 votes).
  • "Add crossfade when looping to prevent possible clicks/pops." (from Release Checklist Not Aiming).
  • Anecdotally, a few users would prefer "Cross Fade In" and "Cross Fade Out" were not called that because they are only a smoother fade.


Other Topics

  • undo-stack
  • stereo track support
    • display different from mono tracks
    • picker for fade type


  • files/classes affected
    • Initial work on changing clip sliding behavior can be found at http://www.duke.edu/~jah36/audacity_GSoC/
    • I tentatively plan on each WaveTrack maintaining a list of OverlapRegion objects (similar to the list of WaveClips currently maintained) that would contain the necessary rendering and crossfade application information.


  • possible optional extensions
    • fade in/out with out another clip