Giter Site home page Giter Site logo

timecode_tools's Introduction

Depends on:

  • mido -- for python midi commands
  • python-rtmidi - required by mido
  • timecode -- for timecode manipulation

QuickStart

run generate_ltc.py or generate_mtc.py from the command line

use --help to get command line options

Scripts for generating LTC wave files ahead of time and MTC MIDI events in realtime.

timecode_tools's People

Contributors

emanuel12324 avatar jeffmikels 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

Watchers

 avatar  avatar  avatar

timecode_tools's Issues

ValueError: Timecode.frames should be a positive integer bigger than zero, not 0

hallo, im using mtc_listener.py and everything works fine, just when i rewind my composition to beginning, i get crash with this:
.
.
.
QF: 00:00:08:13
QF: 00:00:08:15
QF: 00:00:08:17
QF: 00:00:08:19
QF: 00:00:08:21
FF: 00:00:08:23
Traceback (most recent call last):
File "/home/kubriel/Downloads/timecode_tools/./mtc_listener.py", line 43, in
main()
File "/home/kubriel/.local/lib/python3.9/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/home/kubriel/.local/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/kubriel/.local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/kubriel/.local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/kubriel/Downloads/timecode_tools/./mtc_listener.py", line 40, in main
listen(port)
File "/home/kubriel/Downloads/timecode_tools/./mtc_listener.py", line 31, in listen
handle_message(msg)
File "/home/kubriel/Downloads/timecode_tools/./mtc_listener.py", line 19, in handle_message
tc = tools.mtc_decode(data)
File "/home/kubriel/Downloads/timecode_tools/tools.py", line 146, in mtc_decode
return Timecode(fps, frames=total_frames)
File "/home/kubriel/.local/lib/python3.9/site-packages/timecode/init.py", line 80, in init
self.frames = frames
File "/home/kubriel/.local/lib/python3.9/site-packages/timecode/init.py", line 111, in frames
raise ValueError(
ValueError: Timecode.frames should be a positive integer bigger than zero, not 0

Project

Good afternoon, check the project. Do you have any to convert LTC to MIDI? And if you have an ltc script to do more in real time than just a wav file?

License?

Hi,

I plan on using snippets of your code for a project: https://github.com/EMATech/Network-Studio-Clock

Could you please clarify under which license your code is released?
Ideally, this would be released under MIT just like the libraries it depends upon.
Unless I missed it, I’ve not been able to find this information anywhere.

Thanks!

TypeError: Timecode.frames in mtc_decode

Environment:

  • Windows 10
  • python 3.9.10
  • mido 1.2.10
  • python-rtmidi 1.4.9
  • timecode 1.3.1

Input: 24 fps quarter frame

While running mtc_listener.py call of mtc_decode rises error:

  File "***\timecode_tools\mtc_listener.py", line 46, in <module>
    main()
  File "***\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "***\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "***\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "***\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "***\timecode_tools\mtc_listener.py", line 43, in main
    listen(port)
  File "***\timecode_tools\mtc_listener.py", line 33, in listen
    handle_message(msg)
  File "***\timecode_tools\mtc_listener.py", line 15, in handle_message
    tc = tools.mtc_decode_quarter_frames(quarter_frames)
  File "***\timecode_tools\tools.py", line 208, in mtc_decode_quarter_frames
    return mtc_decode(mtc_bytes)
  File ***\timecode_tools\tools.py", line 158, in mtc_decode
    return Timecode(fps, frames=total_frames)
  File "***\Local\Programs\Python\Python39\lib\site-packages\timecode\__init__.py", line 80, in __init__
    self.frames = frames
  File "***\AppData\Local\Programs\Python\Python39\lib\site-packages\timecode\__init__.py", line 105, in frames
    raise TypeError(
TypeError: Timecode.frames should be a positive integer bigger than zero, not a float

Indeed total_frames is a float value, and frames value is forced to be int:

    @frames.setter
    def frames(self, frames):
        """setter for the _frames attribute

        :param int frames: A positive int bigger than zero showing the number
          of frames that this TimeCode represents.
        :return:
        """
        # validate the frames value
        if not isinstance(frames, int):
            raise TypeError(
                "%s.frames should be a positive integer bigger "
                "than zero, not a %s" % (self.__class__.__name__, frames.__class__.__name__)
            )

Changing return Timecode(fps, frames=total_frames) to return Timecode(fps, frames=int(total_frames)) fixes this issue.

Cheers!

program doesn't start

File "./timecode_generator.py", line 258
print(f' COMPUTING: {total_samples}:{sample} -- {pct}%', end='\r')

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.