RTP-MIDI on zynthian

I have it uncheck in the Admin page, but it is working as it is enabled in the webconf page (The Admin page doesn’t let it be enabled there, at least with my touchscreen, don’t know if it works with the physical switches).
Anyway, it is still doing feedback for the midi in port of the engine unless i unconnect the midi out in Patchage. I checked and there are no midi messages going back to the Midi device itself.

Currently, RTP-MIDI state is saved in snapshots. This include the “last-state” snapshot, that is restored on startup and saved when powering off from admin menu or with looong select and it’s not saved when simply unplugging the power connector.

Could this “feature” be related with your issue?

@mheidt, i’m thinking in excluding from snapshot some MIDI profile variables, like:

  • QMidiNet state
  • RTP-MIDI state
  • ???

Regards,

With the new feature I implemented recently in the snapshot area, you can deactivate certain fields already.

@jofemodo
I would use an exclusion list when saving the snapshot, not when loading.
And I would not apply it when you add a profile in the snapshot area.
Add the tuning and master channel as well to the exclusion list.

The best solution would be having select inputs at every field in the midi profile section defining the exclusion list.

But most of people don’t want this kind of complexity. They simply want things working as they expect. The problem is knowing what most of people do expect …

So:

  • OK to having the exclusion list mechanism
  • We want a default exclusion list that match “most of people” expectations

Regards

I just fixed a bug that probably have solved the problems. Please. update and test.

Enjoy!

But just don’t exclude it when applying the values from the snapshot file but when you create the file.

To let user choose best behaviour, the Admin menu could offer three options Active / inactive / snapshot

1 Like

Nice catch! :+1:

And then?
What does snapshot mean?
That you want to load from snapshot file an active or inactive state?
How are you displaying it in the webconf, where you only have a checkbox right now and no tri-state option.
That’s why I suggested an additional checkbox in the webconf which says, whether you want the active or inactive state stored in the file.
But @jofemodo said, that he wanted to keep it simple.

Of course: As simple as possible. :wink:
We non-programmers tend to let our will flow a bit, forgetting the logic part of the issue.
Probably your suggestion would be all we need.
:ok_hand:

I think most people are just happy with the simple solution. Having a subset of values that is not stored in the snapshot. You could still add all or delete others in the snapshot file in the webconf like now.
Having a customizable list of the values via checkbox is a little work. Actually too much for what you gain.
The config-templating needs a new case for that checkbox…I overlooked it at first sight, @jofemodo :slight_smile:

1 Like

sorry maybe i wrote too fast. The idea to keep it simple is 3 states :

  • active : RTP-MIDI is always on, activeted on boot
  • inactive : RTP-MIDI is never active, not started on boot
  • snapshot : RTP-MIDI state is saved per snapshot, so it could be active or not depending on user needs

Now for sure I haven’t thought about how the “RTP-MIDI in snapshot” option should be part of the UI for it to be simple and understadable for each mortal

1 Like

And then? :slight_smile:
How does the user know about the state in the snapshot?
How is the state in the snapshot edited?

Right now it works like follows.
When the snapshot is created, all current states are saved in the snapshot file.
Those will be loaded and overwrite the current state, when you load a snapshot.
In the webconf you can delete single states in each snapshot file…or apply a midi profile to reset to all states of that file again.

add an “options” layer in the snapshot instrument/effect list ? Where all options which can be saved in the snapshot can be edited.

That would be @jofemodo.
But imho, having this in webconf is enough.

1 Like

Totally agree. The Zynthian UI is complex enough already …

1 Like

Hi all,
first let me say, that I’ m deeply imprressed by your work. It’ s wonderful.
Since I’ ve realized that the Raspi3 produces Xruns if it’s playing Pianotec I use the Raspi4 what works very well.

Now I’m using the R3 to build a “Performance Controller” because I like to have my hands at the keys.

If I use a USB-Midi-Cable all works fine. But I like to use RTP-Midi to connect the R3 (Controller) and the R4 (Zynthian).

As I read in the Zynthian WebTool I only have to check “Enable RTP-Midi”.
And I read that I only have to find the right port in the R3 to enable the communication. Because I’m very new with Raspi, Python, and all this things, please don’t worry about my questions!
I’m using a R3 with Raspbian, Python, SSH, tightvncserver, mido, mididings, tkinter and I’m working with Thonny.

My questions:

  • How do I install rtp-midi in the R3?
  • How do I find the right output port in the R3?
  • Have I to consider certain adresses or so?

Fyi: I’ ve checked rpt-midi in zynthian and
looked for the output port in the R3 (mido.get_output_names()) and get this adress ‘RtMidiIn Client:RtMidi input 128:0’.
I put this into my output-command of the R3:
outport = mido.open_output(‘RtMidiIn Client:RtMidi input 128:0’)
and started the script. But now I receive in the shell a lot of note off-commands:
note_off channel=0 note=76 velocity=0 time=0 …?..
I think this is unwanted load for the cpu.?
If I play some notes I see it in the shell, but I do not hear anything.

It would be very good to get simple answers so that I can understand each step :smirk:.
If I’m ready with my work I will present

Could anybody write a wiki page?

Hi Markus and all,
I hope you are all free of infection.
I’m glad to have Zynthian and the raspi in these bad days.

Very carefully: If it’s possible to give an answer to my questions before the wiki is ready? It would be a great pleasure for me​:+1::smirk::bouquet::rainbow:

This is my test-script:

from tkinter import *
import pygame.mixer
pygame.init()
pygame.mixer.init(44100, 16, 2, 4096)
pygame.mixer.music.set_volume(0.6)
sound = pygame.mixer.Sound(’/home/pi/rpituto/wav/mitest.wav’)
import RPi.GPIO as GPIO
import time
import openpyxl

import mido
from mido import Message
mido.get_input_names()
mido.get_output_names()
mido.backends.rtmidi

from collections import deque
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.IN) # ANO schwarz
GPIO.setup(24, GPIO.IN) # ASO gelb
GPIO.setup(23, GPIO.IN) # transpose violett
GPIO.setup(18, GPIO.IN) # transpose rot

inport = mido.open_input(‘Impulse:Impulse MIDI 1 28:0’)
outport = mido.open_output(‘E-MU Xmidi 2x2 MIDI 1’)

the ‘found’ output port for RTI perhaps is ‘client 132: ‘RtMidiIn Client’ [type=User,pid=1753]’

msglog = deque()
echo_delay = 1
t = 0

---------------------------------------

while True:
if GPIO.input(25) == 0: # ANO
ano = Message(‘control_change’, channel=0, control=123, value=0)
outport.send(ano)
time.sleep(0.5)
print(‘befehl’, ano)

if GPIO.input(24) == 0:           # ASO
    aso = Message('control_change', channel=0, control=120, value=0)
    outport.send(aso)
    time.sleep(0.5)
    print('befehl', aso)

-----------------------------------------------------------------

if GPIO.input(23) == 0:           # transpose +1
    send(control_change, 0, 120, 0)
    time.sleep(0.5)
if GPIO.input(18) == 0:           # transpose -1
    t -=1
    channel = t
    time.sleep(0.5)

#--------------------------------------------------------
msg = inport.receive()
msglog.append({“msg”: msg, “due”: time.time() + echo_delay})
outport.send(msglog.popleft()[“msg”])
print(msg)

Seems all of a sudden zynthian isn’t sending out over RTP-Midi, Only receiving. anyone else see this?