Skip to content

Add optional Gain parameter to Clip - #105

Open
moritzsur wants to merge 1 commit into
bitwig:mainfrom
moritzsur:clip-gain
Open

Add optional Gain parameter to Clip#105
moritzsur wants to merge 1 commit into
bitwig:mainfrom
moritzsur:clip-gain

Conversation

@moritzsur

Copy link
Copy Markdown

Closes #71.

What

Adds an optional Gain child element to Clip — a RealParameter holding the gain applied to the clip's audio content. Unity gain is the implied default when the element is omitted, so existing files are unaffected and files that don't use it remain valid against the previous schema.

The gain is applied in addition to the fade-in/fade-out envelope and independently of the volume of the channel the clip plays on.

Included:

  • Clip.java: new documented gain field (<Gain> element)
  • Project.xsd / Reference.html: regenerated
  • DawProjectTest: save/load round-trip test covering the new element

Design notes

Why a RealParameter element? It is consistent with every other gain/volume in the format — Channel Volume, Send Volume, and the device InputGain/OutputGain stages are all RealParameters. That makes the unit self-describing per instance (unit="linear" or unit="decibel", plus optional min/max), and since parameters are referenceable, the clip gain can also serve as an automation target.

This covers the static per-clip gain that hosts like Bitwig Studio and Studio One expose as a single value per clip; time-varying gain remains representable with a Points timeline targeting expression="gain".

The gain is a RealParameter, consistent with channel volume, send level
and the device gain stages, so the unit is self-describing and the
parameter can be used as an automation target. It is applied in addition
to the fade-in/fade-out envelope and independently of the channel
volume; unity gain is the implied default when the element is omitted.
Regenerated Project.xsd and Reference.html and added a save/load
round-trip test.
@moritzsur

Copy link
Copy Markdown
Author

When you have a chance, could you let me know whether this is something you’d be open to merging, or whether any changes are needed from my side? @kurasu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add clip gain

1 participant