On Tue, Dec 18, 2012 at 8:46 AM, Janne Liljeblad <[email protected]> wrote: > Hi, > > I've been working on a audio mix tool for Flowblade lately. > > So far I've been combining track audios by calling the following > method on every track: > > def _mix_audio_for_track(self, track): > transition = mlt.Transition(self.profile, "mix") > transition.set("a_track", 1) > transition.set("b_track", track.id) > transition.set("always_active", 1) > transition.set("combine", 1) > self.field.plant_transition(transition, 1, track.id) > > # Hold reference and set gain > track.mix_transition = transition > track.mix_transition.set("start", str(track.audio_gain)) > track.mix_transition.set("end", str(track.audio_gain)) > > and it works fine. Now I tried to set gain for single track by calling > method below with values 0 - 1. > > def set_track_gain(self, track, gain): > track.mix_transition.set("start", str(gain)) > track.mix_transition.set("end", str(gain)) > > I though if set "start" and "end" with same value, then gain changes > for the whole duration of the track. But this has no effect at all. > > I read transition_mix.c shortly, but it is not obvious what the > correct thing to do here is. > > So how do I set track gains, do I need to use a separate volume filter > or something?
Please don't feel ashamed to see what Kdenlive does. You can use either volume or sox.vol attached to a track to apply a static level to the entire track. To provide keyframable levels or envelopes use multiple instances of the volume filter with "gain" and "end" properties. P.S. only sox.vol provides a true normalization feature that requires an initial analysis step. Other mentions of "normalisation" you might see mentioned in both of these filters were attempts to provide a dynamic normalization over a sliding window that does not work so good in many situations (but still could be useful for some live applications). -- +-DRD-+ ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Mlt-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mlt-devel
