GithubHelp home page GithubHelp logo

iluvcapra / py-ptsl Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 7.0 517 KB

Native Python PTSL (Pro Tools Scripting Library) RPC interface

License: BSD 3-Clause "New" or "Revised" License

Python 99.79% Shell 0.21%
audio automation avid daw grpc-python protobuf3 python scripting-engine

py-ptsl's People

Contributors

iluvcapra avatar noerw avatar stephenmachete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-ptsl's Issues

Error importing session data with import_data

Error importing session data with import_data

from ptsl import open_engine

with open_engine(company_name="Name", application_name="Default") as eng:
    data = eng.import_data(
            session_path='session.ptx'
        )    
    data.import_data()
Traceback (most recent call last):
  File "/Users/ron/dev/ptsl.py", line 7, in <module>
    data.import_data()
  File "/Users/ron/dev/.intel_env/lib/python3.11/site-packages/ptsl/builders/import_builder.py", line 133, in import_data
    self._engine.client.run(op)
  File "/Users/ron/dev/.intel_env/lib/python3.11/site-packages/ptsl/client.py", line 161, in run
    raise CommandError(command_errors.errors)
ptsl.errors.CommandError: ErrType 126: PT_InvalidParameter (Unable to complete the command due to an unknown error.)

Platform:

  • Operating System: macOS 12.7.3
  • Pro Tools Version: 2023.12

Implement Client Timeouts

Implement timeouts for initial connection to Pro Tools and for responses. The client should provide reasonable default values for these (the C++ client makes it 5 seconds) and allow for customization.

[BUG]

Describe the bug
get_timeline_selection is not working. I get this error:

function get_timeline_selection in engine.py at line 947

response = self.client.run(op)
function run in client.py at line 161
raise CommandError(command_errors.errors)

function get_timeline_selection in engine.py at line 947
response = self.client.run(op)
function run in client.py at line 161
raise CommandError(command_errors.errors)

To Reproduce
Please enter code here that demonstrates the bug:

import sys
import datetime
import math

from ptsl import open_engine
from ptsl import PTSL_pb2 as pt

with open_engine(company_name="py-ptsl",
                 application_name=sys.argv[0]) as engine:
    
    selection = engine.get_timeline_selection()
    print(selection)

Expected behavior
Return of Timeline Selection

Platform:

  • Operating System: macOS 12.7.4
  • Pro Tools Version: 2023.12

Additional context
I tried changing

def get_timeline_selection(self) -> Tuple[str, str]:
            """
            Returns data about the current timeline selection.
            :returns: a Tuple of the In and Out time.
            """
            op = ops.GetMemoryLocations()
            response = self.client.run(op)
            return (response.in_time, ops.response.out_time)

to

def get_timeline_selection(self) -> Tuple[str, str]:
            """
            Returns data about the current timeline selection.
            :returns: a Tuple of the In and Out time.
            """
            op = ops.GetTimelineSelection()
            response = self.client.run(op)
            return (response.in_time, ops.response.out_time)

but just get no return value.

Can't access to timeline / Can you help me out?

Describe the bug
CommandError: ErrType 100: PT_UnknownError (VENUE is not connected)
Press any key to continue . . .

To Reproduce
from ptsl import open_engine, errors

Provide your company name and application name

company_name = "fugCompany"
application_name = "fug1"

try:
# Open the engine with the specified company and application names
with open_engine(company_name=company_name, application_name=application_name) as engine:

    # Get a list of all memory locations
    memory_locations = engine.get_memory_locations()

except errors.CommandError as e:
print(f"CommandError: {e}")
except Exception as e:
print(f"An error occurred: {e}")

assert True

Platform:
Operating System: Windows 10 Pro 64-bit
Processor: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (4 CPUs), ~2.2GHz
Memory: 8192MB RAM
ProTools Intro: V2024.3.1
Pyhton 3.12
VS Community 2022
Py-Ptsl Ptsl V1

Additional context
Same error with this code too:

from ptsl import open_engine, errors

Provide your company name and application name

company_name = "fugCompany"
application_name = "fug1"

try:
# Open the engine with the specified company and application names
with open_engine(company_name=company_name, application_name=application_name) as engine:
# Retrieve the current timeline selection using the engine object
in_time, out_time = engine.get_timeline_selection()

    # Now you can work with the timeline selection times
    print("Timeline selection In time:", in_time)
    print("Timeline selection Out time:", out_time)

except errors.CommandError as e:
print(f"CommandError: {e}")
except Exception as e:
print(f"An error occurred: {e}")

[BUG] error when trying to run "get_memory_locations"

Describe the bug
Thanks for the work on this!! Having some issues with a few commands, particularly "get_memory_locations".

To Reproduce
Please enter code here that demonstrates the bug:

import sys

from ptsl import open_engine
from ptsl import PTSL_pb2 as pt

with open_engine(company_name="py-ptsl",
                 application_name=sys.argv[0]) as engine:

    markers = engine.get_memory_locations()
    print(markers)

Expected behavior
Output of memory location data from open session.

Error Message
Traceback (most recent call last): File "/Users/heardstudio/Desktop/PTSL/py-ptsl-master/examples/memloctext.py", line 11, in <module> markers = engine.get_memory_locations() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ptsl/engine.py", line 446, in get_memory_locations self.client.run(op) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ptsl/client.py", line 161, in run raise CommandError(command_errors.errors) ptsl.errors.CommandError: ErrType 100: PT_UnknownError (VENUE is not connected)

Platform:

  • Operating System: macOS 12.7.4
  • Pro Tools Version: 2024.3.1 / 2023.12

Additional context
Tested with 2023.12 and 2024.3.1, verified many other commands are working, the included examples and a bunch of other random commands.

[BUG] Remove variadic generics from Engine typing

Describe the bug
The Engine class uses protobuf enums in its typing, these aren't supported below Python 3.11. See PEP 646.

The Engine class should maybe avoid these type statements or possibly import annotations from __future__ if that would make the code work on earlier versions of Python.

[BUG] select_tracks_by_name

Describe the bug
'select_tracks_by_name' not working
To Reproduce
Please enter code here that demonstrates the bug:

#!/usr/bin/env python3
import sys
import datetime

from ptsl import open_engine
from ptsl import PTSL_pb2 as pt

with open_engine(company_name="py-ptsl",
                 application_name=sys.argv[0]) as engine:
    #engine.select_all_clips_on_track('V')
    #engine.select_tracks_by_name('V','SM_Replace')
    engine.select_tracks_by_name('V')

Expected behavior
Track is selected.

Platform:

  • Operating System: macOS 12.7
  • Pro Tools Version: 2023.12/2024.3

Additional context
Saw this note in the engine file:

TODO: handle pagination request?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.