Skip to content

Instantly share code, notes, and snippets.

@medericmotte
medericmotte / PythoniSmudge.py
Last active October 25, 2018 01:06
Implementation of a Smudge tool in Pythonista, tutorial-ish, and sensitive to the Apple Pencil force by setting applePencil=True
import ui
import math
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import Image
import ImageOps
import ImageChops
import io
import scene
@medericmotte
medericmotte / PythoniSmudgeFast.py
Last active October 25, 2018 00:43
Very fast implementation of the smudge tool in Pythonista using an IOSurfaceWrapper by @JonB (copied in the file). Apple Pencil sensitive by setting applePencil=True
import ui
import math
import numpy as np
from PIL import Image
import Image
import ImageOps
import ImageChops
import io
import scene
import time
@medericmotte
medericmotte / Synthonista_Realtime_antialiased_sawtooth_and_filter.py
Last active October 25, 2018 15:17
Slight modification of the code of jsbain (@JonB on Pythonista) to have a sawtooth instead of a sine, and a filter.
from objc_util import *
from ctypes import *
from coreaudioconstants import *
import numpy as np
#In the render method of the AudioRenderer, change 110 to f if you want to control the frequency
''' Adapted from https://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html
'''
from objc_util import *
from ctypes import *
from coreaudioconstants import *
import numpy as np
''' Adapted from https://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html
'''
AudioUnitRenderActionFlags=c_uint32
from objc_util import *
from ctypes import *
from coreaudioconstants import *
import numpy as np
''' Adapted from https://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html
'''
AudioUnitRenderActionFlags=c_uint32
import os, math, wave, array
import sound
import ui
import photos
import console
from scene import *
import time
# generate wav file containing sine waves
import os, math, wave, array
import sound
import ui
import photos
import console
from scene import *
import time
import numpy as np