# MOM - mother with oled screen and multipage support v1.2

**URL:** <https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327>\
**Category:** Organelle\
**Created:** [May 17, 2019, 1:30am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327 "2019-05-17T01:30:55Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![varicela](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/varicela/32/2198_2.png) [@varicela](https://forum.critterandguitari.com/u/varicela)\
**Post date:** [May 17, 2019, 1:30am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/1 "2019-05-17T01:30:55Z")

</div>

[![mom_banner](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/b/b40c2e7d62d7364be2cd8ab5b0eb53cdea83817d.jpeg)](https://patchstorage.com/mom/)

**MOM** is yet another mother patch, but that I made for my developing needs.  
If you don’t know what this is, think of it like a **Organelle emulator** , that let you run and develop organelle patches on your computer.

> **FEATURES:**

- Pretty accurate representation of the organelle screen. There is support for /oled/gFlip /oled/gClear /oled/gSetPixel /oled/gLine /oled/gBox /oled/gFillArea /oled/gCircle /oled/gFilledCircle /oled/gPrintln /oled/gInvertArea /oled/gInvertLine /oled/gShowInfoBar, screenLines and a bunch of other calls.
- Support of the note buttons, aux, encoder, vol, foot pedal, knobs, led light, etc. All mapped to keyboard keys.
- It’s tiny and cute 🙂

> **How to launch the SCREEN**

- The emulated screen is made with pygame. To launch it you will need to do one of these:  
**A** - If you are on Windows just run oled.exe and that’s it.  
**B** - If you are not on Windows, or you don’t want to run a executable, you will need to have installed Python 3, and the pygame and python-osc modules. Once you have installed all this, just run oled.py.

- the OLED toglebox on MOM.pd is for updating/restarting the screen. Be sure to have it checked.

> **UPDATE 1.1:**

- Change the name to something less _e d g y_
- Added a .exe for those people in windows that don’t want to install python.
- **Now there is support for multipage patches!**  
I test it with Zone and Jeraphy and they run fine.  
Keep in mind that to be able to run these patches on desktop, you should disable their versioncheck object! To do this, just bypass it, and connect [loadbang] directly to the [t b b] object like this:  
 ![bypass](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/f/fa7e333cc06f2d375fbb14feef7cb5e0f364e033.png)

> **UPDATE 1.2:**

– OLED Window’s size can be set from the script.  
– Added a panic button.  
– Fix bugs in the encoder. Now it send the correct calls.  
– Added a reboot button for the Oled.  
– Added expression pedal.

> **Some test of the screen:**

[![gif_drawave](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/4/47b2c905ef4b55f661299ed6405a6026e19be000.gif)](https://forum.critterandguitari.com/t/drawave-draw-and-mutate-your-own-wavetables/4306/11)[  
  ![gif_pianelle](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/7/766725aa886813c4eeb062f73da9191f1524e946.gif)](https://forum.critterandguitari.com/t/pianelle-synthesia-like-dysplay-for-learning-new-songs/4113/2)  
[![gif_poke](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/3/3100a63b9821e21576954ccda854922f71a17565.gif)](https://forum.critterandguitari.com/t/pokehex-pokemon-based-granular-synth/4112/5)  
[![gif_pong](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/a/af5643c5fada86f2e586255b82075719fee2d465.gif)](https://forum.critterandguitari.com/t/pong-videogame-generative-synthesizer/3990/7)  
 ![gif_roll](https://canada1.discourse-cdn.com/flex035/uploads/critterandguitari/original/2X/6/6d1bda738144d00db61ff85049d770642e339352.gif)

> **[DOWNLOAD](https://patchstorage.com/wp-content/uploads/2019/05/MOM.zip)** from patchstorage

---

<div class="post-metadata">

**Author:** ![Fat\_ima](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@Fat\_ima](https://forum.critterandguitari.com/u/Fat_ima)\
**Post date:** [May 25, 2019, 10:41pm UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/2 "2019-05-25T22:41:31Z")

</div>

This looks incredible. Thanks a lot for sharing this!

---

<div class="post-metadata">

**Author:** ![pepper](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@pepper](https://forum.critterandguitari.com/u/pepper)\
**Post date:** [January 23, 2021, 10:55am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/3 "2021-01-23T10:55:29Z")

</div>

Thanks for creating this. Run on OSX and all fine except OLED. All dependencies running fine, but never got the Oled working. Comms fine. A trigger object had the wrong type but fixed. Would have liked to try the latest version but it doesn;t seem available anymore. Many thanks, P

---

<div class="post-metadata">

**Author:** ![varicela](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/varicela/32/2198_2.png) [@varicela](https://forum.critterandguitari.com/u/varicela)\
**Post date:** [January 23, 2021, 5:35pm UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/4 "2021-01-23T17:35:51Z")

</div>

Hello! thanks for your interest.  
Also, I take this chance to say sorry I have been out of touch with the community. I’m still trying to stabilize with the pandemic, and were not able to recover my organelle. So sorry for all the unanswered questions everywhere.

About Mom: some patches were a little finicky to turn on the screen. Try different sequences of: starting Mom, then the patch, then the olen window, then the ON oled on mom, then restart the oled from the Mom patch. If not work, try starting the oled first, then the patch you want, or reboot the patch, after you have the oled listening to messages.

As you notice, apparently patchstorage links are broken…  
I uploaded Mom and all my releases and unreleased patches on github. So this are the new links:

**---- MOM ----**

> **[bembidiona/organelle-emulator](https://github.com/bembidiona/organelle-emulator)**
>
> an organelle emulator written in pygame + puredata

**---- OTHER PATCHES AND INSTRUMENTS ----**

> **[bembidiona/organelle-patches](https://github.com/bembidiona/organelle-patches)**
>
> all my Organelle patches + other goodies. Contribute to bembidiona/organelle-patches development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![pepper](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@pepper](https://forum.critterandguitari.com/u/pepper)\
**Post date:** [January 23, 2021, 5:57pm UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/5 "2021-01-23T17:57:32Z")

</div>

Hi, no problem at all and thanks for your reply. I hope you are felling much better. Thanks for the links. I will try the different combinations of starting the components and see what happens. I have everything installed now so hopefully will manage to get it working. It is a great idea, thanks, P

---

<div class="post-metadata">

**Author:** ![PollinoPops](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@PollinoPops](https://forum.critterandguitari.com/u/PollinoPops)\
**Post date:** [January 28, 2021, 11:13pm UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/6 "2021-01-28T23:13:47Z")

</div>

Hi, did you manage to make it work under OSX ? I aslo get an error even though pygame and python-osc are installed. It kind off worked once but now the frame juste won’t load. It works fine in debian though.

That’s what I get if it can help anyone understand what’s wrong

> Blockquote  
> pygame 2.0.1 (SDL 2.0.14, Python 3.9.1)  
> Hello from the pygame community. [Contribute - pygame wiki](https://www.pygame.org/contribute.html)  
> assets/organelle.ttf  
> 2021-01-29 00:00:47.668 Python[1558:131288] WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future. Called from (  
> 0 AppKit 0x00007fff32448607 -[NSWindow(NSWindow\_Theme) \_postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 378  
> 1 AppKit 0x00007fff3246a27e -[NSThemeFrame \_tileTitlebarAndRedisplay:] + 98  
> 2 AppKit 0x00007fff32494ace -[NSTitledFrame \_titleDidChange] + 217  
> 3 AppKit 0x00007fff3249457c -[NSTitledFrame setTitle:] + 713  
> 4 AppKit 0x00007fff32494204 -[NSThemeFrame setTitle:] + 50  
> 5 AppKit 0x00007fff32457f6a -[NSWindow \_dosetTitle:andDefeatWrap:] + 210  
> 6 libSDL2-2.0.dylib 0x000000010ca1d35e Cocoa\_SetWindowTitle + 110  
> 7 display.cpython-39-darwin.so 0x000000010cbfeecf pg\_set\_caption + 159  
> 8 Python 0x000000010c303f7d cfunction\_call + 125  
> 9 Python 0x000000010c2c526d \_PyObject\_MakeTpCall + 365  
> 10 Python 0x000000010c39b99c call\_function + 876  
> 11 Python 0x000000010c398e33 \_PyEval\_EvalFrameDefault + 25219  
> 12 Python 0x000000010c2c5a38 function\_code\_fastcall + 104  
> 13 Python 0x000000010c399543 \_PyEval\_EvalFrameDefault + 27027  
> 14 Python 0x000000010c2c5a38 function\_code\_fastcall + 104  
> 15 Python 0x000000010c39b90c call\_function + 732  
> 16 Python 0x000000010c398e12 \_PyEval\_EvalFrameDefault + 25186  
> 17 Python 0x000000010c2c5a38 function\_code\_fastcall + 104  
> 18 Python 0x000000010c39b90c call\_function + 732  
> 19 Python 0x000000010c398e12 \_PyEval\_EvalFrameDefault + 25186  
> 20 Python 0x000000010c2c5a38 function\_code\_fastcall + 104  
> 21 Python 0x000000010c2c7ac2 method\_vectorcall + 274  
> 22 Python 0x000000010c4402b6 t\_bootstrap + 70  
> 23 Python 0x000000010c3f1a69 pythread\_wrapper + 25  
> 24 libsystem\_pthread.dylib 0x00007fff60f2b2eb \_pthread\_body + 126  
> 25 libsystem\_pthread.dylib 0x00007fff60f2e249 \_pthread\_start + 66  
> 26 libsystem\_pthread.dylib 0x00007fff60f2a40d thread\_start + 13  
> )  
> 2021-01-29 00:00:47.668 Python[1558:131288] WARNING: nextEventMatchingMask should only be called from the Main Thread! This will throw an exception in the future.  
> 2021-01-29 00:00:47.669 Python[1558:131285] !!! BUG: The current event queue and the main event queue are not the same. Events will not be handled correctly. This is probably because \_TSGetMainThread was called for the first time off the main thread.  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> 2021-01-29 00:00:47.673 Python[1558:131285] pid(1558)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
> Serving on (‘127.0.0.1’, 3000)  
> ^CTraceback (most recent call last):  
> File “/Users/clemens/Downloads/Organelle/organelle-emulator-master/oled.py”, line 204, in   
> server.serve\_forever()  
> File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py”, line 232, in serve\_forever  
> ready = selector.select(poll\_interval)  
> File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/selectors.py”, line 416, in select  
> fd\_event\_list = self.\_selector.poll(timeout)

---

<div class="post-metadata">

**Author:** ![pepper](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@pepper](https://forum.critterandguitari.com/u/pepper)\
**Post date:** [January 29, 2021, 12:12am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/7 "2021-01-29T00:12:34Z")

</div>

I haven’t got it working at all, in fact, I gave up as it was wasting my time. Am using “Stepmum” instead and works straight away without all the config nonesense…

---

<div class="post-metadata">

**Author:** ![sebshader](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sebshader](https://forum.critterandguitari.com/u/sebshader)\
**Post date:** [August 28, 2021, 5:37am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/8 "2021-08-28T05:37:28Z")

</div>

I got this working on OSX; see this pull request on the repository:

> <https://github.com/bembidiona/organelle-emulator/pull/2>
>
> On MacOs only the main thread/event loop can draw to the screen.
> This puts the …osc server in the new thread, and sends the drawing instructions to the main thread as instances of a new pygame event type.
> closes #1

the issue is that only the main thread can display on osx. My workaround was to put the drawing in the main thread, and in the thread that the socket is receiving on queue an event that contains the drawing instruction. (and then in the main/drawing thread dispatch the instruction to the right function in the main event loop)  
thanks for all the work @varicela

edit: also check out my “downstream” branch for added gWaveform and gInvert support

---

<div class="post-metadata">

**Author:** ![varicela](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/varicela/32/2198_2.png) [@varicela](https://forum.critterandguitari.com/u/varicela)\
**Post date:** [August 31, 2021, 7:24pm UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/9 "2021-08-31T19:24:49Z")

</div>

It should world on OSX now 🙂  
thanks to @sebshader for fixing it!

---

<div class="post-metadata">

**Author:** ![jbls](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/jbls/32/5302_2.png) [@jbls](https://forum.critterandguitari.com/u/jbls)\
**Post date:** [December 25, 2022, 3:19pm UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/10 "2022-12-25T15:19:47Z")

</div>

Does anybody else having problems getting the display to work? or even MOM? I tried it with the Chill Time Patch; in stepmother everything works fine.

I have Python 3.10.0, and pygame and python-osc is installed. I tried different combinations of opening the different components, but no display at all.

While opening the MOM patch PD states: trigger: i: bad type

Maybe I should mention that I have actually not a big plan of Python of PD, I just try to fiddle around with some patches directly on my computer. So maybe thats a dumb question, but maybe someone can help me gettin this to work. 🙂

all the best!

PS: when I open the oled.py a window opens with the following:

```auto
import threading
import pygame
import pygame.gfxdraw
import pygame.freetype
from pythonosc import dispatcher
from pythonosc import osc_server
import os.path

SCALERATIO = 2 #size of the pixels. must be an integer

pygame.freetype.init()
fontPath = "assets/organelle.ttf"
print(fontPath)
oFont8 = pygame.freetype.Font(fontPath, 8)
oFont16 = pygame.freetype.Font(fontPath, 16)
oFont24 = pygame.freetype.Font(fontPath, 24)
oFont32 = pygame.freetype.Font(fontPath, 32)
windowSize = (128*SCALERATIO,64*SCALERATIO)

def createOled():
    pygame.display.init() 

    icon = pygame.image.load("assets/icon.png")
    pygame.display.set_icon(icon)
    pygame.display.set_caption('Organelle OLED')

    while True:
        event = pygame.event.wait()
        if event.type == pygame.QUIT:
            server.socket.close() #close server and let close the console
            break

t = threading.Thread(target=createOled)
t.daemon = True
t.start()

s = pygame.Surface((128,64), pygame.SRCALPHA, 32)
sWindow = pygame.Surface(windowSize, pygame.SRCALPHA, 32)
screen = pygame.display.set_mode(windowSize)
screen.fill((32,32,32))

def gClear(unused_addr, unused_1):
    global s
    pygame.draw.rect(s, (32,32,32), (0, 0, 128, 64), 0)

def gSetPixel(unused_addr, x, y, c):
    global s
    pygame.draw.line(s, (255,255,255) if c == 1 else (32,32,32), (x, y), (x, y))

def gLine(unused_addr, x1, y1, x2, y2, c):
    global s
    pygame.draw.line(s, (255,255,255) if c == 1 else (32,32,32), (x1, y1), (x2, y2))

def gBox(unused_addr, x1, y1, x2, y2, c):
    global s
    pygame.draw.rect(s, (255,255,255) if c == 1 else (32,32,32), (x1, y1, x2, y2), 1)

def gFillArea(unused_addr, x1, y1, x2, y2, c):
    global s
    pygame.draw.rect(s, (255,255,255) if c == 1 else (32,32,32), (x1, y1, x2, y2), 0)

def gCircle(unused_addr, x, y, size, c):
    global s
    pygame.draw.circle(s, (255,255,255) if c == 1 else (32,32,32), (int(x), int(y)), int(size), 1)

def gFilledCircle(unused_addr, x, y, size, c):
    global s
    pygame.draw.circle(s, (255,255,255) if c == 1 else (32,32,32), (int(x), int(y)), int(size), 0)

def gFlip(unused_addr):
    global s
    global screen

    pygame.transform.scale(s, windowSize, sWindow)

    screen.blit(sWindow, (0, 0))
    pygame.display.flip()

def gInvertArea(unused_addr, x, y, w, h): #/oled/gInvertArea 3 3 $1 121 9
    global s
    global screen

    gFlip("unused_addr")
    inv = pygame.Surface((w, h), pygame.SRCALPHA)
    inv.fill((255,255,255,255))
    inv.blit(s, (- x, -y), None, pygame.BLEND_RGB_SUB)
    s.blit(inv, (x, y), None)
    gFlip("unused_addr")

def gInvertLine(unused_addr, n): #/oled/gInvertLine 0
    if n == 0:
        gInvertArea("unused_addr", 0, 8, 128, 9)
    elif n == 1:
        gInvertArea("unused_addr", 0, 20, 128, 9)
    elif n == 2:
        gInvertArea("unused_addr", 0, 32, 128, 9)
    elif n == 3:
        gInvertArea("unused_addr", 0, 44, 128, 9)
    elif n == 4:
        gInvertArea("unused_addr", 0, 56, 128, 9)

def gPrintln(unused_addr, x, y, size, c, *txtToPrint):
    global s
    global oFont

    txt = ""

    for word in txtToPrint:
        if type(word) == float:
            word = str(int(word))
        txt = txt + word + " " 

    if size == 8:
        oFont8.render_to(s, (x, y), txt, (255,255,255) if c == 1 else (32,32,32))
    elif size == 16:
        oFont16.render_to(s, (x, y), txt, (255,255,255) if c == 1 else (32,32,32))
    elif size == 24:
        oFont24.render_to(s, (x, y), txt, (255,255,255) if c == 1 else (32,32,32))
    elif size == 32:
        oFont32.render_to(s, (x, y), txt, (255,255,255) if c == 1 else (32,32,32))

def gCleanln(unused_addr, n):
    if n == 1:
        gFillArea("unused_addr", 0, 8, 128, 9, 0)
    elif n == 2:
        gFillArea("unused_addr", 0, 20, 128, 9, 0)
    elif n == 3:
        gFillArea("unused_addr", 0, 32, 128, 9, 0)
    elif n == 4:
        gFillArea("unused_addr", 0, 44, 128, 9, 0)
    elif n == 5:
        gFillArea("unused_addr", 0, 56, 128, 9, 0)

def gDrawInfoBar(unused_addr, inL, inR, outL, outR):
    global s
    global oFont

    inL = int(inL)
    inR = int(inR)
    outL = int(outL)
    outR = int(outR)

    if inR < 0:
        inR = 0
    if inR > 11:
        inR = 11
    if inL < 0:
        inL = 0;
    if inL > 11:
        inL = 11;

    if outR < 0:
        outR = 0
    if outR > 11:
        outR = 11
    if outL < 0:
        outL = 0
    if outL > 11:
        outL = 11

    gFillArea('unused_addr', 0, 0, 128, 8, 0)

    gPrintln("unused_addr", 0, 0, 8, 1, "I")
    gPrintln("unused_addr", 64, 0, 8, 1, "O")

    for i in range(11):
        gFillArea('unused_addr', (i * 5) + 8, 1, 1, 2, 1)
        gFillArea('unused_addr', (i * 5) + 8, 5, 1, 2, 1)
    for i in range(inR):
        gFillArea('unused_addr', (i * 5) + 7, 0, 3, 4, 1);
    for i in range(inL):
        gFillArea('unused_addr', (i * 5) + 7, 4, 3, 4, 1);

    for i in range(11):
        gFillArea('unused_addr', (i * 5) + 74, 1, 1, 2, 1)
        gFillArea('unused_addr', (i * 5) + 74, 5, 1, 2, 1)
    for i in range(outR):
        gFillArea('unused_addr', (i * 5) + 73, 0, 3, 4, 1);
    for i in range(outL):
        gFillArea('unused_addr', (i * 5) + 73, 4, 3, 4, 1);

    gFlip("unused_addr")

dispatcher = dispatcher.Dispatcher()
dispatcher.map("/gClear", gClear)
dispatcher.map("/gFlip", gFlip)
dispatcher.map("/gSetPixel", gSetPixel)
dispatcher.map("/gLine", gLine)
dispatcher.map("/gBox", gBox)
dispatcher.map("/gFillArea", gFillArea)
dispatcher.map("/gCircle", gCircle)
dispatcher.map("/gFilledCircle", gFilledCircle)
dispatcher.map("/gPrintln", gPrintln)
dispatcher.map("/gCleanln", gCleanln)
dispatcher.map("/gInvertArea", gInvertArea)
dispatcher.map("/gInvertLine", gInvertLine)
dispatcher.map("/gDrawInfoBar", gDrawInfoBar)

server = osc_server.ThreadingOSCUDPServer(("localhost", 3000), dispatcher)
print("Serving on {}".format(server.server_address))
server.serve_forever()
```

---

<div class="post-metadata">

**Author:** ![sebshader](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sebshader](https://forum.critterandguitari.com/u/sebshader)\
**Post date:** [May 8, 2023, 4:10am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/11 "2023-05-08T04:10:48Z")

</div>

you have to run oled.py with python. like `python3 oled.py` from a shell (command line/terminal prompt)

---

<div class="post-metadata">

**Author:** ![sebshader](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sebshader](https://forum.critterandguitari.com/u/sebshader)\
**Post date:** [May 8, 2023, 4:12am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/12 "2023-05-08T04:12:22Z")

</div>

and if you want to fix the trigger errors change all "i"s in trigger objects to “f”

---

<div class="post-metadata">

**Author:** ![sebshader](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sebshader](https://forum.critterandguitari.com/u/sebshader)\
**Post date:** [May 8, 2023, 4:17am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/13 "2023-05-08T04:17:16Z")

</div>

also it looks like you have the old version of the code before the threading change and therefore it wouldn’t work on osx anyways

---

<div class="post-metadata">

**Author:** ![pleanbean](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pleanbean](https://forum.critterandguitari.com/u/pleanbean)\
**Post date:** [February 23, 2024, 8:41am UTC](https://forum.critterandguitari.com/t/mom-mother-with-oled-screen-and-multipage-support-v1-2/4327/14 "2024-02-23T08:41:41Z")

</div>

Hey, I know this is old, but how do you actually run any user patches with this? I have MOM and the oled running successfully.

Edit: Ah, it’s easy. Just open any patch’s main.pd from within the MOM.pd window…
