Skip to main content

This is a simple package to help musicians that do not use a lot of code.

Project description

OM-py

Download

OM-py is a bridge between Python and OM environments. What it does is format some types of data that are differently represented. For example, one list of numbers in OM is represented by (1 2 3 4 5). In Python, the same list is represented by [1, 2, 3, 4, 5]. Sounds inside OM are represented by a class, for example, #<sound 23186913>. To send this #<sound 23186913> to Python, we need to save it in a temp folder and then give it to Python by a pathname.

Besides that, it will run the python code, and bring the formatted result to OM. For that, we have two main OM-boxes: py and py-code. The py is like and object and will send to OM-Sharp all python vars insinde to_om(). The example below, will return 4 to OM.

(py_var () 
"
from om_py.python_to_om import to_om
sum = 2 + 2 
to_om(sum) # If you want to use something inside OM, you need to print it.

"  )

Use variables inside OM is simple:

(py_var (my_om_number) 
"
from om_py.python_to_om import to_om
sum = 2 + my_om_number
to_om(sum) # If you want to use something inside OM, you need to print it.

"  )

With my_om_number inside py_var it will open and input in the py box.


OM-py work with vscode too. For that select py or py-code box and press c.


Use your own enviroment

If you want, you can define your own Python enviroment in external:

image

**Copy and paste your PATH_ENVIROMENT +:

  1. Scripts/activate.bat for Windows;
  2. bin/activate for Ubuntu.

A beautiful example for spatialization:

With this library will be able to:

  • Use python scripts using OM variables.
  • Use VST3, vamp-plugins, tools for analisys and others;
  • Easy Visual Python Multithreading with OM-CKN;
  • All that Python could do.

Install OM-Sharp

Go to https://github.com/cac-t-u-s/om-sharp/releases/ and download it from your plataform!

Install OM Libraries

To install OM External Libraries see the process in: https://cac-t-u-s.github.io/pages/libraries!

Install Python

Windows

To install Python on Windows you need first download Python 3.9 in the Python website.

https://www.python.org/downloads/release/python-399/

At the bottom of the page, you will see the Windows installer (64-bit).

  • Download it!

Python

  • Then double click in the "python-3.9.9-amd64.exe".
  • Make sure to mark the option Add Python 3.9 to PATH.
  • Click on Install Now.

Path Variables

  • Click in Close.

To make sure that all things are working:

  • Open OM-Sharp
  • Load om-py;
  • Then go to Help-> Help Patches... -> om-py
  • Then open the path use-py-inside-om.
  • Then evaluate the patch!

If you heard a sound probably, it is working!! If not, please let me know!

Linux

In Linux the process is a little more simple!

  • Open the terminal;
  • If you have no python in your machine (improbable) type sudo apt install python3.8
  • Then install pip typing, sudo apt-get -y install python3-pip
  • Install Virtual Env: sudo apt install python3.8-venv
  • Then create the om-py Virtual Env: python3.8 -m venv YOUR_OM_TEMP_FOLDER/Python

Tmp Files

In my case: python3.8 -m venv /home/neimog/Documents/OM#/temp-files/Python.

To make sure that all things are working:

  • Open OM-Sharp
  • Load om-py;
  • Then go to Help-> Help Patches... -> om-py
  • Then open the path use-py-inside-om.
  • Then evaluate the patch!

MacOS

Coming soon!! I need a MacOS computer!

OM-PY: Briging python to visual programming
Copyright (c) 2021-2022 São Paulo, University of São Paulo

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the names of the Centre for
Digital Music and Queen Mary, University of London shall not be
used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

om_py-0.0.13.tar.gz (17.6 kB view hashes)

Uploaded Source

Built Distribution

om_py-0.0.13-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page