Community discussions

MikroTik App
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Mikrotik synthesizer/piano programs

Sun Jun 03, 2018 9:28 pm

Hello, i think i chose right section and place to say about it. So I've made some programs that allows you to use Mikrotik routers with beeper as synthesizers. As you know you can make "audio" scripts by typing frequencies and delays manually, but i think that was ugly. However I am didn't find any solutions to automate that things. So i've made two programs:

1. Midi to MIkrotik converter. https://github.com/altucor/midi_to_mikrotik_converter
Allows you to convert midi files in to Mikrotik script files with all delays and frequencies. But on each router you can get only one beeper, and we can't play two notes at the same time, so we have some restrictions. If you are using midi files with crossing notes, and want to get clean sound output, you need first of all prepare midi file with some midi editor(I've used FL Studio). In case when you pass that not ideal file to the program, you can get on output script with "cutting" notes. I mean the second note starts playing before previous finish playing.

Also you can go to the bin/Debug/midi_files folder in repo and try some ready to use scripts with suffix *.txt, also you can compare it with original *.mid files.

Another restriction: Some midi files can contains multiple tracks for example drums, piano, synth, etc. And we still have only one beeper for each router. So my program can gets on input one midi file and extract from it all tracks to text files with counter on end of the filename. Example: starwars_1.txt, starwars_2.txt. If you have telecommunication rack with more than one router, you can try play each track of midi file on each router, like in "floppy music videos" and make video of this ;).

Frequency limitations: Mikrotik beeper can play frequencies between around 20Hz - 4000Hz. So you can use octave or note shifter arguments(described on github page).

2. Mikrotik SSH Piano (only for Windows x32) https://github.com/altucor/MikrotikSSHPiano
So that program allows you to play on Mikrotik as on piano or one voice synth in real time. Limitations the same as for previous program. Nothing hard to use it, just run exe with arguments *username* *ip* *port*, and later enter the password. I am used in this project libssh for windows, and downloaded compiled dll's. If you dont trust to this libraries in my repository you can download it manually https://www.libssh.org/get-it/ or compile it from sources.

Why only for Windows? Because I think its easy to implement something the same to my program on Linux, using Python or Bash scripts. Also on Linux you can get very easy access to SSH via terminal and scripts. x32 because libraries i've used compiled for x32 systems.

I would be glad if my programs can be useful for you.

P.S. Sorry for my English.
 
User avatar
dasiu
Trainer
Trainer
Posts: 231
Joined: Fri Jan 30, 2009 11:41 am
Location: Reading, UK
Contact:

Re: Mikrotik synthesizer/piano programs

Mon Jun 04, 2018 12:12 pm

WOW!! I thought I was the only one using the MikroTik beeper for music.

altucor - you are great!! :)

I started doing my "online composer" to generate MT music and midi previews (other way around - composing rather than taking midi), but never got it finished...
If you have telecommunication rack with more than one router, you can try play each track of midi file on each router, like in "floppy music videos" and make video of this ;).
I did that once with 4x RB433 routers, it was on the TikTube, but then the TikTube server died - and the video is gone :(
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Mon Jun 04, 2018 4:28 pm

WOW!! I thought I was the only one using the MikroTik beeper for music.
I thought the same, we are not alone ;)
I started doing my "online composer" to generate MT music and midi previews (other way around - composing rather than taking midi), but never got it finished...
Wow, "online composer", but how people can play or hear MT sounds form hardware without having it? Maybe you can share this project on github and some enthusiast can contribute to your project.
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 12:44 am

https://www.youtube.com/watch?v=g6GZVlYP7X0 Little bit song parsing techniques and how to use program

Script: https://pastebin.com/7sJ5w37B
 
thobias
newbie
Posts: 25
Joined: Thu Nov 30, 2017 8:45 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 12:45 pm

Hi altucor
The compiled package from github is asking for a bunch of debug versions of DLLs.
Can you try compiling in release mode and reupload?
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 1:48 pm

 
thobias
newbie
Posts: 25
Joined: Thu Nov 30, 2017 8:45 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 2:20 pm

Can you do the same with SSHPiano?
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 2:29 pm

 
thobias
newbie
Posts: 25
Joined: Thu Nov 30, 2017 8:45 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 2:45 pm

Still says I'm missing vcruntime140d.dll and ucrtbased.dll
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 2:52 pm

Requires VC2017 runtime I'd guess.
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 3:41 pm

I've recompiled it with statically linking. Try it https://github.com/altucor/MikrotikSSHP ... tatic-link
 
sid5632
Long time Member
Long time Member
Posts: 553
Joined: Fri Feb 17, 2017 6:05 pm

Re: Mikrotik synthesizer/piano programs

Thu Sep 06, 2018 4:44 pm

SSH.DLL and LIBEAY32.DLL both depend on MSVCR120.DLL
ZLIB1.DLL depends on both VCRUNTIME140D.DLL and UCRTBASED.DLL

Fixing the .EXE doesn't fix the .DLLs
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Sat Sep 08, 2018 12:13 am

SSH.DLL and LIBEAY32.DLL both depend on MSVCR120.DLL
ZLIB1.DLL depends on both VCRUNTIME140D.DLL and UCRTBASED.DLL

Fixing the .EXE doesn't fix the .DLLs
Yeah, you right. I'm checked other libs and they're depend on MSVC libs. The problem is in that i;'ve downloaded builded libs from https://www.libssh.org/get-it/. But at the moment it has problems with download sections for windows. Also sorry for posting it in not ready to use state, on all my computers i have environment with msvc or win sdk kits, and i forgot to check is it works on default env.
 
Redmor
Member Candidate
Member Candidate
Posts: 256
Joined: Wed May 31, 2017 7:40 pm
Location: Italy

Re: Mikrotik synthesizer/piano programs

Wed Sep 26, 2018 4:13 pm

I've tried it with songs in MP3 converted to MIDI and the result isn't so good, I have as result notes with very high length.
I've attached Highway to Hell instrumental generated with the program.
You do not have the required permissions to view the files attached to this post.
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Sun Nov 11, 2018 1:13 am

I've tried it with songs in MP3 converted to MIDI and the result isn't so good, I have as result notes with very high length.
I've attached Highway to Hell instrumental generated with the program.
Yeah, really bad result. Can you send your midi file for analysis? I think your file is so complicated, and maybe i did not consider some combinations. Also check limitations in first post, which you have on router beeper.
 
allstarcomps
newbie
Posts: 36
Joined: Sat Jul 08, 2017 10:36 pm
Location: San Diego, CA, USA
Contact:

Re: Mikrotik synthesizer/piano programs

Sun Nov 11, 2018 4:33 am

I think we should get some Xmas converted for the coming Holliday's coming up. Get my rb450s cherping again.
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Thu Nov 15, 2018 10:01 pm

> xmas
Why not? Check "jingle_bells_mikrotik.mid1.txt"
So i just get song "mid_Jingle bells.mid.txt" from random midi site and saw it has all notes in one instrument. So i opened it on fl studio and deleted all base notes, which has conflicts with main notes and it sounds fine. Probably user Redmor has the same problem, all notes in one midi instrument/channel and they tries to play simultaneously. At the moment my program doesn't have any logic which can prevent notes overlay in output script. So yeah you need prepare your random downloaded midi files. Hope in future i can fix that in my program.

You can check the difference on attached images called "original" and "fixed". It shows what i do to get not chopped/overlayed sound.

Also i attached midi files "mid_Jingle bells.mid.txt" and "mid_jingle_bells_mikrotik.mid.txt" which you need rename from *.mid.txt to *.mid, if you want to fix them in your way and regenerate mikrotik script.
You do not have the required permissions to view the files attached to this post.
 
Rian
just joined
Posts: 7
Joined: Wed Feb 24, 2016 5:19 pm

Re: Mikrotik synthesizer/piano programs

Tue Sep 17, 2019 1:14 pm

Hello,

really nice work! :)

Even if it's "ugly" ;) and just for the sake of completeness, maybe someone wants to experiment with it too (probably it was already linked in another post, mea culpa):
 
User avatar
jmpg22
just joined
Posts: 4
Joined: Sat Apr 29, 2017 5:22 pm
Location: Dominican Republic
Contact:

Re: Mikrotik synthesizer/piano programs

Thu Sep 19, 2019 12:58 am

Guys does anyone has been able to synthesize the sound of an old modem?

I have time searching for this MIDI, in order to setup an script for wen a WAN gets up or down hahahaha.

If anyone has able to make it please donate it here for the community.

Thanks all.
 
g1ftb4sk3t
just joined
Posts: 4
Joined: Thu Feb 07, 2019 10:48 pm

Re: Mikrotik synthesizer/piano programs

Fri Oct 23, 2020 9:41 pm

My son made a cool simple program to make music for these as well.

https://scratch.mit.edu/projects/411055839/
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Sun Dec 26, 2021 5:15 am

Hello, it's been a long time since my last posts and updates about my projects. Now i came back with new updates about https://github.com/altucor/midi_to_mikrotik_converter
1) I've spent some time to refactor whole project code in to more independent simple objects. Now parsing of midi files works more stable and can cover more cases with midi command sequences.
2) Build system was changed to CMake, added usage of Boost library via conan packet manager. As result it allows to build application in the same way for major OS's, simplifies dependency management of project and make it more easier for other contributors to join to this project.
3) Usage of Github Actions CI/CD. Allows automatically prepare application builds for 3 major OS's: Windows/MacOS/Ubuntu(also you can try any other UNIX like OS).

Now you can go to the releases page and simply download and execute binary for your OS: https://github.com/altucor/midi_to_mikr ... ases/tag/2

If you have any issues with using this application please create issues in repo: https://github.com/altucor/midi_to_mikr ... ter/issues
Please attach midi files which cannot be correctly processed by application, log file which has name mtmc_*.log where star means datetime, describe Actual Result and Expected Result .
When i have free time i will investigate the issue and try to fix it in newer releases.
If i don't know about problem - i cannot fix it.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Mikrotik synthesizer/piano programs

Sun Dec 26, 2021 9:28 am

If you could use array for creating commands like here in this post, could would be much shorter.
viewtopic.php?p=900392#p900392
 
User avatar
altucor
just joined
Topic Author
Posts: 11
Joined: Sun Jun 03, 2018 8:32 pm

Re: Mikrotik synthesizer/piano programs

Sun Dec 26, 2021 3:40 pm

Yeah it really looks shorter but also less readable and harder to debug problems. When you write music scripts manually you can write exact amount of time for delay after note event. But some midi files can have delay events between notes so i need to cover this cases also. And my output allows to debug timing and frequency problems when using program with key -c, it will append note name and timestamp at which it will play

Here is short example of additional delay events between notes:
:beep frequency=261.63 length=250ms; # C 5 @ 00:00:27:500
:delay 250ms;

:beep frequency=261.63 length=375ms; # C 5 @ 00:00:28:000
:delay 375ms;

:delay 125ms;

:beep frequency=261.63 length=375ms; # C 5 @ 00:00:28:875
:delay 375ms;

:delay 125ms;

:beep frequency=261.63 length=375ms; # C 5 @ 00:00:29:750
:delay 375ms;

:delay 375ms;

:beep frequency=98 length=250ms; # G 3 @ 00:00:30:875
:delay 250ms;

:beep frequency=261.63 length=500ms; # C 5 @ 00:00:31:375
:delay 500ms;

:beep frequency=207.65 length=250ms; # G# 4 @ 00:00:32:375
:delay 250ms;

:beep frequency=261.63 length=250ms; # C 5 @ 00:00:32:875
:delay 250ms;
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3253
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Mikrotik synthesizer/piano programs

Wed Dec 29, 2021 7:32 pm

Hello, it's been a long time since my last posts and updates about my projects. Now i came back with new updates about https://github.com/altucor/midi_to_mikrotik_converter
Never seen this before – great work!

I thought we were stuck with Super Mario and Jurassic Park.

Have you ever looked at https://midimonster.net – it be very esoteric, but imagine your code be a plug-in there, that then call the Mikrotik API to exec the :beep in [near] real-time. Be able to play a Mikrotik LIVE! Theoretically, at least. And no chords.

Quick question: I know the RB953s and other older RBs have a speaker, but newer wAP, hAP, cAP etc don't. Is there a definitive list of MT board/device that can even play a sound?

Who is online

Users browsing this forum: No registered users and 26 guests