• eriknie

    I wrote an Pythonista application to show lyrics and chord for live performance. It also plays backingtracks and is able to sort setlists. Works great. But I missed the option to use it with MIDI program changes to also setup my synths to the matching programs.
    Finally I found a way to get this working: Pythonista --> UDP --> MidiFire --> MIDI-out
    Could also be used the other way to receive midi data
    Use MidiFire with OSC Exchange to MIDI synth. Setup UDP to port 8051, wrap data in sysex to no.

    From Pythonista use the simple code that i found elsewhere, easy to tweak into program changes or other midi commands.
    I hope this helps others

    import socket
    # addressing information of target
    #fill in your ip and port
    IPADDR = ''
    PORTNUM = 8051
    # enter the data content of the UDP packet as hex
    msg1 = bytearray([0x90, 0x40, 0x60])
    msg2 = bytes.fromhex('903e70')
    #or using variable for midi note message
    midi_message = '903c50'
    midi_packet = bytes.fromhex(midi_message)
    # initialize a socket, think of it as a cable
    # SOCK_DGRAM specifies that this is UDP
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
      # connect the socket, think of it as connecting the cable to the address location
      s.connect((IPADDR, PORTNUM))
      # send the command
      # close the socket
    # close the socket

    posted in Pythonista read more
  • eriknie

    Thanks ccc,
    The idea is great! it will not work in your form of coding as the return value contains a full path.
    With minor adjustments it can work.

    In my app I read .txt and .jpg files for displaying

    However It seems that the problem is the .jpg files. For some reason the are offloaded in iCloud. I got only '.xxxx.jpg' files (with the . ).
    After opening the folder with 'Files' the image files had a small cloud icon on top and after a few seconds they started to download from the cloud and that made everything working again.

    For some reason the iCloud off loaded the images and downloaded them after opening them with 'files'

    Perhaps someone knows why and how to prevent this (As I use this app on stage during a performance)...

    posted in Pythonista read more
  • eriknie

    Extra info:

    The files that I want to read are stored in iCloud, also the python script files.

    and for some reason when this happens, I cannot open my python file from pythonista (the iCloud location where I keep my python files is empty), the files do exist when using "Files" on my iPad, I can see the python files, when clicking on it, it will open Pythonista and runs fine

    posted in Pythonista read more
  • eriknie

    I want to select files from a folder. I use the following code:

    from pathlib import Path
    self.contents = list(curPath.iterdir())
    f = self.contents[i]
    name = os.path.basename(os.path.splitext(f)[0])

    I have a folder with 66 items, self.contents has 66 items.
    Sometimes it contains the correct names, sometimes, there are names with a '.' in the name.
    perhaps it has to do with the mix of PathLib and OS.
    The strange thing is that is can be working without the '.' for longer time and then suddenly it inludes the '.' files.

    Any clue?

    Many thanks!

    posted in Pythonista read more
  • eriknie

    Thanks for all the remarks.

    I want to disable WIFI during a gig because some synchonisation services (I use iCloud and Google Drive to synchronize my settings, apple update) use WIFI and might cause CPU spikes and so audio spikes.
    Perhaps it might not be a problem when this is an ad-hoc connection .

    Mulitpeer works great in Pythonista, but no library for regular python...
    Searched for hours.

    I might try UDP broadcast just to get the few bytes over to python on my MacBook

    posted in Pythonista read more
  • eriknie

    Wifi will work for sure. with some UDP messages

    The setup is not always the same:

    • Ip addresses might change depending connection
    • sometimes an ad-hoc connection is needed (during gig)
    • at home or during rehearsels the IP address might change
    • somtimes I need to control my behringer mixer

    While BT is just there and will connect automatically.

    Perhaps I'm wrong with all the WIFI issues and a uniform way of working can be found.

    posted in Pythonista read more
  • eriknie

    Communication from Pythonista on iPad to MacBook via Bluetooth.

    My application is a chord/text application I wrote in Pythonista and want to control my softsynths on my Macbook.

    Flow would be:
    1 Select song in Pythonista
    2 send a message to my Macbook,
    3 recieve the message in Pyhton
    4 Send the correct Midi program change command from python to Mainstage (or other softsynth-host)

    1 and 4 are working

    I tried:

    • midi over bluetooth from Pythonista --> not working (too complex and not enought documentation (see my other thread)
    • Mulitpeer --> nu support on MacOs for multipeer over Bluetooth ;(
    • direct Bluetooth serial --> no success

    I don't want to use WIFI, because this is might be used to control my behringer mixer and internet access. So I don't want to switch with this too often and loose access

    Any clue what to use for this?


    posted in Pythonista read more
  • eriknie

    I tried all possible combination, no midi is recieved by any clients. I spent way too much time on this....
    Would be nice if Pythonista had a coreMidi module installed...

    Thanks for all the help!

    posted in Pythonista read more
  • eriknie

    Any other idea to send data via bluetooth from Pythonista to my macbook Pro?

    I can write a python program on the macbook pro to convert it to midi (that part is easy)

    posted in Pythonista read more
  • eriknie

    Thanks for al the help and comments!!!

    I've seen examples that only get a destinationget and use Midi-Receive on it.

    Tried many options and still am stuck.

    If you create a client, than You have to select the client in the synth as input.
    In the end I want to select the Bluetooth (by name) from the destinations and sent a program change via that.
    The most simple example was to try to get a note on via destiantions to a virtual synth and build on that.


    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!