Sure, will be happy to try. I don’t see any streaming examples in the repo or at readthedocs – how do I do it?

Fire up the interactive console by typing pippi at a terminal. Any python scripts in the current working directory with a play function that take a ctl dict and return a sound can be played interactively. (This is my live performance environment.) A little more info: https://github.com/hecanjog/pippi#interactive-example

(pippi loads these scripts as modules, and can optionally reload them on the fly as they are updated)

Oh also I like to spit some debug info to the log when I’m working on instruments sometimes – anything passed to dsp.log() will get appended to pippi.log in your user directory, so when I start a pippi session, I like to open two other terminals: one where I’m tailing the log tail -f ~/pippi.log and one with a text editor to work on my generator / instrument scripts.

Thanks – I saw the console, but thought I wouldn’t be able to run it in OS X. First attempt failed on an attempt to import liblo – the critical path to getting past that was

$ pip install cython
$ pip install git+https://github.com/dsacre/pyliblo

Now when I ran pippi, I got an error due to a missing default.config:

(pippi) Bens-MacBook-Air:pippi ben$ pippi
Using experimental portaudio bindings. Please install alsaaudio if you have problems with sound playback.
Traceback (most recent call last):
  File "/Users/ben/Envs/pippi/bin/pippi", line 4, in <module>
    __import__('pkg_resources').run_script('pippi==1.0b1.post1', 'pippi')
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1504, in run_script
    exec(code, namespace, namespace)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/pippi", line 332, in <module>
    console = Pippi()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/pippi", line 29, in __init__
    self.config = config.init()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/config.py", line 59, in init
    config = init_user_config()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/config.py", line 38, in init_user_config
    shutil.copy(default_path, config_path)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 119, in copy
    copyfile(src, dst)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/default.config'
(pippi) Bens-MacBook-Air:pippi ben$

When I copied pippi/default.config into the right location and tried again, I got a KeyError:

(pippi) Bens-MacBook-Air:pippi ben$ pippi
Using experimental portaudio bindings. Please install alsaaudio if you have problems with sound playback.
Traceback (most recent call last):
  File "/Users/ben/Envs/pippi/bin/pippi", line 4, in <module>
    __import__('pkg_resources').run_script('pippi==1.0b1.post1', 'pippi')
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1504, in run_script
    exec(code, namespace, namespace)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/pippi", line 332, in <module>
    console = Pippi()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/pippi", line 32, in __init__
    self.io = IOManager()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/io.py", line 31, in __init__
    self.config                 = config.init()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/config.py", line 53, in init
    config = parse(user_config_path)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/config.py", line 29, in parse
    parsed[key] = default_config[key]
KeyError: 'divs'
(pippi) Bens-MacBook-Air:pippi ben$

I then added

divs = [1, 2, 4, 3, 8, 16]

to default.config, and got pippi to run; when I played the example, I saw an error, but it played! I’m listening to it now. The successful session looks like this:

(pippi) Bens-MacBook-Air:pippi ben$ pippi
Using experimental portaudio bindings. Please install alsaaudio if you have problems with sound playback.
Pippi Console
^_- play example 3
^_- Process Process-2:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/midi.py", line 49, in device_scribe
    with mido.open_input(device_name) as incoming:
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/mido-1.1.14-py2.7.egg/mido/backends/backend.py", line 112, in open_input
    return self.module.Input(name, **self._add_api(kwargs))
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/mido-1.1.14-py2.7.egg/mido/backends/backend.py", line 63, in module
    self.load()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/mido-1.1.14-py2.7.egg/mido/backends/backend.py", line 79, in load
    self._module = _import_module(self.name)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/mido-1.1.14-py2.7.egg/mido/backends/backend.py", line 25, in _import_module
    return importlib.import_module(module, package)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/mido-1.1.14-py2.7.egg/mido/backends/portmidi.py", line 15, in <module>
    from . import portmidi_init as pm
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/mido-1.1.14-py2.7.egg/mido/backends/portmidi_init.py", line 20, in <module>
    lib = CDLL(dll_name)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(libportmidi.dylib, 6): image not found

^_- stop
^_-

(A subsequent play in the same session did not produce the error.)

1 Like

This is really encouraging, awesome!

I’ll take a look at the config file & midi bugs today – I forgot to add liblo as a requirement in setup.py as well, just started adding OSC support again recently.

Thanks again for testing! Should have another update soon.

Ah also looks like a brew install portmidi should keep mido from complaining again in the future. I’ll add that to the readme too…

Yep, installing portmidi got rid of that message from mido. I’m now getting

IOError: unknown port 'Midi Through Port-0'

which I think just means I don’t have any MIDI devices set up:

^_- midi
Input devices:

Output devices:
^_-

Just pushed some updates (hopefully) addressing the issues you’ve pointed out!

Thanks! Weird: after I uninstalled, cleaned, pulled, installed, and copied the new default.config, I got another KeyError, even though divcc is present in the config file:

(pippi) Bens-MacBook-Air:pippi ben$ pippi
Using experimental portaudio bindings. Please install alsaaudio if you have problems with sound playback.
Traceback (most recent call last):
  File "/Users/ben/Envs/pippi/bin/pippi", line 4, in <module>
    __import__('pkg_resources').run_script('pippi==1.0b1.post1', 'pippi')
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1504, in run_script
    exec(code, namespace, namespace)
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/pippi", line 332, in <module>
    console = Pippi()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/EGG-INFO/scripts/pippi", line 32, in __init__
    self.io = IOManager()
  File "/Users/ben/Envs/pippi/lib/python2.7/site-packages/pippi-1.0b1.post1-py2.7-macosx-10.9-x86_64.egg/pippi/io.py", line 35, in __init__
    self.divcc                  = self.config['divcc']
KeyError: 'divcc'
(pippi) Bens-MacBook-Air:pippi ben$

hey erik, just got back and i’ll see if i can get this working tomorrow, at least give you one more osx tester

1 Like

Hm, that’s odd – pippi will create a config file for you in your user directory (pippi.config) if there isn’t one already. You shouldn’t need to change the actual default.config file. It will just use those values as fallbacks – or it should anyway.

Could you try pulling and installing again?

Awesome! I’ll write something up soon about the new pattern generator / midi sequencing stuff I’m working on now too which might be fun to hook up to your rig.

I just tried the whole sequence on another computer, and am still getting the error about default.config. I think default.config might need to be specified in setup.py, but my first few experiments haven’t worked. Stay tuned.

Thanks! I had the chance to play with a friend’s mac today and install pippi. I think I’ll add OSX specific instructions to the readme since the install process is different enough…

Anyway I also finally fixed the default config import issue so you will be able to install without having to manually copy that file now!

I noticed that on my friend’s machine which is running the latest version of the macos – 10.11 I think? – I’m seeing a warning from portaudio that it’s using a deprecated interface to osx audio units or something when opening a stream. Have you seen any warnings in the interactive console when opening a stream? (Playing a pippi instrument / generator script.)

Default config is now fine – I get a ~/pippi.config – and I don’t see those warnings about the deprecated interface. I wonder if that’s an OS version issue (I’m running 10.9.5) or something about how portaudio was installed (I ran “brew install portaudio” and “pip install pyaudio” in a virtualenv).

I still get a non-fatal IO error about the non-existent MIDI port, and I saw another (fatal) IO error when I typed “play sample 3” instead of “play example 3” – I might send you some pull requests about error handling, if that’s okay.

Thanks, that would be great – there is a lot of work left to do with error handling all over, development tends to happen in spurts before rehearsals and the like. :slight_smile:

On my friend’s computer I’m getting really unstable behavior with both portmidi and rtmidi backends that I can’t reproduce on linux. (I was also using the homebrew packages)

I added a bit more error handling for MIDI recently. I’d love any help with error handling & tests you have time for! I plan to flesh out the test suite a lot, it’s mostly just a handful of checks for pitch handling stuff in the tune module right now…

The python package index distribution is now up to date with github. I’ll start publishing new releases every weekend through the end of July. https://pypi.python.org/pypi/pippi

1 Like

I had a really great day today.

Deleted a ton of code and added a bunch of functionality.

New release soon, probably tomorrow!

Anyone out there still kicking the tires? :slight_smile:

1 Like

I’m just about to test it out. Will be focused on MIDI - experimenting with using an RPi to run my grids. Looking forward to checking it all out - thanks so much for sharing your work!

1 Like

I love it when things work out that way :slight_smile:

1 Like