Trying to keyframe motion capture data in real time with Blender.

I am currently trying to record motion capture data in Blender 2.57 in real time via making keyframes. I am using a Modal Operator to query the motion sensors and get orientations for the armature’s bones, then insert a new key frame into the timeline and iterate the scene’s current_frame. My issue is that Blender’s timeline is set up for 24 FPS. This is ok, accept that this imposes a limit on capture rate. I wish to allow users to work with the sensors to configure the capture rate of the devices.
The optimal solution would be to somehow configure Blender’s timeline to allow for variable capture/playback rates. If there is a way to do this, learning how would make my day :slight_smile:
As a fallback, I am currently spacing out my captured keyframes based on an inputted capture rate and Blender’s default rate. I then wish to scale the keyframes based on the scalar difference in rates. The capturing portion functions properly, however when I try to use either “bpy.ops.action.select_all_toggle()” or “bpy.ops.action.select_border()” to select all of the keyframes, the interpreter throws an error saying my context is incorrect. This leads me to believe that some object that should be active isn’t, or perhaps Blender is in a mode it shouldn’t be in. So I could use some help either changing Blender’s timeline’s playback rate, or getting keyframes selected and scaled.

Thanks a bunch,
Sam Bushman