Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MIDI SDS and TM-1 #64

Open
dagargo opened this issue Jun 11, 2022 · 62 comments
Open

Add support for MIDI SDS and TM-1 #64

dagargo opened this issue Jun 11, 2022 · 62 comments
Assignees
Labels
help wanted Extra attention is needed
Milestone

Comments

@dagargo
Copy link
Owner

dagargo commented Jun 11, 2022

The goal is to transmit samples to Machinedrum via TM-1.

TM-1 is a standard USB to MIDI (DIN5) interface that can also speed up MIDI transmission if the Elektron devices connected to them allow that.

As it seems that the underlying protocol is standard MIDI SDS, perhaps we could extend this functionality to any other device that supports it too.

Here we have some useful links taken from here.

Format:
http://elektron-users.com/index.php?option=com_openwiki&Itemid=43&id=waveforms_samples 94

Batch conversion:
http://www.elektronauts.com/t/best-software-for-batch-sample-rate-conversion/510

Discussion:
http://www.elektron-users.com/index.php?option=com_fireboard&Itemid=28&func=view&id=30234&catid=9&limit=10&limitstart=0 27

@dagargo dagargo self-assigned this Jun 11, 2022
@dagargo
Copy link
Owner Author

dagargo commented Jun 12, 2022

More official information at Elektronauts but not related to samples.

@dagargo dagargo changed the title Add support for TM-1 Add support for MIDI SDS and TM-1 Jun 26, 2022
@dagargo
Copy link
Owner Author

dagargo commented Jun 26, 2022

Working MIDI SDS pushed to branch sds.

As I don't have a TM-1, I suggest you to work on the connector_handshake_midi_sds function in here.

connector_handshake_midi_sds (struct connector *connector)

@dagargo
Copy link
Owner Author

dagargo commented Jul 12, 2022

SDS support completed.

@dagargo
Copy link
Owner Author

dagargo commented Aug 21, 2022

sds branch merged into master and deleted.

@dagargo
Copy link
Owner Author

dagargo commented Aug 22, 2022

A lot of refactoring has been going on lately so the instructions above are obsolete.

In order to send a custom SysEx message to the TM-1, the code should be added at the end of this function. Other devices will ignore it so it will be safe.

gint
sds_handshake (struct backend *backend)
{
//We send a dump header for the highest number allowed. Hopefully, this will fail on every device.
GByteArray *tx_msg = g_byte_array_sized_new (sizeof (SDS_DUMP_HEADER));
g_byte_array_append (tx_msg, SDS_DUMP_HEADER, sizeof (SDS_DUMP_HEADER));
tx_msg->data[4] = 0x7f;
tx_msg->data[5] = 0x7f;
//In case we receive anything, there is a MIDI SDS device listening.
if (sds_upload_tx_and_wait_ack (backend, tx_msg, 0) == -ETIMEDOUT)
{
return -EIO;
}
//However, we cancel the upload just in case the sampler sent an ACK and is waiting for data.
sds_tx_handshake (backend, SDS_CANCEL, sizeof (SDS_CANCEL), 0);
backend->device_desc.filesystems = FS_SAMPLES_SDS;
backend->fs_ops = FS_SDS_OPERATIONS;
snprintf (backend->device_name, LABEL_MAX, "sampler (MIDI SDS)");
return 0;
}

Notice that we are assuming that TM-1 has only one MIDI interface and it's reading and bypassing the messages.

The code should look like this.

static const guint8 SDS_TM1_TURBO_ON[] = { 0xf0,..., 0xf7 };
[...]
backend_tx_raw (backend, SDS_TM1_TURBO_ON, sizeof(SDS_TM1_TURBO_ON));

@erroreyes
Copy link

erroreyes commented Aug 24, 2022

I am going to try to test this out tomorrow (PST). I emphasize "try" because my TM-1 is really unstable in my Linux/Lenovo laptop because I have to do this plug/unplug/plug-while-holding-the-turbo-button dance to get it to stay recognized and connected by the machine/OS, and even then, I haven't been able to get a simple command like amidi -p hw:1,0 -s some_file.syx -i 20 to work with it, while it works fine with an equally as old Native Instruments Audio Kontrol 1 audio/MIDI interface.

PS, this is in response to your recent post on Elektronauts. I didn't want to reply there as I think a technical conversation may be more relevant here.

@dagargo
Copy link
Owner Author

dagargo commented Aug 24, 2022

PS, this is in response to your recent post on Elektronauts. I didn't want to reply there as I think a technical conversation may be more relevant here.

Abosulutely! Fully agree.

I forgot to mention that, for now, you should change the following line.

#define SDS_BITS 16

I think it'a a 12 there in your case. We should set a variable depending on the MIDI identity reply but we'll do it later.

@dagargo
Copy link
Owner Author

dagargo commented Sep 5, 2022

Any news on this?

I've just pushed a few commits that should improve the SDS functionality. It's been tested and works well with my Digitakt (only upload)) and my E-Mu ESI-2000 (except when the device doesn't send the last byte).

Now, there are 4 filesystems; for 8, 12, 14 and 16 bits transmissions.

I'm still trying to figure out a couple of issues but hopefully this won't affect you if the Machinedrum MIDI SDS code is the same it's in the Digitakt.

One of the issues is the Receive SysEx option in the menu, it's not working ATM.

@erroreyes
Copy link

Hey, sorry about the delay due to unforeseen personal things.

I meant to test this exclusively with my TM-1, but with my current Linux setup, the TM-1 just doesn't want to connect permanently. I will keep trying since I have in fact been able to connect it to the laptop well by doing a bunch of brute force connecting and disconnecting maneuvers. That said, in the times that I have managed to keep it connected, Turbo mode hasn't worked.

With that in mind, do you need me, or is it possible and beneficial, to test the new changes to Elektriod on the Machinedrum without having to use the TM-1, i.e., can I use it with, say, my Native Instruments Komplete Audio 6 MKII?

@dagargo
Copy link
Owner Author

dagargo commented Sep 9, 2022

Hey, sorry about the delay due to unforeseen personal things.

No worries. First things first.

With that in mind, do you need me, or is it possible and beneficial, to test the new changes to Elektriod on the Machinedrum without having to use the TM-1, i.e., can I use it with, say, my Native Instruments Komplete Audio 6 MKII?

Testing the TM-1 should be the last thing to do. Right now, I need you because I'd like you to test the SDS against the Machinedrum and the integration in Elektroid and using Komplete Audio 6 MKII is perfectly fine. Later, we'll see how to integrate the TM-1 and its turbo mode.

As a side note, Elektroid offers direct sample copying with the GUI (and CLI) but also SysEx sending via the app menu (soon via the CLI too). The latter can be used to send the SysEx files found in these sample packs. BTW, SysEx sending only allows to send a single file but I'm working on sending multiple files at once.

Regarding a better integration with the Machinedrum, could you post here the output of elektroid -vv when selecting it in the device combo? I'd like to add a few tweaks if possible.

TIA.

@dagargo
Copy link
Owner Author

dagargo commented Sep 9, 2022

FYI, the bugs I mentioned a few days ago are fixed. Also, multiple SysEx uploading is now possible as well as using the CLI to send and receive SysEx.

@dagargo
Copy link
Owner Author

dagargo commented Sep 15, 2022

A couple of bugs have been fixed.

Also, an occasional error with an E-Mu ESI-2000 when downloading has been addressed with a little hack. Apparently, the sampler was not transmitting the last packet if it had only a single sample which cancelled the whole download. Now, Elektroid uploads an additional 0 sample if this is the case and then downloading just works. This affects all MIDI SDS devices but a single sample in this scenario is not much.

Edit: The additional sample was removed in b5a320f as another workaround was found.

@dagargo
Copy link
Owner Author

dagargo commented Sep 24, 2022

Any update on this?

@dagargo
Copy link
Owner Author

dagargo commented Nov 1, 2022

Version 2. 2 is almost ready. I'm planning to release it during the following couple of weeks.

For anyone reading this, have you been able to use the SDS connector in Elektroid with the Machinedrum or other SDS supporting sampler?

@dagargo
Copy link
Owner Author

dagargo commented Jan 12, 2023

Has anyone been able to test SDS or the TM-1 with Elektroid?

@dagargo
Copy link
Owner Author

dagargo commented Mar 18, 2023

In case anyone is interested, a few improvements have been added to the SDS code.

WAIT packages are sent now to better control the device and avoid the 20 ms timeout specified in the protocol that caused devices to continue without further handshakings.

Besides, a couple of retry loops have been added to better recover in case of failure.

@erroreyes
Copy link

I finally got a stable Linux + TM-1 setup. Previously, I couldn't get the TM-1 to stay connect for longer than 30 seconds no matter what I would do. I can properly look into this now that everything seems almost fine. Anyway, to start, a question:

I don't seem to see any support for SDS transfers using the UI version. Does Elektroid only support SDS transfers via cli?

@dagargo
Copy link
Owner Author

dagargo commented Jan 26, 2024

Does Elektroid only support SDS transfers via cli?

No, it does support SDS transfers from the GUI too.

Maybe, your problem is in the detection of the SDS device. Elektroid (GUI) tries its best to detect the appropriate device so the available operations match its capabilities. As the CLI forces a filesystem, the automatic detection is never fully triggered. Probably the elektron connector, which is run before the sds connector, is detecting the device erroneously.

In order to know what's actually going on, please, disconnect all your MIDI devices, run elektroid -vvv and post here the output so we can take a proper look.


This is how the handshake works.

In the file connector.c there is a list of the available connectors together with a regular expression and a function to initialize the filesystems and the operations.

static const struct connector CONNECTOR_SDS = {
.handshake = sds_handshake,
.name = "sds",
.regex = NULL
};

All the available connectors are tested for a handshake if the MIDI device name matches the regex. As soon as a handshake is successful, the process finishes. Note that the SDS connector do not have a regex and it's placed at the next-to-last place in the list. The last place is used for a generic MIDI device that only supports SysEx and preset listing.

The goal of the handshake function detect the device and initialize all the needed structures in the backend struct. For the SDS devices, here is the function, but you could take a look at other handshake functions for an easier example.

sds_handshake (struct backend *backend)

What device are you trying to connect to? A Machinedrum?

It's also possible to create a new connector, create a new handshake function, register that on the connector.c file and redeclare this structure to have a more precise implementation. For instance, if the Machinedrum only accepts 12 bits 44.1 kHz mono samples, then one could specify exactly the operations they want. Or, perhaps, we could modify the elektron connector and its handshake function.

@erroreyes
Copy link

What device are you trying to connect to? A Machinedrum?

Yes, I am doing the test with a Machinedrum and a TM-1. I have a Monomachine as well, but I'll stick to the MD to make testing simple for now.

Assuming that I should disconnect all MIDI instruments but leave the TM-1 connected via USB, this is what elektroid -vvv displayed when I selected the TM-1 from the dropdown menu:

DEBUG:preferences.c:132:(preferences_load): Loading preferences from '/home/roby/.config/elektroid/preferences.json'...
DEBUG:audio.c:231:(audio_init): Initializing audio (PulseAudio 16.1.0)...
DEBUG:editor.c:645:(editor_stop_load_thread): Stopping load thread...
DEBUG:audio_pa.c:325:(audio_server_info_callback): Using 48000 Hz sample rate...
DEBUG:audio.c:274:(audio_reset_sample): Resetting sample...
DEBUG:backend_alsa.c:363:(backend_get_system_subdevices): Adding hw:1 (name 'Elektron TM-1', subname 'Elektron TM-1 MIDI 1')...
DEBUG:elektroid.c:247:(elektroid_load_devices): Loading devices...
DEBUG:elektroid.c:267:(elektroid_load_devices): Selecting device -1...
DEBUG:audio_pa.c:290:(audio_connect_playback_stream_callback): Sink index: 1623
DEBUG:audio.c:61:(audio_write_to_output): Writing 256 frames...
DEBUG:audio_pa.c:305:(audio_connect_record_stream_callback): Sink index: 1624
DEBUG:audio_pa.c:252:(audio_set_sink_volume): Setting volume to 1.000000...
DEBUG:audio_pa.c:252:(audio_set_sink_volume): Setting volume to 1.000000...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 3044, loop end at 3044
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6074, loop end at 6074
DEBUG:backend_alsa.c:363:(backend_get_system_subdevices): Adding hw:1 (name 'Elektron TM-1', subname 'Elektron TM-1 MIDI 1')...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 14361, loop end at 14361
DEBUG:elektroid.c:247:(elektroid_load_devices): Loading devices...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28722, loop end at 28722
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 54524, loop end at 54524
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6280, loop end at 6280
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6847, loop end at 6847
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28596, loop end at 28596
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28631, loop end at 28631
DEBUG:elektroid.c:267:(elektroid_load_devices): Selecting device -1...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 4424, loop end at 4424
DEBUG:editor.c:680:(editor_set_volume_callback_bg): Setting volume to 1.000000...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 5675, loop end at 5675
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6331, loop end at 6331
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 3828, loop end at 3828
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28869, loop end at 28869
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 5251, loop end at 5251
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28762, loop end at 28762
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6591, loop end at 6591
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6271, loop end at 6271
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 7164, loop end at 7164
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28707, loop end at 28707
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 54858, loop end at 54858
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 27777, loop end at 27777
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 4341, loop end at 4341
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 3674, loop end at 3674
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 48067, loop end at 48067
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 2950, loop end at 2950
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 7059, loop end at 7059
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 14450, loop end at 14450
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6858, loop end at 6858
DEBUG:editor.c:680:(editor_set_volume_callback_bg): Setting volume to 1.000000...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:notifier.c:32:(notifier_set_dir): Changing local browser path to '/home/roby/Music/Samples/drums/Roland Tr-707'...
DEBUG:notifier.c:140:(notifier_set_active): Starting local notifier...
DEBUG:notifier.c:66:(notifier_run): local notifier running...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:elektroid.c:2352:(elektroid_fill_fs_combo_bg): Selecting first filesystem...
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:notifier.c:32:(notifier_set_dir): Changing remote browser path to '/'...
DEBUG:notifier.c:140:(notifier_set_active): Starting remote notifier...
DEBUG:notifier.c:66:(notifier_run): remote notifier running...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:backend.c:389:(backend_destroy): Destroying backend...
DEBUG:progress.c:140:(elektroid_new_progress_thread_gsourcefunc): Creating SysEx thread...
DEBUG:backend.c:367:(backend_init): Initializing backend (ALSA) to 'hw:1,0,0'...
DEBUG:backend_alsa.c:85:(backend_init_int): Setting blocking mode...
DEBUG:backend.c:685:(backend_rx_drain): Draining buffers...
DEBUG:editor.c:329:(editor_draw_waveform): Drawing waveform from 0 with 0x zoom...
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:378:(backend_init): Stopping device...
DEBUG:connector.c:132:(connector_init_backend): Connector elektron matches the device
DEBUG:connector.c:183:(connector_init_backend): Testing elektron connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (13): f0 00 20 3c 10 00 00 00 00 00 00 01 f7
DEBUG:connectors/elektron.c:751:(elektron_tx): Message sent (5): 00 00 00 00 01
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:connector.c:183:(connector_init_backend): Testing microbrute connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:183:(connector_init_backend): Testing phatty connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:183:(connector_init_backend): Testing summit connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:183:(connector_init_backend): Testing cz connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (10): f0 44 00 00 70 10 60 70 31 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:connector.c:183:(connector_init_backend): Testing sds connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 00 7d 00 f7
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (13): f0 00 20 3c 10 00 00 00 00 00 00 01 f7
DEBUG:connectors/elektron.c:751:(elektron_tx): Message sent (5): 00 00 00 00 01
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:685:(backend_rx_drain): Draining buffers...
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (21): f0 7e 00 01 68 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (2000)
DEBUG:connector.c:183:(connector_init_backend): Testing efactor connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (5000)
DEBUG:connector.c:183:(connector_init_backend): Testing default connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:192:(connector_init_backend): Using default connector...
DEBUG:progress.c:60:(progress_stop_running_sysex): Stopping SysEx transfer...
DEBUG:progress.c:41:(progress_join_thread): Stopping SysEx thread...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 3044, loop end at 3044
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6074, loop end at 6074
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 14361, loop end at 14361
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28722, loop end at 28722
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 54524, loop end at 54524
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6280, loop end at 6280
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6847, loop end at 6847
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28596, loop end at 28596
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28631, loop end at 28631
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 4424, loop end at 4424
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 5675, loop end at 5675
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6331, loop end at 6331
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 3828, loop end at 3828
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28869, loop end at 28869
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 5251, loop end at 5251
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28762, loop end at 28762
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6591, loop end at 6591
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6271, loop end at 6271
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 7164, loop end at 7164
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 28707, loop end at 28707
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 54858, loop end at 54858
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 27777, loop end at 27777
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 4341, loop end at 4341
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 3674, loop end at 3674
DEBUG:elektroid.c:2352:(elektroid_fill_fs_combo_bg): Selecting first filesystem...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 48067, loop end at 48067
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 2950, loop end at 2950
DEBUG:editor.c:645:(editor_stop_load_thread): Stopping load thread...
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 7059, loop end at 7059
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 14450, loop end at 14450
DEBUG:sample.c:492:(sample_set_sample_info): Loop start at 6858, loop end at 6858
DEBUG:notifier.c:32:(notifier_set_dir): Changing local browser path to '/home/roby/Music/Samples/drums/Roland Tr-707'...
DEBUG:audio.c:274:(audio_reset_sample): Resetting sample...
DEBUG:browser.c:620:(browser_load_dir): Browser already loading. Skipping load...
DEBUG:notifier.c:150:(notifier_set_active): Stopping remote notifier...
DEBUG:notifier.c:103:(notifier_run): Finishing notifier...
DEBUG:notifier.c:32:(notifier_set_dir): Changing local browser path to '/home/roby/Music/Samples/drums/Roland Tr-707'...

image

@dagargo
Copy link
Owner Author

dagargo commented Jan 26, 2024

This section is the interesting part. Let's break it in pieces.

Here, the elektron connector regex matches the system device name but the modern handshake doesn't work as it's quite an old machine.

DEBUG:connector.c:132:(connector_init_backend): Connector elektron matches the device
DEBUG:connector.c:183:(connector_init_backend): Testing elektron connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (13): f0 00 20 3c 10 00 00 00 00 00 00 01 f7
DEBUG:connectors/elektron.c:751:(elektron_tx): Message sent (5): 00 00 00 00 01
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)

As this fails, other connectors are tested. But fail too.

DEBUG:connector.c:183:(connector_init_backend): Testing microbrute connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:183:(connector_init_backend): Testing phatty connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:183:(connector_init_backend): Testing summit connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:183:(connector_init_backend): Testing cz connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (10): f0 44 00 00 70 10 60 70 31 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)

Here, during the sds connector handshake, everything fails, including an additional check for Elektron devices supporting SDS.

DEBUG:connector.c:183:(connector_init_backend): Testing sds connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 00 7d 00 f7
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (13): f0 00 20 3c 10 00 00 00 00 00 00 01 f7
DEBUG:connectors/elektron.c:751:(elektron_tx): Message sent (5): 00 00 00 00 01
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:685:(backend_rx_drain): Draining buffers...
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (21): f0 7e 00 01 68 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (2000)

Another connector here...

DEBUG:connector.c:183:(connector_init_backend): Testing efactor connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (5000)

After all of these, the default connector fails to determine the device too but it's the one being selected.

DEBUG:connector.c:183:(connector_init_backend): Testing default connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 7f 06 01 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:116:(backend_midi_handshake): No MIDI identity reply
DEBUG:connector.c:192:(connector_init_backend): Using default connector...

But there is something really weird here. There is no response for the Identity Request Universal SysEx message (f0 7e 7f 06 01 f7). It's all timeouts.

Can you use the sds connector from the CLI? Or have you just used the send SysEx functionality? I thought the detection of the Machinedrum was working at some point. Can you by any chance try to connect the Machinedrum without the TM-1?

By the way, in the right lower corner you can find the detected device. It's just the default.

@erroreyes
Copy link

Can you use the sds connector from the CLI?

I admit that I am confused about the command line implementation and I am not really sure what commands and options to issue in the terminal. If you don't mind, could you give me a few sample command lines to try out?

Or have you just used the send SysEx functionality?

I just sent a Sysex firmware file through the TM-1 and the Machinedrum is receiving it.

Can you by any chance try to connect the Machinedrum without the TM-1?

Unfortunately I cannot at the moment since the TM-1 is the only MIDI interface I have on hand at the moment.


I am curious though, what is the UI expected to look like for a TM-1 + Machinedrum setup, or for a Machinedrum connected to any other MIDI interface? What functionality should be made available in the UI once a connection is made? Is the expectation to send a Sysex dump of samples or SDS files? Can individual SDS files be transmitted?

@dagargo
Copy link
Owner Author

dagargo commented Jan 27, 2024

I just sent a Sysex firmware file through the TM-1 and the Machinedrum is receiving it.

Nice!

I admit that I am confused about the command line implementation and I am not really sure what commands and options to issue in the terminal. If you don't mind, could you give me a few sample command lines to try out?

Then let's try to send a sample from the CLI.

First, list the devices. From version 3.0, the device 0 is always the computer. In my case, device 1 is a MIDI to USB interface hooked up to my E-mu ESI-2000.

$ elektroid-cli ld
0: id: SYSTEM_ID; name: asuka
1: id: hw:1,0,0; name: hw:1,0,0: M-Audio MIDISPORT Uno, M-Audio MIDISPORT Uno MIDI 1

Let's try to guess what's in there by running the command info. It'll take a while as it will check all the connectors. In my case, the sds connector handshake succeeds and returns the initialized values. This won't work in your case as we already know something happens with the handshake, or will it?

$ elektroid-cli info 1
Type: MIDI
Device name: SDS sampler
Device version: 
Device description: 
Connector name: sds
Filesystems: program,16bits1c,14bits1c,12bits1c,8bits1c,44.1k16b1c,32k16b1c,16k16b1c,8k16b1c

Anyway, let's try to send a sample.
All the commands have the same form: connector-fs-operation. In this case, we are using the sds connector, the 16 bits and sample rate as stored in the file, and the upload operation.

$ elektroid-cli -vv sds-16bits1c-ul sample.wav 1:/1:name

Does that work? Could you post the output of the last command here? Note that you might need to use other filesystem. Isn't the Machinedrum 12 bits? In fact, perhaps this is the issue.

I decided to implement the handshake for SDS devices by sending a dump header and listening for a reply. This header contains the bit depth of the sample to be sent.

This is the line.

tx_msg = sds_get_dump_msg (1000, 0, NULL, 16);

Does it make any difference if you change that 16 with a 12 and recompile? Would the info command work then?

@dagargo
Copy link
Owner Author

dagargo commented Jan 27, 2024

I am curious though, what is the UI expected to look like for a TM-1 + Machinedrum setup, or for a Machinedrum connected to any other MIDI interface?

The GUI should look the same. Depending on the filesystem selected on the device side, on the computer side are shown only the appropriate files. In the case of SDS devices, you should see samples there. And in this case, the sampler editor will be shown too.

What functionality should be made available in the UI once a connection is made? Is the expectation to send a Sysex dump of samples or SDS files?

You'll just be able to drag and drop samples from left to right to certain slot. All the needed conversions will apply.

Can individual SDS files be transmitted?

You wouldn't work with SDS files but with actual samples.

If you wanted to send SDS files, which are just a bunch of SysEx messages, you'd need to use the menu. You could send several SysEx files at once. Just be reminded that you'd have no control over the slot they'd have been sent to. How a device will handle this depends on the particular case.

@erroreyes
Copy link

❯ elektroid-cli ld
0: id: SYSTEM_ID; name: rb-linux
1: id: hw:1,0,0; name: hw:1,0,0: Elektron TM-1, Elektron TM-1 MIDI 1

Calling info in the TM-1 returns a connector name of default, most likely after all the timeouts, and only displays program as file system, which explains why the UI only shows the "Program" option in the drop down menu.

❯ elektroid-cli info 1
Type: MIDI
Device name: MIDI device
Device version: 
Device description: 
Connector name: default
Filesystems: program

I am assuming that because the only file system available is program, sending a file fails; the sds-16bits1c-ul is not available:

❯ elektroid-cli -vv sds-16bits1c-ul ~/Music/Samples/sqr_wv.wav 1:/1:default
DEBUG:elektroid-cli.c:830:(main): Connector: "sds"; filesystem: "16bits1c"; operation: "ul"
DEBUG:backend_alsa.c:363:(backend_get_system_subdevices): Adding hw:1 (name 'Elektron TM-1', subname 'Elektron TM-1 MIDI 1')...
DEBUG:backend.c:367:(backend_init): Initializing backend (ALSA) to 'hw:1,0,0'...
DEBUG:backend_alsa.c:85:(backend_init_int): Setting blocking mode...
DEBUG:backend.c:685:(backend_rx_drain): Draining buffers...
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:378:(backend_init): Stopping device...
DEBUG:connector.c:132:(connector_init_backend): Connector elektron matches the device
DEBUG:connector.c:171:(connector_init_backend): Testing sds connector...
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (6): f0 7e 00 7d 00 f7
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (13): f0 00 20 3c 10 00 00 00 00 00 00 01 f7
DEBUG:connectors/elektron.c:751:(elektron_tx): Message sent (5): 00 00 00 00 01
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend.c:685:(backend_rx_drain): Draining buffers...
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (1000)
DEBUG:backend_alsa.c:205:(backend_tx_sysex_internal): Raw message sent (21): f0 7e 00 01 68 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f7
DEBUG:backend.c:454:(backend_rx_raw_loop): Timeout (2000)
DEBUG:backend.c:389:(backend_destroy): Destroying backend...
ERROR:elektroid-cli.c:894:(main): Error: No such device

In the File Sample Manager, the Machinedrum waits for a sample, I send the commend from the terminal, the MD waits a bit, and then "cancels" the transmission (displays "CANCELLED" on the screen).

Isn't the Machinedrum 12 bits? In fact, perhaps this is the issue.

16 bit samples can be transferred to the Machinedrum and they are converted internally to 12-bit. I can send 16-bit WAV and SDS files with amidi and they get converted.

@dagargo
Copy link
Owner Author

dagargo commented Jan 27, 2024

Calling info in the TM-1 returns a connector name of default, most likely after all the timeouts, and only displays program as file system, which explains why the UI only shows the "Program" option in the drop down menu.

Exactly. That is by design. The GUI won't be able to do anything special but will allow selecting presets and sending and receiving SysEx.

I am assuming that because the only file system available is program, sending a file fails; the sds-16bits1c-ul is not available:

You're right.

However, notice the CLI bypasses the connector detection stage and uses the connector indicated by the user. What happens after is that the chosen connector runs the handshake anyway and it fails because no messages are received.

16 bit samples can be transferred to the Machinedrum and they are converted internally to 12-bit. I can send 16-bit WAV and SDS files with amidi and they get converted.

So 16 bits is OK.

In the File Sample Manager, the Machinedrum waits for a sample, I send the commend from the terminal, the MD waits a bit, and then "cancels" the transmission (displays "CANCELLED" on the screen).

Is the Machinedrum showing something on the screen during the connector detection or handshake?

I suspect the issue is just that no packages are received. Is the computer receiving MIDI data from the Machinedrum? You said that sending SysEx works, can you use amidi to check if it's receiving anything?

@erroreyes
Copy link

erroreyes commented Jan 27, 2024

Is the Machinedrum showing something on the screen during the connector detection or handshake?

When it is in the file manager and I select the sample slot to receive a sample to, the only thing that shows is CANCELLED after the connector routine fails. When the Machinedrum is not in the file manager and its normal view, it displays the message "ERROR INVALID POSITION". That made me think that maybe the syntax for the path was wrong so I tried:

elektroid-cli -vv sds-16bits1c-ul ~/Music/Samples/sqr_wv.wav 1:/44:sqr

assuming that 1 is the device, 44 is the sample slot position in the Machinedrum where I want a new sample to be stored, and sqr is the name of I want to give to the sample, but that didn't work either.

can you use amidi to check if it's receiving anything?

I can receive data from the Machinedrum to the laptop with amidi.

@dagargo
Copy link
Owner Author

dagargo commented Jan 27, 2024

When it is in the file manager and I select the sample slot to receive a sample to, the only thing that shows is CANCELLED after the connector routine fails.

You don't need to setup anything on the SDS devices. The whole process is controlled from the computer.

I can receive data from the Machinedrum to the laptop with amidi.

Great.

When the Machinedrum is not in the file manager and its normal view, it displays the message "ERROR INVALID POSITION". That made me think that maybe the syntax for the path was wrong so I tried:

Then, the issue is in the handshake message and no matter what parameters you pass the handshake will be the same.

But you guessed out all the parameters correctly.

The issue is very likely in the line 1235. At least I added a meaningful comment.

Change the 1000 value for 44, which is the slot you were using but any other would do. Recompile and test the CLI again. Does this make any difference?

elektroid/src/connectors/sds.c

Lines 1233 to 1248 in 9f46c3b

//We send a dump header for a number higher than every device might allow. Hopefully, this will fail on every device.
//Numbers higher than 1500 make an E-Mu ESI-2000 crash when entering into the 'MIDI SAMPLE DUMP' menu but the actual limit is unknown.
tx_msg = sds_get_dump_msg (1000, 0, NULL, 16);
//In case we receive an ACK, NAK or CANCEL, there is a MIDI SDS device listening.
err = sds_tx_and_wait_ack (backend, tx_msg, 0,
SDS_SPEC_TIMEOUT_HANDSHAKE,
SDS_NO_SPEC_TIMEOUT_TRY);
if (err && err != -EBADMSG && err != -ECANCELED)
{
return -ENODEV;
}
//We cancel the upload.
usleep (SDS_REST_TIME_DEFAULT);
sds_tx_handshake (backend, SDS_CANCEL, 0);
usleep (SDS_REST_TIME_DEFAULT);

@dagargo
Copy link
Owner Author

dagargo commented Feb 13, 2024

The first message is interesting. Looks like it is the TM-1 responding based on the information from this Elektronauts post. By the way, there are lots of information about speed negotiation there.

Considering that we have the SysEx messages for globals, kits and other types of data, I'm pondering creating a new connector as it would be easier to add new functionalities there.

@dagargo
Copy link
Owner Author

dagargo commented Feb 17, 2024

A new branch called machinedrum includes the code to work with the MD samples. Both GUI and CLI should work but the connector has not been tested.

Anyway, this is a starting point.

A few notes:

  • The connector is called machinedrum.
  • The filesystem for samples is called sample.
  • All the internal functionality has been tested but the renaming operation.
  • Adding a filesystem for the global settings looks really easy. We could try to implement this if you want.
  • The sample amount limit and the sample name length can be tweaked from these constants.

#define MACHINEDRUM_SAMPLE_LIMIT 128
#define MACHINEDRUM_SAMPLE_NAME_MAX_LEN 16

Could you post here the output of these commands?

$ elektroid-cli -vv info 1

$ elektroid-cli -vv machinedrum-sample-ls | head

So, is this working for you?

@dagargo
Copy link
Owner Author

dagargo commented Feb 18, 2024

I forgot to mention that getting the sample names could be possible.

As with the renaming functionality, this code is already implemented but has never been tested.

If you're interested check if this works.

$ amidi -p hw:1,0,0 -S "f0 7e 00 05 04 00 00 f7" -d -t 3

@dagargo
Copy link
Owner Author

dagargo commented Mar 20, 2024

@erroreyes, did you manage to try the machinedrum branch?

We are not in a hurry, it's just that wanted to track the status of this issue. Don't mean to put pressure on you.

If, for whatever reason, you can't work on this we might ask in Elektronauts if anyone else is interested.

@dagargo dagargo added the help wanted Extra attention is needed label Apr 1, 2024
@johnnywagner
Copy link

johnnywagner commented Apr 23, 2024

I've got 2 working TM-1's, a Machinedrum, Monomachine, Windows PC & Macbook and would be happy to help test this as C6 is getting harder for everyone to use. Especially for those on MacOS, there are no options for getting TurboMIDI speeds from the TM-1. I'm a bit of a novice programmer though & not familiar with autotools, is it possible to compile for Windows and Mac? Or would I need to set up a VM to run this?

@dagargo
Copy link
Owner Author

dagargo commented Apr 25, 2024

Thanks for wanting to try this.

First, a bit of a recap.

  • Basic sample transmission should already work with the MachineDrum. The code resides in its own branch.
  • Additional things like renaming are still in the works.
  • Turbo MIDI, from the application side, seems to work but it's still unknown if something else needs to be done to work in the turbo mode. There are some notes about all these in the previous comments.

Regarding the compilation, there are many options.

  • Last Tuesday I checked the Windows compilation under MSYS2 UCRT64 and added a few commits to address some minor issues. Now, seems to work nicely but the MSYS2 layer makes it very slow and compiling and running it's not really user friendly.
  • Elektroid should compile and work under OSX and autotools.
  • The development environment and where Elektroid has been fully tested is GNU/Linux. I could help you easily if we choice this path.

Perhaps, the best choice now is going for a Linux VM and, once it's done, then I could help you building this on OSX.

Is this good for you?

If it is, let's follow this.

  1. Install a Debian or Ubuntu VM. (I've tried WSL on Windows and works quite well too. This is another option.)
  2. Clone the repo and change to the machinedrum branch.
  3. Install the dependencies indicated from the instructions.
  4. Try running the compilation instructions.
  5. Run Elektroid (you'll need to map the USB devices to the guest OS in your VM manager).

Let me know at which point you are so I can help you with that.

@dagargo
Copy link
Owner Author

dagargo commented Apr 25, 2024

There is the issue #108 related to building on OSX.

@johnnywagner
Copy link

Sounds great, thanks for all of the info. It may be a few days before you hear back from me as I have never set up a Linux VM or build environment before but am eager to figure it out. Is this the comment thread an appropriate place to reach out for troubleshooting/help or should we move to some kind of direct messaging (if needed)?

@dagargo
Copy link
Owner Author

dagargo commented Apr 25, 2024

Take the time you need. This issue was created almost 2 years ago so we're definitely not in a hurry.

As a team, we've done as much as we could but we haven't accomplished much yet. Still, I think we are really close.

Is this the comment thread an appropriate place to reach out for troubleshooting/help or should we move to some kind of direct messaging (if needed)?

I'd say so. If we end up cluttering this issue so much, we'll find another way.

@dagargo
Copy link
Owner Author

dagargo commented May 6, 2024

@johnnywagner, in case it makes things easier for you, support for OSX with Homebrew has been added.

@johnnywagner
Copy link

Great, sorry I haven't had much time to try and set this up. Thanks for the update, I'll post here soon.

@dagargo
Copy link
Owner Author

dagargo commented Jun 29, 2024

For anyone reading this, has there been any advance in this issue?

BTW, branch machinedrum is way behind master so I should probably reabase it.

@johnnywagner
Copy link

I haven't had a chance to test it yet but I haven't forgotten!

@adsr
Copy link

adsr commented Jul 7, 2024

Hi, I'm a Linux user with a Machinedrum and can help test / debug. I misplaced my TM-1 a while ago but I will look for that.

I figured I'd try a non-turbo transfer on the machinedrum branch and that worked:

$ ./elektroid-cli machinedrum-sample-ul ~/downloads/untitled.wav 1:/34:34

This uploaded untitled.wav to slot 35 (34 0-indexed). The name appears as "....". machinedrum-sample-ls also worked, showing 0 thru 127.

This helps me as Elektron C6 crashes under wine. Thanks!

Btw I needed the following to compile the machinedrum branch on my setup.

diff --git a/src/connectors/system.c b/src/connectors/system.c
index d2e5c83..098ad13 100644
--- a/src/connectors/system.c
+++ b/src/connectors/system.c
@@ -19,6 +19,7 @@
  */
 
 #include <errno.h>
+#include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #if defined(__linux__)
 #include <sys/statvfs.h>
diff --git a/src/editor.c b/src/editor.c
index 4e8c017..2811ac0 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -19,6 +19,7 @@
  */
 
 #include <gtk/gtk.h>
+#include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include "editor.h"
 #include "sample.h"

You mentioned you need to rebase so maybe that's already fixed.

If I find my TM-1 I will test with that and update.

@dagargo
Copy link
Owner Author

dagargo commented Jul 7, 2024

This is great news!

TM-1 is something we can deal with later as this will only speed up the transfers.

Regarding sample names, we need to know how the machine names the samples. My guess is that they're using an extension of MIDI SDS for this so 've enabled it in the code.
Are the names there now? You should see the names in the GUI too.
Consider this naming feature has never been tested so there might be errors. The specifications are here.

As you're saying the samples are 0-indexed, I've tried to fix it in the last commit.

Branch machinedrum has been rebased too. Those compilation errors were already fixed in master, just as you said.

Please, check everything again.

@dagargo
Copy link
Owner Author

dagargo commented Jul 16, 2024

Branch machinedrum has been rebased.

@dagargo
Copy link
Owner Author

dagargo commented Aug 8, 2024

Branch machinedrum has been rebased.

As no more functional changes in the connectors are expected for the next version (3.1), I'm starting to plan the release and I was wondering if anyone here has managed to test the machinedrum branch.

This issue has expanded in time for more than 2.5 years and although it is not a problem, many things have changed.
More specifically, the purpose of the issue has changed over time and the tittle of the issue does not represent the current goal.

Currently, the idea is to implement a connector for the Elektron Machinedrum.

The Elektron TM-1 has proven to be quite elusive and I consider we have very little and reliable information about it.
Regarding this, the idea was to try to activate the button via SysEx messages but this is a totally optional feature because the Machinedrum will work with Elektroid regardless of the TM-1 as any other USB-MIDI adapter will make it work.

@dagargo
Copy link
Owner Author

dagargo commented Aug 15, 2024

master branch has been tested and the code is release ready.

Branch machinedrum has been rebased.

A few connector options have been removed as they were redundant and the code has been updated.
Also, a missing configuration preventing the connector to work at all has been added.

@dagargo dagargo modified the milestones: 3.1, 3.2 Oct 5, 2024
@johnnywagner
Copy link

Sorry for my inactivity, I still need to learn how to compile this program to test it for you. It's on my agenda still.

In the mean time I did find this information someone wrote up on how the Monomachine DIGIPro files are structured:
https://gist.github.com/rumblesan/e520ae4099d0583e3ef4e228beabe2b3

Maybe Elektron used the same header formatting for samples on the MD. Hope this is helpful for now.

@dagargo
Copy link
Owner Author

dagargo commented Nov 21, 2024

Nice to know you're on it. 👍

Supposedly, the implementation is ready to be tested. I only need someone to confirm it actually works.

The sampling management is based on MIDI SDS (1-based indexing) and I believe it could support the sample renaming standard too.

There are 3 use cases to be tested.

  • Upload a sample
  • Download a sample
  • Rename a sample

@johnnywagner
Copy link

So I should build the machinedrum branch and test on linux ideally?

@dagargo
Copy link
Owner Author

dagargo commented Nov 21, 2024

Exactly.

I've just rebased the machinedrum branch to incorporate the latest changes from master.

@johnnywagner
Copy link

johnnywagner commented Nov 23, 2024

image
Ok got everything set up and I don't think the UI is currently compatible with the Machinedrum. The Machinedrum (with the vanilla firmware) cannot report its Samples in real time. I presume other Elektron boxes can do this (?) which is why there is no "Receive" button in Elektroid like there is in C6 to listen to the Machinedrum after the user instructs a SYSEX send. See this snippet from the manual below to maybe get a better idea of how this works:
image

So while Elektroid seems to automatically start polling the synth for samples, the Machinedrum is reporting nothing as the user hasn't instructed the Machinedrum to send the data. So, while Elektroid was listening in my case, I set the Machinedrum to send the sample data but since it wasn't synced with Elektroid it all came through as garbled unlistenable data as seen in the screenshot above.

Like @adsr above though, I was able to send a sample by dragging from the left column to the right column while the Machinedrum was set to RECV mode in the sample manager menu:
image

The sample came through great on the other end but two issues are present due to the differences in how the machinedrum works I talk about above:

  1. As soon as you drag over the sample, it begins sending the entire wav to the Machinedrum. This doesn't allow the user any time to rename the sample obviously.
  2. Once the sample is sent, Elektroid tries to reload the sample names, required the user to send garbled data again to have access to sending another sample.

So Ideally, you should create buttons for the Machinedrum mode that allow the user to send and receive MIDI data, mirroring the functionality of C6:
image

Next up, while it is not available in the stock firmware, most power users like myself are running a custom firmware on the Machinedrum called MDX these days that allow the Machinedrum to report sample names, positions, and empty status. Below is a screenshot from the custom firmwares documentation. Incorporating this in Elektroid would let you bring the right column up to parity with how Elektroid functions for other samplers.
image

You can get full documentation of the custom firmware from "Machinedrum_SPS1-UW_OS_X.11.zip" on the latest release:
https://github.com/jmamma/MCL/releases

Finally, I unfortunately report that the TM-1 turbo speeds are not working in the Machinedrum branch. I'm happy to help troubleshoot this though and help get it working as this is the main reason I want to use Elektroid one day.

Thanks! Hope this is helpful. Now that I have ubuntu set up in my Virtual machine I can help regularly test new versions and provide feedback. Maybe one day you can even fully implement the Monomachine :)

@dagargo
Copy link
Owner Author

dagargo commented Nov 23, 2024

Thanks for your detailed post!

A lot to unravel. I'll take a second read later.

Albeit the data being received, it looks like standard SDS name support is not working. We can easily disable this here.

sds_data->name_extension = TRUE;

Set this to FALSE and recompile.

If I've understood you well, uploading should work and listing too (without names). I fear that downloading will only be available on request. To do so, use the receive SysEx menu. But it will be a SysEx file and not a sample file. I'll think about this.

@johnnywagner
Copy link

Definitely please read it again later, I think that you maybe misunderstand the reason I got the garbled SDS name information in the right hand column.

To your second comment, yes downloading samples will only be available on request. BUT, if you incorporate the sysex sample slot query that is apart of MDX, you will be able to list with the names and sample locations currently on the Machinedrum to allow the user to more clearly see the changes they will be making upon pressing a potential "send" button that I suggested.

@dagargo
Copy link
Owner Author

dagargo commented Dec 13, 2024

I still haven't got the time to take a proper look at this.

But I've just came across this thread where there is a video of the uploading process and I think it's worth mention here.

https://www.elektronauts.com/t/transfer-samples-from-to-machinedrum/130337/19

@johnnywagner
Copy link

Yeah good find, that would probably be much more helpful than my written explanations of how it works. If you ever want me to video myself doing anything on any of my machines (monomachine, machinedrum, tm-1) let me know and I'll be happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants