На днях, коллега по работе подсказал забавную идею, использовать сочетание команды «beep» и возможности Router OS по работе со скриптами, а именно, как заставить Микротик проигрывать музыку, через встроенный бипер.Идея, конечно, не нова, и в инете можно найти кучу инфы по ней, но вот, я раньше как-то не задумывался об этом 🙂
«Музыкальный» скрипт будет имеет следующий формат:
:beep frequency=XXX length=YYYms;:delay ZZZms;
Где: frequency – частота звучания «ноты», length – продолжительность звучания «ноты» в миллисекундах, delay – пауза между «нотами», она обязательно должна быть (универсально 250-300 мс) иначе «ноты» будут сливаться, кроме того задержкой можно задавать темп.Соответствие частот нотам можно посмотреть тут. Длительность ноты, соответственно, тут.
Последовательность действий простая:
Заходим в «System» (1) –> «Scripts» (2) и жмём кнопку «Add New» (3).
В поле «Name» (4) вбиваем название скрипта. В разделе «Policy» (5) указываем разрешения на запуск. В поле «Source» (6) вставляем код мелодии и жмём «OK» (7).
Всё, скрипт готов и доступен для дальнейшего использования.Для тех, кому лень набирать мелодии с нот, умельцы написали скрипт для конвертирования рингтонов из нокиевского формата RTTTL в формат Микротика.
В инетике полно архивов с готовыми рингтонами в данном формате, например, тут или тут. Кроме того есть конвертер MIDI в RTTTL.Да и вообще, в сети существует целое направление биперной музыки. Применений этой фиче можно найти много, от звуковых уведомлений при наступлении какого-то события, до розыгрышей друзей (можно, например, поставить в планировщике проигрывание гимна СССР в какое-то определённое время :)).
Ниже несколько готовых примеров для затравки 🙂
Вступление из 5 симфонии Бетховена (тадададам )) )
:beep frequency=700 length=240ms; :delay 250ms; :beep frequency=700 length=240ms; :delay 250ms; :beep frequency=700 length=240ms; :delay 250ms; :beep frequency=550 length=900ms; :delay 1930ms;
Звёздные Войны – Имперский марш
:beep frequency=500 length=500ms; :delay 500ms; :beep frequency=500 length=500ms; :delay 500ms; :beep frequency=500 length=500ms; :delay 500ms; :beep frequency=400 length=500ms; :delay 400ms; :beep frequency=600 length=200ms; :delay 100ms; :beep frequency=500 length=500ms; :delay 500ms; :beep frequency=400 length=500ms; :delay 400ms; :beep frequency=600 length=200ms; :delay 100ms; :beep frequency=500 length=500ms; :delay 1000ms; :beep frequency=750 length=500ms; :delay 500ms; :beep frequency=750 length=500ms; :delay 500ms; :beep frequency=750 length=500ms; :delay 500ms; :beep frequency=810 length=500ms; :delay 400ms; :beep frequency=600 length=200ms; :delay 100ms; :beep frequency=470 length=500ms; :delay 500ms; :beep frequency=400 length=500ms; :delay 400ms; :beep frequency=600 length=200ms; :delay 100ms; :beep frequency=500 length=500ms; :delay 1000ms;
Super Mario – Главная тема:
beep frequency=660 length=100ms;:delay 150ms;:beep frequency=660 length=100ms;:delay 300ms;:beep frequency=660 length=100ms;:delay 300ms;:beep frequency=510 length=100ms;:delay 100ms;:beep frequency=660 length=100ms;:delay 300ms;:beep frequency=770 length=100ms;:delay 550ms;:beep frequency=380 length=100ms;:delay 575ms;:beep frequency=510 length=100ms;:delay 450ms;:beep frequency=380 length=100ms;:delay 400ms;:beep frequency=320 length=100ms;:delay 500ms;:beep frequency=440 length=100ms;:delay 300ms;:beep frequency=480 length=80ms;:delay 330ms;:beep frequency=450 length=100ms;:delay 150ms;:beep frequency=430 length=100ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 200ms;:beep frequency=660 length=80ms;:delay 200ms;:beep frequency=760 length=50ms;:delay 150ms;:beep frequency=860 length=100ms;:delay 300ms;:beep frequency=700 length=80ms;:delay 150ms;:beep frequency=760 length=50ms;:delay 350ms;:beep frequency=660 length=80ms;:delay 300ms;:beep frequency=520 length=80ms;:delay 150ms;:beep frequency=580 length=80ms;:delay 150ms;:beep frequency=480 length=80ms;:delay 500ms;:beep frequency=510 length=100ms;:delay 450ms;:beep frequency=380 length=100ms;:delay 400ms;:beep frequency=320 length=100ms;:delay 500ms;:beep frequency=440 length=100ms;:delay 300ms;:beep frequency=480 length=80ms;:delay 330ms;:beep frequency=450 length=100ms;:delay 150ms;:beep frequency=430 length=100ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 200ms;:beep frequency=660 length=80ms;:delay 200ms;:beep frequency=760 length=50ms;:delay 150ms;:beep frequency=860 length=100ms;:delay 300ms;:beep frequency=700 length=80ms;:delay 150ms;:beep frequency=760 length=50ms;:delay 350ms;:beep frequency=660 length=80ms;:delay 300ms;:beep frequency=520 length=80ms;:delay 150ms;:beep frequency=580 length=80ms;:delay 150ms;:beep frequency=480 length=80ms;:delay 500ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=760 length=100ms;:delay 100ms;:beep frequency=720 length=100ms;:delay 150ms;:beep frequency=680 length=100ms;:delay 150ms;:beep frequency=620 length=150ms;:delay 300ms;:beep frequency=650 length=150ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 150ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 100ms;:beep frequency=570 length=100ms;:delay 220ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=760 length=100ms;:delay 100ms;:beep frequency=720 length=100ms;:delay 150ms;:beep frequency=680 length=100ms;:delay 150ms;:beep frequency=620 length=150ms;:delay 300ms;:beep frequency=650 length=200ms;:delay 300ms;:beep frequency=1020 length=80ms;:delay 300ms;:beep frequency=1020 length=80ms;:delay 150ms;:beep frequency=1020 length=80ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=760 length=100ms;:delay 100ms;:beep frequency=720 length=100ms;:delay 150ms;:beep frequency=680 length=100ms;:delay 150ms;:beep frequency=620 length=150ms;:delay 300ms;:beep frequency=650 length=150ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 150ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 100ms;:beep frequency=570 length=100ms;:delay 420ms;:beep frequency=585 length=100ms;:delay 450ms;:beep frequency=550 length=100ms;:delay 420ms;:beep frequency=500 length=100ms;:delay 360ms;:beep frequency=380 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=760 length=100ms;:delay 100ms;:beep frequency=720 length=100ms;:delay 150ms;:beep frequency=680 length=100ms;:delay 150ms;:beep frequency=620 length=150ms;:delay 300ms;:beep frequency=650 length=150ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 150ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 100ms;:beep frequency=570 length=100ms;:delay 220ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=760 length=100ms;:delay 100ms;:beep frequency=720 length=100ms;:delay 150ms;:beep frequency=680 length=100ms;:delay 150ms;:beep frequency=620 length=150ms;:delay 300ms;:beep frequency=650 length=200ms;:delay 300ms;:beep frequency=1020 length=80ms;:delay 300ms;:beep frequency=1020 length=80ms;:delay 150ms;:beep frequency=1020 length=80ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=760 length=100ms;:delay 100ms;:beep frequency=720 length=100ms;:delay 150ms;:beep frequency=680 length=100ms;:delay 150ms;:beep frequency=620 length=150ms;:delay 300ms;:beep frequency=650 length=150ms;:delay 300ms;:beep frequency=380 length=100ms;:delay 150ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=430 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 100ms;:beep frequency=570 length=100ms;:delay 420ms;:beep frequency=585 length=100ms;:delay 450ms;:beep frequency=550 length=100ms;:delay 420ms;:beep frequency=500 length=100ms;:delay 360ms;:beep frequency=380 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=500 length=100ms;:delay 150ms;:beep frequency=500 length=100ms;:delay 300ms;:beep frequency=500 length=60ms;:delay 150ms;:beep frequency=500 length=80ms;:delay 300ms;:beep frequency=500 length=60ms;:delay 350ms;:beep frequency=500 length=80ms;:delay 150ms;:beep frequency=580 length=80ms;:delay 350ms;:beep frequency=660 length=80ms;:delay 150ms;:beep frequency=500 length=80ms;:delay 300ms;:beep frequency=430 length=80ms;:delay 150ms;:beep frequency=380 length=80ms;:delay 600ms;:beep frequency=500 length=60ms;:delay 150ms;:beep frequency=500 length=80ms;:delay 300ms;:beep frequency=500 length=60ms;:delay 350ms;:beep frequency=500 length=80ms;:delay 150ms;:beep frequency=580 length=80ms;:delay 150ms;:beep frequency=660 length=80ms;:delay 550ms;:beep frequency=870 length=80ms;:delay 325ms;:beep frequency=760 length=80ms;:delay 600ms;:beep frequency=500 length=60ms;:delay 150ms;:beep frequency=500 length=80ms;:delay 300ms;:beep frequency=500 length=60ms;:delay 350ms;:beep frequency=500 length=80ms;:delay 150ms;:beep frequency=580 length=80ms;:delay 350ms;:beep frequency=660 length=80ms;:delay 150ms;:beep frequency=500 length=80ms;:delay 300ms;:beep frequency=430 length=80ms;:delay 150ms;:beep frequency=380 length=80ms;:delay 600ms;:beep frequency=660 length=100ms;:delay 150ms;:beep frequency=660 length=100ms;:delay 300ms;:beep frequency=660 length=100ms;:delay 300ms;:beep frequency=510 length=100ms;:delay 100ms;:beep frequency=660 length=100ms;:delay 300ms;:beep frequency=770 length=100ms;:delay 550ms;:beep frequency=380 length=100ms;:delay 575ms;
Slayer – South Of Heaven
:beep frequency=932 length=133ms;:delay 266ms;:beep frequency=1864 length=133ms;:delay 266ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3728 length=267ms;:delay 534ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3520 length=267ms;:delay 534ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=3320 length=133ms;:delay 266ms;:beep frequency=2640 length=133ms;:delay 266ms;:beep frequency=3320 length=133ms;:delay 266ms;:beep frequency=3136 length=178ms;:delay 356ms;:beep frequency=932 length=133ms;:delay 266ms;:beep frequency=1864 length=133ms;:delay 266ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3728 length=267ms;:delay 534ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3520 length=267ms;:delay 534ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=3320 length=133ms;:delay 266ms;:beep frequency=2640 length=133ms;:delay 266ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=22ms;:delay 44ms;:beep frequency=932 length=133ms;:delay 266ms;:beep frequency=1864 length=133ms;:delay 266ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3728 length=267ms;:delay 534ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3520 length=267ms;:delay 534ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=3320 length=133ms;:delay 266ms;:beep frequency=2640 length=133ms;:delay 266ms;:beep frequency=3320 length=133ms;:delay 266ms;:beep frequency=3136 length=178ms;:delay 356ms;:beep frequency=932 length=133ms;:delay 266ms;:beep frequency=1864 length=133ms;:delay 266ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3728 length=267ms;:delay 534ms;:beep frequency=2960 length=133ms;:delay 266ms;:beep frequency=3520 length=267ms;:delay 534ms;:beep frequency=2792 length=133ms;:delay 266ms;:beep frequency=3320 length=133ms;:delay 266ms;:beep frequency=2640 length=133ms;:delay 266ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;:beep frequency=3320 length=33ms;:delay 66ms;:beep frequency=3136 length=33ms;:delay 66ms;
за материал спасибо ker-laeda