Hansy Synth and Daisy seed

MIDI echo should be quite simple, what is the problem?

In the code all is ok to receive and parser the midi message, buit i want to send to the midi out all the byte i receive from the midi in to the midi out and i don’t find a simply way to do this…but yes it should be…did you have some advices tel_player ?

I’d have to see the code, I haven’t done MIDI on Daisy recently.

I think you can test this with the MidiUSB example.

while(1)
{
/** Listen to MIDI for new changes */
midi.Listen();

    /** When there are messages waiting in the queue... */
    while(midi.HasEvents())
    {
        /** Pull the oldest one from the list... */
        auto msg = midi.PopEvent();
        switch(msg.type)
        {
            case NoteOn:
            {
                /** and change the frequency of the oscillator */
                auto note_msg = msg.AsNoteOn();
                if(note_msg.velocity != 0)
                    osc.SetFreq(mtof(note_msg.note));
            }
            break;
                // Since we only care about note-on messages in this example
                // we'll ignore all other message types
            default: break;
        }
    }
}

Maybe there is a simply way but i don’t find it :frowning:

I have already test my midi out hardware with a send note on…and is is ok

I think there is no very simple way, because the incoming bytes are already assembled into MidiEvent.

Yes it is why the solution is perharps in the transport or the uart part, not in the midi…It should be in the RX DMA of the Midi Uart

1 Like

This is typically called “midi thru” not “echo” :wink:

Yes Midi thru but the Midi thru can be hardware or software. And for me i want an uart echo on soffware side

1 Like

This works, but it is too long so i have some bad noises in my audio out :frowning:

static void rxCallback(uint8_t* data,
size_t size,
void* context,
UartHandler::Result res)
{
/** Read context as transport type /
MidiUartTransport
transport
= reinterpret_cast<MidiUartTransport*>(context);
if(res == UartHandler::Result::OK)
{
if(transport->parse_callback_)
{
transport->parse_callback_(data, size, transport->parse_context_);
transport->Tx(data, size);
}
}
}

Is that calling a blocking transmit from the AudioCallback?