Skip to content

Instantly share code, notes, and snippets.

@rbnpi
rbnpi / MidiIntoSP.rb
Last active February 11, 2019 02:12
Experimental program to explore using Sonic Pi 2.12.0dev-midi-alpha3 with a midi keyboard as an input device. Sounds are produced by SP using various features on the keyboard used (M-Audio Oxygen8 v2) An accompanying video illustrates the program in use and gives full details. https://youtu.be/hNaGcgnO6mo
#experimental program to try out midi in with Sonic-Pi 2.12.0-midi-alpha3 by Robin Newman March 2017
#An Oxygen8 v2 keyboards is connected to my Mac.
#This sends midi signals to the m2o module of osmid which translates the midi to OSC and
#feeds the signals to the osc_cues_port in Sonic Pi
#the midi messages can therefore be detected by judicious use of the sync command
#look at the osmid_m2o and osc_cues logs to figure out the message(s) to intercept
#further useful info in osmid readme files at The osmid distribution is at https://github.com/llloret/osmid
#in my case the keyboard was connected to port 2, and I used the first midi channel (0)
set_sched_ahead_time! 0.1 #reduced this to reduce latency
@omz
omz / PythonistaFTP.py
Last active May 17, 2023 12:43
PythonistaFTP.py
'''FTP server for Pythonista (iOS)
You can use this to exchange files with a Mac/PC or a file management app on the same device (e.g. Transmit).
If you use a Mac, you can connect from the Finder, using the "Go -> Connect to Server..." menu item.
'''
import os
from socket import gethostname
@pudquick
pudquick / pipista.py
Created November 20, 2012 07:23
pipista - pip module (for installing other modules) for Pythonista
import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
@omz
omz / FileTransfer.py
Last active August 8, 2023 14:44
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.