Answers.Body: <blockquote>
    <p>How can a keyframe occur at 1252.57 for a clip that has a duration of 766 frames?</p>
  </blockquote>
  
  <p>Because the user could have used a clip that was longer than 1252 frames, set a keyframe, then trimmed the clip down to 766 frames. If the user later decides to make the clip longer again by changing the out point to a later time, the keyframe will still be in the place they originally placed it. So your calculations should treat the keyframes as they are, even if they are outside of the clip times.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-08T00:19:59.217Z
Answers.LastActivityDate: 2016-12-08T00:19:59.217Z
Answers.UserDisplayName: user1118321
Body: <p>I'm a software developer working on an application which takes a Final Cut Pro 7 xml file as input, and reads the audio in that XML file (for reporting purposes). </p>
  
  <p>For any given <code>&lt;clipitem&gt;</code> which represents an audio file there is often an <code>&lt;effect&gt;</code> which represents audio levels. The audio level <code>&lt;effect&gt;</code> element has a child <code>&lt;parameter&gt;</code> element which contains multiple <code>&lt;keyframe&gt;</code> elements.</p>
  
  <pre><code>&lt;filter&gt;
    &lt;effect&gt;
      &lt;name&gt;Audio Levels&lt;/name&gt;
      &lt;effectid&gt;audiolevels&lt;/effectid&gt;
      &lt;effectcategory&gt;audiolevels&lt;/effectcategory&gt;
      &lt;effecttype&gt;audiolevels&lt;/effecttype&gt;
      &lt;mediatype&gt;audio&lt;/mediatype&gt;
      &lt;parameter&gt;
        &lt;name&gt;Level&lt;/name&gt;
        &lt;parameterid&gt;level&lt;/parameterid&gt;
        &lt;valuemin&gt;0&lt;/valuemin&gt;
        &lt;valuemax&gt;3.98109&lt;/valuemax&gt;
        &lt;keyframe&gt;
          &lt;when&gt;0&lt;/when&gt;
          &lt;value&gt;0&lt;/value&gt;
        &lt;/keyframe&gt;
        &lt;keyframe&gt;
          &lt;when&gt;94.1429&lt;/when&gt;
          &lt;value&gt;0.125893&lt;/value&gt;
        &lt;/keyframe&gt;
      &lt;/parameter&gt;
    &lt;/effect&gt;
  &lt;/filter&gt;
  </code></pre>
  
  <p>I need to figure out what the audio level at any given point in time is for the given <code>&lt;clipitem&gt;</code>. </p>
  
  <p>What I don't get is that the <code>&lt;clipitem&gt;</code> may have <code>&lt;start&gt;</code> set to 1757 and <code>&lt;end&gt;</code> set to 2523. That's a duration of 766 frames.</p>
  
  <p>However, for that very same clip I see the below which to me indicates that the audio level changes to <strong>0.0562341</strong> in frame <strong>1252.57</strong>. </p>
  
  <pre><code>&lt;keyframe&gt;
    &lt;when&gt;1252.57&lt;/when&gt;
    &lt;value&gt;0.0562341&lt;/value&gt;
  &lt;/keyframe&gt;
  </code></pre>
  
  <p>How can a keyframe occur at 1252.57 for a clip that has a duration of 766 frames?</p>
  
  <p>The <a href="https://developer.apple.com/library/content/documentation/AppleApplications/Reference/FinalCutPro_XML/Topics/Topics.html#//apple_ref/doc/uid/TP30001149-CH294-SW1" rel="nofollow noreferrer">documentation</a> says...</p>
  
  <blockquote>
    <p>The first keyframe always has a value of 0 for when, and the last
    keyframe always has the duration of the clipitem as the value for when</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T12:08:11.203Z
Comments.Text: I know this is not going to help but you are aware that FCP7 is not supported by Apple anymore (I know there are a few people out there still using it but it is loosing to Adobe PR and FCPX)
Comments.UserDisplayName: Adam Mann Pro
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T14:40:29.613Z
Comments.Text: @AdamMannPro yes, i know FCPX is the newest version. It is my impression though that a lot of people still hang on to FCP7?
Comments.UserDisplayName: sbrattla
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T15:27:47.190Z
Comments.Text: If you have access to FCP7, create a trivial project with keyframes in known positions and check.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T15:29:43.910Z
Comments.Text: @Mulvya that's the issue...I don't have access to neither mac nor FCP7. I have a single FCP7 xml file and the corresponding screendump of the timeline...but the project is complex and I find it hard to "debug".
Comments.UserDisplayName: sbrattla
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T17:12:22.630Z
Comments.Text: It might be worth doing a survey or likewise to find out how many still use fcp7 as I know of no-one myself who use it as they have moved to adobe or fcpx when apple announced the change. There are many facebook groups who can have a poll run on them. But from what I have seen it might be a wasted venture developing something for a app that was killed off in 2010 and has no support from apple or any other devs.
Comments.UserDisplayName: Adam Mann Pro
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T17:13:15.110Z
Comments.Text: Also if your developing a app or likewise I would have thought that having access to the application would be a must ?
Comments.UserDisplayName: Adam Mann Pro
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-08T00:47:58.350Z
Comments.Text: @AdamMannPro there are many corporate users of FCP7 still, even though most are just biding their time until they can switch to Premiere. A Facebook poll won't likely reflect that.
Comments.UserDisplayName: Michael Liebman
Tags: <file-formats><final-cut-pro><export>
Title: How should I understand audio levels in FCP7 xml?
UserDisplayName: sbrattla
ThreadText: # How should I understand audio levels in FCP7 xml?
  
  (Asked by: username_0 on 2016-12-07)
  
  I'm a software developer working on an application which takes a Final Cut Pro 7 xml file as input, and reads the audio in that XML file (for reporting purposes).
  
  For any given `<clipitem>` which represents an audio file there is often an `<effect>` which represents audio levels. The audio level `<effect>` element has a child `<parameter>` element which contains multiple `<keyframe>` elements.
  
  ```
  <filter>
    <effect>
      <name>Audio Levels</name>
      <effectid>audiolevels</effectid>
      <effectcategory>audiolevels</effectcategory>
      <effecttype>audiolevels</effecttype>
      <mediatype>audio</mediatype>
      <parameter>
        <name>Level</name>
        <parameterid>level</parameterid>
        <valuemin>0</valuemin>
        <valuemax>3.98109</valuemax>
        <keyframe>
          <when>0</when>
          <value>0</value>
        </keyframe>
        <keyframe>
          <when>94.1429</when>
          <value>0.125893</value>
        </keyframe>
      </parameter>
    </effect>
  </filter>
  
  ```
  
  I need to figure out what the audio level at any given point in time is for the given `<clipitem>`.
  
  What I don't get is that the `<clipitem>` may have `<start>` set to 1757 and `<end>` set to 2523. That's a duration of 766 frames.
  
  However, for that very same clip I see the below which to me indicates that the audio level changes to **0.0562341** in frame **1252.57**.
  
  ```
  <keyframe>
    <when>1252.57</when>
    <value>0.0562341</value>
  </keyframe>
  
  ```
  
  How can a keyframe occur at 1252.57 for a clip that has a duration of 766 frames?
  
  The [documentation](https://developer.apple.com/library/content/documentation/AppleApplications/Reference/FinalCutPro_XML/Topics/Topics.html#//apple_ref/doc/uid/TP30001149-CH294-SW1) says...
  
  > The first keyframe always has a value of 0 for when, and the last
  > keyframe always has the duration of the clipitem as the value for when
  
  **Tags:** file-formats, final-cut-pro, export
  
  > **Comments:**
  > **username_1**: I know this is not going to help but you are aware that FCP7 is not supported by Apple anymore (I know there are a few people out there still using it but it is loosing to Adobe PR and FCPX)  
  > **username_0**: @username_1 yes, i know FCPX is the newest version. It is my impression though that a lot of people still hang on to FCP7?  
  > **username_2**: If you have access to FCP7, create a trivial project with keyframes in known positions and check.  
  > **username_0**: @Mulvya that's the issue...I don't have access to neither mac nor FCP7. I have a single FCP7 xml file and the corresponding screendump of the timeline...but the project is complex and I find it hard to "debug".  
  > **username_1**: It might be worth doing a survey or likewise to find out how many still use fcp7 as I know of no-one myself who use it as they have moved to adobe or fcpx when apple announced the change. There are many facebook groups who can have a poll run on them. But from what I have seen it might be a wasted venture developing something for a app that was killed off in 2010 and has no support from apple or any other devs.  
  > **username_1**: Also if your developing a app or likewise I would have thought that having access to the application would be a must ?  
  > **username_3**: @username_1 there are many corporate users of FCP7 still, even though most are just biding their time until they can switch to Premiere. A Facebook poll won't likely reflect that.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2016-12-08. Score: 2
  
  > How can a keyframe occur at 1252.57 for a clip that has a duration of 766 frames?
  
  Because the user could have used a clip that was longer than 1252 frames, set a keyframe, then trimmed the clip down to 766 frames. If the user later decides to make the clip longer again by changing the out point to a later time, the keyframe will still be in the place they originally placed it. So your calculations should treat the keyframes as they are, even if they are outside of the clip times.
  
  
  ---
  
  