diff --git a/README.md b/README.md index f529834..9048454 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,159 @@ Personal Information System OS (formerly Plasma Information Screen OS). A somewhat portable relatively-stylish pixel-art clock/weather station. +![](docs/img/hero.jpg) + +## A remark on the Morio Denki Plasma Display + +**This display uses high voltage, which could be lethal!!** + +The display comes from a bus or a train, supposedly. + +It has the following labels on the PCBs: + +* Morio Denki 6M06056 (the 8085-based control board I wasn't able to get running) +* MD 16101DS-CONT82 06 (the actual framebuffer/drive board) +* MD-24T-ADT (2) 8201 (the boards on the plasma tube itself) + +Despite using a standard "HDD" Molex 4-pin connector for the drive board power, it expects +160V on the pin where normally +12V would be supplied. Take care not to mix up the power supplies. (Plugging in +12V into the plasma board doesn't seem to damage it. Plugging in +160V into an HDD, on the other hand...) + +More detailed info is available in the following articles: + +* На русском: https://habr.com/ru/companies/timeweb/articles/808805/ +* 日本語で: https://elchika.com/article/b9f39c29-64aa-42ab-8f73-e6e27a72bd0e/ +* Demo video: https://youtu.be/D4MiHmhhjeQ + +You can also read the quest I went through trying to get it to run "in real time" at [EEVBlog Forums](https://www.eevblog.com/forum/repair/trying-to-figure-out-if-a-vfd-displaydriver-is-broken-(74-series-logic)/). + +## Available widgets + +* Clock + + ![](docs/img/widget/clock_pretty.png) + +* Indoor temperature + + ![](docs/img/widget/indoor_pretty.png) + +* Switchbot Meter temperature +* Weather (via [OpenWeatherMap](https://openweathermap.org/)) + + ![](docs/img/widget/weather.gif) + +* Weather Effect (raining and thunder on idle screen when rain/thunderstorm outside) + + ![](docs/img/widget/rain.gif) + +* Word of the Day (via [Wordnik](https://wordnik.com/)) + + ![](docs/img/widget/word_pretty.png) + +* Foobar2000 (via [foo_controlverver](https://github.com/vladkorotnev/foo_controlserver/tree/fix-streams)) + + ![](docs/img/widget/foo_pretty.png) + +* Remaining sleep time (when using alarm app) + + ![](docs/img/widget/sleep_pretty.png) + +## Available apps + +* Idle (home screen) +* Timer + + ![](docs/img/app/timer.gif) + ![](docs/img/app/timer_melo_pretty.png) +* Stopwatch + + ![](docs/img/app/stopwatch.gif) +* Alarm (Smart Wake Up on devices with motion sensor) + + ![](docs/img/app/alarm_pretty.png) + ![](docs/img/app/alarm2_pretty.png) + ![](docs/img/app/alarm.gif) + + *(blinking lights warning!)* +* Weighing Scale (via Wii Balance Board) + + ![](docs/img/app/weighing.gif) +* Settings + + ![](docs/img/app/settings.gif) + +## Available chime tones + +**(All chime tones are covers adapted for single channel beeper by DJ AKASAKA)** + +* Simple beep +* PC-98 Boot Chime +* Russ28 (Русь 28) Hourly Chime (poorly timed Beethoven's 5th Symphony) +* Some mid-2000s Shtrikh-M (Штрих-М) POS Boot chime +* [A.M. - Arise](https://youtu.be/cuOVP6pJ9Ww?t=264): [MIDI](helper/chimes/arise.mid) +* [Caramell - Caramelldansen](https://youtu.be/o6Zp4cW8w8A?t=51): [MIDI](helper/chimes/caramelldansen.mid) +* [BôA - Duvet](https://youtu.be/Uoox9fpmDP0) (simple version): [MIDI](helper/chimes/duvet.mid) +* [T-Square - Truth](https://youtu.be/FZaUPGjjA4c?t=77): [MIDI](helper/chimes/truth.mid) +* [Kosaki Satoru - Haruhi no Omoi](https://www.youtube.com/watch?v=KMKoyHKYSNk): [MIDI](helper/chimes/haruhi_no_omoi.mid) +* [WAVE and DRAX - When Present Is Past](https://modarchive.org/index.php?request=view_by_moduleid&query=140039): [MIDI](helper/chimes/when_present_is_past.mid) +* [Kawada Mami - Hishoku no Sora](https://www.youtube.com/watch?v=FNl1ud7KxtI): [MIDI](helper/chimes/hishoku.mid) +* [Hirano Aya - Bouken Desho Desho](https://www.youtube.com/watch?v=C337shIT9LI): [MIDI](helper/chimes/bouken.mid) +* [Magome Togoshi, Shinji Orito - Gentle Jena](https://www.youtube.com/watch?v=lR4dw_B423E): [MIDI](helper/chimes/gentlejena.mid) +* [OMEGA - Gammapolisz](https://www.youtube.com/watch?v=XCqdrQxMrxI): [MIDI](helper/chimes/gammapolisz.mid) +* [? - Like The Wind (TMMS)](https://www.youtube.com/watch?v=uYpkri8Kv2E): [MIDI](helper/chimes/like_the_wind.mid) +* [NightRadio - Waiting Freqs](https://www.youtube.com/watch?v=_0MBreuq94Y): [MIDI](helper/chimes/waiting_freqs.mid) +* [NightRadio - The Way](https://nightradio.bandcamp.com/track/the-way): [MIDI](helper/chimes/the_way.mid) +* [Dougal & Gammer — Guitar Hero](https://youtu.be/ID4pO9epHPA?t=89): [MIDI](helper/chimes/gtrhero.mid) +* [蜂屋ななし — シャボン](https://youtu.be/UHRlXm_tV8o?t=41): [MIDI](helper/chimes/syabon.mid) +* [Takeshi Abo — Gate of Steiner](https://www.youtube.com/watch?v=2Q9MqL83FeE): [MIDI](helper/chimes/steiner.mid) +* [deadballP — 永遠に続く五線譜](https://www.youtube.com/watch?v=p1sh68qk4Nk): [MIDI](helper/chimes/towa.mid) +* [Cream puff — Mermaid girl](https://youtu.be/AaUMvgfHpUo?t=16): [MIDI](helper/chimes/mermgrl.mid) +* [Brisk & Trixxy — Eye Opener](https://youtu.be/81QqHUpyBhg?t=83): [MIDI](helper/chimes/eye_opener.mid) +* [Hiroyuki Oshima - The Ark Awakes From The Sea Of Chaos](https://www.youtube.com/watch?app=desktop&v=cB7eevDk1s0): [MIDI](helper/chimes/ark.mid) +* [Timbaland - Give It To Me](https://youtube.com/watch?v=RgoiSJ23cSc) also known as [Skibidi Toilet](https://youtu.be/6dMjCa0nqK0): [MIDI](helper/chimes/skibidi_toilet.mid) +* [PinocchioP - God-ish (神っぽいな)](https://www.youtube.com/watch?v=EHBFKhLUVig): [MIDI](helper/chimes/kamippoina.mid) + +MIDI to sequencer conversion tool (supports note events in one track only, track end event, and comment event): [midi_to_chime](helper/midi_to_chime.py) + +8 bit 8 kHz wave to RLE sample conversion tool (not even reading the header, so very jank): [pwm.py](helper/pwm.py) + +## Remote Control Server + +There is a remote control server you can enable in settings for debugging remotely when uploading firmware via OTA, or using an emulator without any screen and buttons. + +Also included is a [primitive client](helper/remote-control.py) that has pretty poor performance, but allows recording GIFs and taking screenshots. All of the screenshots and GIFs in this readme were made that way. + +https://github.com/user-attachments/assets/b1d1ee7e-b5f3-4800-a475-d44ae876bf7e + +### Usage + +1. Enable "Remote Control Server" under Settings → Display. +2. Save and Restart PIS-OS +3. Run `python ./helper/remote-control.py ` on your computer. Port 3939 must be accessible. + +### Protocol + +The protocol is very simple. + +The control client sends a control packet to the clock via UDP: + +``` +{ + uint16_t magic = 0x3939; + key_id_t pressed = (set bits of those keys that were pressed since last transaction); + key_id_t released = (set bits of those keys that were released since last transaction); +} +``` + +After that the client should expect a UDP packet from the clock with the format: + +``` +{ + uint16_t magic = 0x8888; + uint16_t display_width; + uint16_t display_height; + ... remainder: bitmap data in fanta buffer format +} +``` + ## System Requirements The basic configuration without any bluetooth functionality (no Switchbot or Balance Board integration) seems to work just fine on an ESP32 WROOM. However to be less limited by RAM size in further features I've decided to make WROVER the requirement, so further versions are not guaranteed to run on WROOM. @@ -23,7 +176,7 @@ The basic configuration without any bluetooth functionality (no Switchbot or Bal ### Speaker (at least one required) -* Piezo speaker ([driver](src/sound/beeper.cpp), [music](src/sound/melodies.cpp)) +* Piezo speakers: *now with 1-bit DMA polyphony!* ([driver](src/sound/beeper.cpp), [music](src/sound/melodies.cpp), [sequencer](src/sound/sequencer.cpp)) ### Haptics (WIP) @@ -57,24 +210,6 @@ The basic configuration without any bluetooth functionality (no Switchbot or Bal * Wii Balance Board. Set feature flag `HAS_BALANCE_BOARD_INTEGRATION`. [Driver](src/service/balance_board.cpp), based upon [code by Sasaki Takeru](https://github.com/takeru/Wiimote/tree/d81319c62ac5931da868cc289386a6d4880a4b15), requires WROVER module -## Morio Denki Plasma Display Info - -**This display uses high voltage, which could be lethal!!** - -The display comes from a bus or a train, supposedly. - -It has the following labels on the PCBs: - -* Morio Denki 6M06056 (the 8085-based control board I wasn't able to get running) -* MD 16101DS-CONT82 06 (the actual framebuffer/drive board) -* MD-24T-ADT (2) 8201 (the boards on the plasma tube itself) - -Despite using a standard "HDD" Molex 4-pin connector for the drive board power, it expects +160V on the pin where normally +12V would be supplied. Take care not to mix up the power supplies. (Plugging in +12V into the plasma board doesn't seem to damage it. Plugging in +160V into an HDD, on the other hand...) - -More detailed info is available in the following articles: - -* На русском: https://habr.com/ru/companies/timeweb/articles/808805/ -* 日本語で: https://elchika.com/article/b9f39c29-64aa-42ab-8f73-e6e27a72bd0e/ -* Demo video: https://youtu.be/D4MiHmhhjeQ +---- -You can also read the quest I went through trying to get it to run "in real time" at [EEVBlog Forums](https://www.eevblog.com/forum/repair/trying-to-figure-out-if-a-vfd-displaydriver-is-broken-(74-series-logic)/). \ No newline at end of file +by Genjitsu Labs / akasaka, 2024. diff --git a/docs/img/app/alarm.gif b/docs/img/app/alarm.gif new file mode 100644 index 0000000..1ffe1d4 Binary files /dev/null and b/docs/img/app/alarm.gif differ diff --git a/docs/img/app/alarm2_pretty.png b/docs/img/app/alarm2_pretty.png new file mode 100644 index 0000000..90a6ade Binary files /dev/null and b/docs/img/app/alarm2_pretty.png differ diff --git a/docs/img/app/alarm_pretty.png b/docs/img/app/alarm_pretty.png new file mode 100644 index 0000000..81027bc Binary files /dev/null and b/docs/img/app/alarm_pretty.png differ diff --git a/docs/img/app/settings.gif b/docs/img/app/settings.gif new file mode 100644 index 0000000..e892fbd Binary files /dev/null and b/docs/img/app/settings.gif differ diff --git a/docs/img/app/stopwatch.gif b/docs/img/app/stopwatch.gif new file mode 100644 index 0000000..40ea0da Binary files /dev/null and b/docs/img/app/stopwatch.gif differ diff --git a/docs/img/app/timer.gif b/docs/img/app/timer.gif new file mode 100644 index 0000000..bd006a4 Binary files /dev/null and b/docs/img/app/timer.gif differ diff --git a/docs/img/app/timer_melo_pretty.png b/docs/img/app/timer_melo_pretty.png new file mode 100644 index 0000000..9b92501 Binary files /dev/null and b/docs/img/app/timer_melo_pretty.png differ diff --git a/docs/img/app/weighing.gif b/docs/img/app/weighing.gif new file mode 100644 index 0000000..b2c5d10 Binary files /dev/null and b/docs/img/app/weighing.gif differ diff --git a/docs/img/hero.jpg b/docs/img/hero.jpg new file mode 100644 index 0000000..56898fb Binary files /dev/null and b/docs/img/hero.jpg differ diff --git a/docs/img/pisosremote.mp4 b/docs/img/pisosremote.mp4 new file mode 100644 index 0000000..fbdf803 Binary files /dev/null and b/docs/img/pisosremote.mp4 differ diff --git a/docs/img/widget/clock_pretty.png b/docs/img/widget/clock_pretty.png new file mode 100644 index 0000000..1f2723f Binary files /dev/null and b/docs/img/widget/clock_pretty.png differ diff --git a/docs/img/widget/foo_pretty.png b/docs/img/widget/foo_pretty.png new file mode 100644 index 0000000..4f66be0 Binary files /dev/null and b/docs/img/widget/foo_pretty.png differ diff --git a/docs/img/widget/indoor_pretty.png b/docs/img/widget/indoor_pretty.png new file mode 100644 index 0000000..969030e Binary files /dev/null and b/docs/img/widget/indoor_pretty.png differ diff --git a/docs/img/widget/rain.gif b/docs/img/widget/rain.gif new file mode 100644 index 0000000..4659d86 Binary files /dev/null and b/docs/img/widget/rain.gif differ diff --git a/docs/img/widget/sleep_pretty.png b/docs/img/widget/sleep_pretty.png new file mode 100644 index 0000000..8cd0cbd Binary files /dev/null and b/docs/img/widget/sleep_pretty.png differ diff --git a/docs/img/widget/weather.gif b/docs/img/widget/weather.gif new file mode 100644 index 0000000..92cf49c Binary files /dev/null and b/docs/img/widget/weather.gif differ diff --git a/docs/img/widget/word_pretty.png b/docs/img/widget/word_pretty.png new file mode 100644 index 0000000..4436c86 Binary files /dev/null and b/docs/img/widget/word_pretty.png differ diff --git a/helper/chimes/arise.mid b/helper/chimes/arise.mid index 7b0b134..461f3e5 100644 Binary files a/helper/chimes/arise.mid and b/helper/chimes/arise.mid differ diff --git a/helper/chimes/ark.mid b/helper/chimes/ark.mid new file mode 100644 index 0000000..ac37e1a Binary files /dev/null and b/helper/chimes/ark.mid differ diff --git a/helper/chimes/bouken.mid b/helper/chimes/bouken.mid index b339fdc..e74ee41 100644 Binary files a/helper/chimes/bouken.mid and b/helper/chimes/bouken.mid differ diff --git a/helper/chimes/duvet.mid b/helper/chimes/duvet.mid index 734611b..78a93dc 100644 Binary files a/helper/chimes/duvet.mid and b/helper/chimes/duvet.mid differ diff --git a/helper/chimes/gammapolisz.mid b/helper/chimes/gammapolisz.mid index c72b7b7..9540823 100644 Binary files a/helper/chimes/gammapolisz.mid and b/helper/chimes/gammapolisz.mid differ diff --git a/helper/chimes/gentlejena.mid b/helper/chimes/gentlejena.mid index 1499aa4..d1b994f 100644 Binary files a/helper/chimes/gentlejena.mid and b/helper/chimes/gentlejena.mid differ diff --git a/helper/chimes/kamippoina.mid b/helper/chimes/kamippoina.mid new file mode 100644 index 0000000..d52067b Binary files /dev/null and b/helper/chimes/kamippoina.mid differ diff --git a/helper/chimes/skibidi_toilet.mid b/helper/chimes/skibidi_toilet.mid new file mode 100644 index 0000000..b3921e8 Binary files /dev/null and b/helper/chimes/skibidi_toilet.mid differ diff --git a/helper/midi_to_chime.py b/helper/midi_to_chime.py index f068125..6045153 100644 --- a/helper/midi_to_chime.py +++ b/helper/midi_to_chime.py @@ -1,8 +1,6 @@ #!/usr/bin/env python3 -# this is very jank, do not expect it to work as is -# it worked for some melodies though - +import pdb from sys import argv from mido import MidiFile import freq_note_converter @@ -10,45 +8,66 @@ mid = MidiFile(argv[1]) name = argv[2] -last_time = 0 -evts = [] # of (freq in hz or 0, delay in ms) ended = False +class Event(): + def __init__(self, kind, chan, arg): + self.kind = kind + self.chan = chan + self.arg = arg + + def __str__(self): + return f" {{{self.kind}, {str(self.chan)}, {str(int(self.arg))}}}," + +class Comment(): + def __init__(self, s): + self.content = s + self.kind = "REM" + + def __str__(self): + return f" /* {self.content} */" + +evts = [] + +def prev_note_off_event(chan): + for i in range(1,len(evts)+1): + e = evts[-i] + if e.kind == "FREQ_SET" and e.arg == 0 and e.chan == chan: + return e + elif e.kind == "DELAY": + return None + return None + for msg in mid: + print(msg) if msg.type == "note_on" or msg.type == "note_off": - print(msg) - if msg.time > 0 and len(evts) > 0 and evts[-1][1] == 0: - evts[-1][1] = int(msg.time * 1000) + if msg.time > 0.005: + evts.append(Event("DELAY", 0, msg.time * 1000)) if msg.type == "note_on" and msg.velocity > 0: - evts.append([int(freq_note_converter.from_note_index(msg.note).freq), 0, ""]) + existing_evt = prev_note_off_event(msg.channel) + if existing_evt is not None: + existing_evt.arg = freq_note_converter.from_note_index(msg.note).freq + else: + evts.append(Event("FREQ_SET", msg.channel, freq_note_converter.from_note_index(msg.note).freq)) else: # note off - evts.append([0, 0, ""]) + evts.append(Event("FREQ_SET", msg.channel, 0)) elif msg.type == "end_of_track": - print(msg) if ended: raise Exception("WTF, already ended") ended = True - if evts[-1][0] == 0: - # pause exists, just extend it - evts[-1][1] = int(msg.time * 1000) - else: - evts.append([0, int(msg.time*1000), ""]) + evts.append(Event("DELAY", 0, msg.time * 1000)) elif msg.type == "marker": - evts[-1][2] = msg.text - + if msg.time > 0.005: + evts.append(Event("DELAY", 0, msg.time * 1000)) + evts.append(Comment(msg.text)) + if msg.text == "LOOP": + evts.append(Event("LOOP_POINT_SET", 0, 0)) -print(evts) print("static const melody_item_t "+name+"_data[] = {") -i = 0 -while i < len(evts): - if evts[i][0] != 0 or evts[i][1] != 0: - print(" {"+str(evts[i][0])+", "+str(evts[i][1])+"}, ") - if evts[i][2] != "": - print(" ") - print(" // " + evts[i][2]) - i+=1 +for e in evts: + print(str(e)) print("};") print("const melody_sequence_t "+name+" = MELODY_OF("+name+"_data);") \ No newline at end of file diff --git a/helper/pretty-screenshot.py b/helper/pretty-screenshot.py new file mode 100644 index 0000000..048a5b4 --- /dev/null +++ b/helper/pretty-screenshot.py @@ -0,0 +1,33 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +import sys +from pathlib import Path + +IMG_IN=sys.argv[1] +IMG_OUT=sys.argv[2] if len(sys.argv) > 2 else str(Path(IMG_IN).with_suffix(''))+"_pretty.png" + +PIX_COLOR=(0, 210, 242) +PIX_SIZE=4 +PIX_PITCH_H=1 +PIX_PITCH_W=1 + +from PIL import Image, ImageFilter +im = Image.open(IMG_IN, 'r') +src = im.load() + +width, height = im.size + +out_img = Image.new(mode="RGB", size=(width * (PIX_SIZE + PIX_PITCH_H), height * (PIX_SIZE + PIX_PITCH_H))) + +for y in range(height): + for x in range(width): + v = src[x, y] + for dy in range(PIX_SIZE): + for dx in range(PIX_SIZE): + out_x = x * (PIX_SIZE + PIX_PITCH_W) + dx + out_y = y * (PIX_SIZE + PIX_PITCH_H) + dy + if out_x < out_img.width and out_y < out_img.height: + out_img.putpixel((out_x, out_y), PIX_COLOR if v > 0 else (0, 0, 0)) + +out_img.filter(ImageFilter.GaussianBlur(radius=PIX_SIZE/10)).save(IMG_OUT) \ No newline at end of file diff --git a/helper/pwm.py b/helper/pwm.py new file mode 100644 index 0000000..3a11390 --- /dev/null +++ b/helper/pwm.py @@ -0,0 +1,60 @@ +#-*- coding: utf-8 -*- + +# Super jank converter from 8bit WAV into RLE PWM + preview +# Not reading the header or anything hence super jank + +import sys + +MARGIN = 4 + +fname = sys.argv[1] +sname = sys.argv[2] +oname = sys.argv[3] if len(sys.argv) >= 4 else None +sdata = open(fname, 'rb').read() +outf = None +if oname is not None: + outf = open(oname, 'wb') + outf.write(sdata[:0x28]) + +sdata = sdata[0x28::] +i = 0 +min = 999 +max = 0 +sts = 0xFF +last_sts = 0xFF +rle_buf = [0] + +def median(data): + x = list(data) + x.sort() + mid = len(x) // 2 + return (x[mid] + x[~mid]) / 2.0 + +med = median(sdata) +print("Median", med) +HIGH = med + MARGIN +LO = med - MARGIN + +while i < len(sdata): + curSample = sdata[i] + if curSample >= HIGH: + sts = 255 + elif curSample <= LO: + sts = 1 + if curSample < min and curSample > 0: + min = curSample + if curSample > max and curSample > 0: + max = curSample + if outf is not None: + outf.write(bytes([sts, sts])) + if sts != last_sts: + rle_buf.append(0) + last_sts = sts + if rle_buf[-1] == 255: + rle_buf.append(0) + rle_buf.append(0) + rle_buf[-1] += 1 + i += 2 + +print(f"static const uint8_t {sname}_rle_data[] = {{" + str(rle_buf)[1::][:-1:] + "};") +print(f"static const rle_sample_t {sname} = {{ .sample_rate = 4000, .root_frequency = 524 /* C5 */, .rle_data = {sname}_rle_data, .length = {len(rle_buf)} }};") \ No newline at end of file diff --git a/helper/remote-control.py b/helper/remote-control.py new file mode 100644 index 0000000..e6a5fe1 --- /dev/null +++ b/helper/remote-control.py @@ -0,0 +1,185 @@ +#!/bin/env python +# -*- coding: utf-8 -*- +import tkinter as tk +from tkinter.filedialog import asksaveasfilename +import sys, socket, struct +from PIL import Image, ImageFilter +import pdb +import threading +import time + +IP=sys.argv[1] +PORT=3939 +sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) +sock.settimeout(0.1) + +PIX_COLOR=(0, 210, 242) +PIX_SIZE=4 +PIX_PITCH_H=1 +PIX_PITCH_W=1 + +PRESS_STS=0 +RELEASE_STS=0 +DISP_STS=[] +DISP_RES=(0,0) +CANVAS_RES=(500,80) + +REC_IMGS=[] +REC_STS=False + +def _buf_to_pillow(buf, width, height): + global PIX_COLOR, PIX_PITCH_H, PIX_PITCH_W, PIX_SIZE + out_img = Image.new(mode="RGB", size=(width * (PIX_SIZE + PIX_PITCH_H), height * (PIX_SIZE + PIX_PITCH_H))) + for x in range(width): + for y in range(height): + tidx = (x * (height // 8)) + (y // 8) + col = buf[tidx] + v = col & (1 << (y % 8)) + for dx in range(PIX_SIZE): + for dy in range(PIX_SIZE): + out_x = x * (PIX_SIZE + PIX_PITCH_W) + dx + out_y = y * (PIX_SIZE + PIX_PITCH_H) + dy + if out_x < out_img.width and out_y < out_img.height: + out_img.putpixel((out_x, out_y), PIX_COLOR if v > 0 else (0, 0, 0)) + return out_img.filter(ImageFilter.GaussianBlur(radius=PIX_SIZE/10)) + +def _buf_to_screen(buf, width, height): + global PIX_COLOR, PIX_PITCH_H, PIX_PITCH_W, PIX_SIZE, CANVAS_RES, canvas + canvas.delete('all') + left_offset = ((CANVAS_RES[0] - width) / 2) / PIX_SIZE + top_offset = ((CANVAS_RES[1] - height) / 2) / PIX_SIZE + for x in range(width): + for y in range(height): + tidx = (x * (height // 8)) + (y // 8) + col = buf[tidx] + v = col & (1 << (y % 8)) + canvas.create_rectangle(x * PIX_SIZE + left_offset, y * PIX_SIZE + top_offset, x * PIX_SIZE+PIX_SIZE + left_offset, y * PIX_SIZE+PIX_SIZE + top_offset, fill=("white" if v>0 else "black")) + +def render_screenshot(): + global DISP_STS, DISP_RES + temp = DISP_STS[:] + width, height = DISP_RES + f = asksaveasfilename(initialfile = 'screen.png', defaultextension=".png",filetypes=[("PNG Image","*.png")]) + if f == "": + return + out_img = _buf_to_pillow(temp, width, height) + out_img.save(f) + +def rec_toggle(): + global rec_button, REC_STS, REC_IMGS, DISP_RES + if not REC_STS: + REC_STS = True + rec_button.configure(bg = "red", text="STOP") + else: + REC_STS = False + rec_button.configure(bg = "SystemButtonFace", text="Record") + width, height = DISP_RES + f = asksaveasfilename(initialfile = 'screen.gif', defaultextension=".gif",filetypes=[("Animated GIF","*.gif")]) + if f == "": + REC_IMGS = [] + return + REC_IMGS = list(map(lambda buf: _buf_to_pillow(buf, width, height), REC_IMGS)) + REC_IMGS[0].save(f, save_all=True, append_images=REC_IMGS[1:], optimize=False, duration=34, loop=0) + REC_IMGS = [] + + +def ctl_btn_pressed(event): + global PRESS_STS + PRESS_STS |= event + +def ctl_btn_released(event): + global RELEASE_STS + RELEASE_STS |= event + +def tx_pkt(): + global PRESS_STS, RELEASE_STS, sock, IP, PORT + pkt = struct.pack("HII", 0x3939, PRESS_STS, RELEASE_STS) + PRESS_STS = 0 + RELEASE_STS = 0 + sock.sendto(pkt, (IP, PORT)) + rx_pkt() + +def rx_pkt(): + global sock, IP, PORT, DISP_STS, DISP_RES, REC_STS, REC_IMGS + try: + data, addrport = sock.recvfrom(255) + except TimeoutError: + return + if addrport[0] != IP or addrport[1] != PORT: + return + if data[0] != 0x88 or data[1] != 0x88: + print("Bad magic") + return + size = data[2:6:] + res = struct.unpack('HH', size) + if res != DISP_RES: + print("New resolution", res) + DISP_RES = res + if REC_STS: + REC_IMGS = [] + bitmap = data[6::] + DISP_STS = bitmap + if REC_STS: + REC_IMGS.append(bitmap) + +def send_packet_loop(): + while True: + tx_pkt() + time.sleep(0.033) + +def drawing(): + global DISP_RES, DISP_STS, window + _buf_to_screen(DISP_STS, DISP_RES[0], DISP_RES[1]) + window.after(33, drawing) + + +# Create the main window +window = tk.Tk() +window.title("PIS-OS Remote") +window.resizable(False, False) + +# Set window size +window.geometry("520x150") +window.grid_columnconfigure(0, weight=1, uniform="foo") +window.grid_columnconfigure(1, weight=1, uniform="foo") +window.grid_columnconfigure(2, weight=1, uniform="foo") +window.grid_columnconfigure(3, weight=1, uniform="foo") + +# Create the canvas +canvas = tk.Canvas(window, width=CANVAS_RES[0], height=CANVAS_RES[1], bg="black") +canvas.grid(row = 1, column = 0, columnspan=4) + +left_button = tk.Button(window, text="←") +left_button.grid(row = 2, column = 0) +left_button.bind("", lambda _: ctl_btn_pressed(4)) +left_button.bind("", lambda _: ctl_btn_released(4)) + +top_button = tk.Button(window, text="↑") +top_button.grid(row = 2, column = 1) +top_button.bind("", lambda _: ctl_btn_pressed(1)) +top_button.bind("", lambda _: ctl_btn_released(1)) + +bottom_button = tk.Button(window, text="↓") +bottom_button.grid(row = 2, column = 2) +bottom_button.bind("", lambda _: ctl_btn_pressed(2)) +bottom_button.bind("", lambda _: ctl_btn_released(2)) + +right_button = tk.Button(window, text="→") +right_button.grid(row = 2, column = 3) +right_button.bind("", lambda _: ctl_btn_pressed(8)) +right_button.bind("", lambda _: ctl_btn_released(8)) + +ss_button = tk.Button(window, text="Screenshot", command=render_screenshot) +ss_button.grid(row = 0, column = 0, columnspan = 2) + +rec_button = tk.Button(window, text="Record", command=rec_toggle) +rec_button.grid(row = 0, column = 2, columnspan = 2) + +# Start the background thread for sending packets +packet_thread = threading.Thread(target=send_packet_loop) +packet_thread.daemon = True +packet_thread.start() + +# Start the main event loop +window.after(33, drawing) +window.mainloop() diff --git a/include/app/alarm_editor.h b/include/app/alarm_editor.h index d73d059..b2423bf 100644 --- a/include/app/alarm_editor.h +++ b/include/app/alarm_editor.h @@ -1,17 +1,19 @@ #pragma once #include #include +#include #include #include "proto/navmenu.h" class AppShimAlarmEditor: public ProtoShimNavMenu { public: - AppShimAlarmEditor(Beeper*); + AppShimAlarmEditor(Beeper*, NewSequencer*); void pop_renderable(transition_type_t = TRANSITION_SLIDE_HORIZONTAL_RIGHT); private: class AlarmEditorView; Beeper * beeper; + NewSequencer * sequencer; int current_editing_idx; alarm_setting_t current_editing_setting; diff --git a/include/app/alarming.h b/include/app/alarming.h index 5dd7d11..70f0017 100644 --- a/include/app/alarming.h +++ b/include/app/alarming.h @@ -2,20 +2,21 @@ #include #include #include +#include #include -void app_alarming_prepare(Beeper*); +void app_alarming_prepare(NewSequencer*); void app_alarming_draw(FantaManipulator*); void app_alarming_process(); class AppShimAlarming: public Renderable { public: - AppShimAlarming(Beeper*b) { - beeper = b; + AppShimAlarming(NewSequencer*b) { + sequencer = b; } void prepare() { - app_alarming_prepare(beeper); + app_alarming_prepare(sequencer); } void render(FantaManipulator*fb) { @@ -26,5 +27,5 @@ class AppShimAlarming: public Renderable { app_alarming_process(); } private: - Beeper *beeper; + NewSequencer *sequencer; }; \ No newline at end of file diff --git a/include/app/idle.h b/include/app/idle.h index 2262e2e..a0642eb 100644 --- a/include/app/idle.h +++ b/include/app/idle.h @@ -2,16 +2,17 @@ #include #include #include +#include #include -void app_idle_prepare(SensorPool*, Beeper*); +void app_idle_prepare(SensorPool*, Beeper*, NewSequencer*); void app_idle_draw(FantaManipulator*); void app_idle_process(); class AppShimIdle: public Renderable { public: - AppShimIdle(SensorPool*sp, Beeper*b) { - app_idle_prepare(sp, b); + AppShimIdle(SensorPool*sp, Beeper*b, NewSequencer*s) { + app_idle_prepare(sp, b, s); } void render(FantaManipulator*fb) { diff --git a/include/app/menu.h b/include/app/menu.h index b0b9d82..c302b8e 100644 --- a/include/app/menu.h +++ b/include/app/menu.h @@ -3,11 +3,12 @@ #include #include #include +#include #include class AppShimMenu: public ProtoShimNavMenu { public: - AppShimMenu(Beeper*); + AppShimMenu(Beeper*, NewSequencer*); void prepare(); void step(); diff --git a/include/app/timer_editor.h b/include/app/timer_editor.h index 02c3ac5..b463f83 100644 --- a/include/app/timer_editor.h +++ b/include/app/timer_editor.h @@ -7,7 +7,7 @@ class AppShimTimerEditor: public ProtoShimNavigationStack { public: - AppShimTimerEditor(Beeper *); + AppShimTimerEditor(Beeper *, NewSequencer *); ~AppShimTimerEditor(); private: class TimerEditorMainScreen; diff --git a/include/device_config.h b/include/device_config.h index c87f160..c4b0ad3 100644 --- a/include/device_config.h +++ b/include/device_config.h @@ -4,15 +4,24 @@ #define HAS(x) defined(HAS_##x) // ---- SOFTWARE FEATURE FLAGS + +// Enable the Wordnik API and Word Of The Day screen. UNSTABLE: Uses a lot of RAM for HTTPS. #define HAS_WORDNIK_API + +// Enable over-the-air firmware version upgrade. NB: Requires a new partition map, someday later // #define HAS_OTAFVU + +// Enable Switchbot Meter temperature probing. UNSTABLE: Uses NimBLE so a lot of RAM, disconnects over time. // #define HAS_SWITCHBOT_METER_INTEGRATION -#define HAS_BALANCE_BOARD_INTEGRATION + +// Enable Wii Balance Board measuring. UNSTABLE: Uses Bluedroid (a FUCKTON of RAM), periodic disconnects or reboots without leaving a stack trace. +// #define HAS_BALANCE_BOARD_INTEGRATION // ---- HARDWARE #ifdef ESP32 #define HAS_BLUETOOTH_LE + #define HAS_BLUETOOTH_CLASSIC #endif #ifdef DEVICE_PLASMA_CLOCK @@ -26,7 +35,13 @@ // ---- DEPENDENCY RULES #if !HAS(BLUETOOTH_LE) #if HAS(SWITCHBOT_METER_INTEGRATION) - #undef HAS_SWITCHBOT_METER_INTEGRATION + #error Switchbot requires Bluetooth LE + #endif +#endif + +#if !HAS(BLUETOOTH_CLASSIC) + #if HAS(BALANCE_BOARD_INTEGRATION) + #error Balance Board requires Bluetooth Classic #endif #endif diff --git a/include/devices/big_clock.h b/include/devices/big_clock.h index 7697629..28288c2 100644 --- a/include/devices/big_clock.h +++ b/include/devices/big_clock.h @@ -12,7 +12,7 @@ // Plasma Information System OS (not DOS, there's no disk in it!) #define PRODUCT_NAME "PIS-OS" -#define PRODUCT_VERSION "2.2" +#define PRODUCT_VERSION "3.0" // ---- Connection to DISP BOARD ---- const gpio_num_t HWCONF_PLASMA_DATABUS_GPIOS[] = { diff --git a/include/devices/smol_clock.h b/include/devices/smol_clock.h index 5f3ddea..16f02da 100644 --- a/include/devices/smol_clock.h +++ b/include/devices/smol_clock.h @@ -9,7 +9,7 @@ // Plasma Information System OS (not DOS, there's no disk in it!) #define PRODUCT_NAME "microPIS-OS" -#define PRODUCT_VERSION "2.2" +#define PRODUCT_VERSION "3.0" // ---- Connection to beeper ---- const gpio_num_t HWCONF_BEEPER_GPIO = GPIO_NUM_12; diff --git a/include/display/md_plasma.h b/include/display/md_plasma.h index 163bf9b..f8106ed 100644 --- a/include/display/md_plasma.h +++ b/include/display/md_plasma.h @@ -23,6 +23,8 @@ class MorioDenkiPlasmaDriver: public DisplayDriver { const gpio_num_t blanking, const gpio_num_t hv_enable ); + + void initialize(); /// @brief Reset the display controller void reset(); @@ -44,7 +46,6 @@ class MorioDenkiPlasmaDriver: public DisplayDriver { gpio_num_t bright_gpio; gpio_num_t show_gpio; gpio_num_t hv_en_gpio; - void initialize(); inline void set_databus(uint8_t data); inline void pulse_clock(); /// @brief Send a half-column to the display controller diff --git a/include/display/ws0010.h b/include/display/ws0010.h index d1658ca..c72df49 100644 --- a/include/display/ws0010.h +++ b/include/display/ws0010.h @@ -17,6 +17,7 @@ class Ws0010OledDriver: public DisplayDriver { const gpio_num_t en ); + void initialize(); /// @brief Reset the display controller void reset(); void clear(); @@ -41,7 +42,6 @@ class Ws0010OledDriver: public DisplayDriver { bool is_writing_ddram; uint8_t ddram_ptr; - void initialize(); inline void set_databus(uint8_t data); inline void set_is_command(bool); inline void pulse_clock(); diff --git a/include/graphics/display_driver.h b/include/graphics/display_driver.h index 22c3346..948cc7b 100644 --- a/include/graphics/display_driver.h +++ b/include/graphics/display_driver.h @@ -3,6 +3,7 @@ class DisplayDriver { public: + virtual void initialize(); /// @brief Reset the display controller virtual void reset(); /// @brief Send an array of half-columns to the display controller diff --git a/include/graphics/fanta_manipulator.h b/include/graphics/fanta_manipulator.h index 516db29..777ec43 100644 --- a/include/graphics/fanta_manipulator.h +++ b/include/graphics/fanta_manipulator.h @@ -73,4 +73,5 @@ class FantaManipulator { bool * dirty; int width; int height; + void put_horizontal_data(const uint8_t* data, int x, int y, int width, int height, const uint8_t* mask, bool invert); }; \ No newline at end of file diff --git a/include/graphics/screenshooter.h b/include/graphics/screenshooter.h new file mode 100644 index 0000000..732cd5c --- /dev/null +++ b/include/graphics/screenshooter.h @@ -0,0 +1,15 @@ +#pragma once +#include "fanta_manipulator.h" +#include + +class Screenshooter { +public: + Screenshooter(FantaManipulator *); + bool capture_png(const uint8_t ** pngDataBufOut, size_t * pngDataLenOut); + void start_server(uint16_t port); + void stop_server(); + +private: + TaskHandle_t hServerTask = NULL; + FantaManipulator * framebuffer = nullptr; +}; \ No newline at end of file diff --git a/include/graphics/sprite.h b/include/graphics/sprite.h index 65470dc..52f4022 100644 --- a/include/graphics/sprite.h +++ b/include/graphics/sprite.h @@ -2,13 +2,23 @@ #include #include -/// @brief A piece of graphics, laid out horizontally. -/// @details I.e. a 14x2 spritewill consist of 4 bytes. 0th one will contain the leftmost 6 pixels of the top row aligned towards LSB, -/// 1st one will contain the rightmost 8 pixels, 2nd one will contain the leftmost 6px of the bottom row, and so forth. +typedef enum sprite_fmt { + /// A horizontally laid out sprite + /// @details I.e. a 14x2 sprite will consist of 4 bytes. 0th one will contain the leftmost 6 pixels of the top row aligned towards LSB, + /// 1st one will contain the rightmost 8 pixels, 2nd one will contain the leftmost 6px of the bottom row, and so forth. + SPRFMT_HORIZONTAL, + /// A vertically laid out sprite + /// @details I.e. a 14x2 sprite will consist of 4 bytes. 0th one will contain the 8 pixels of the leftmost column with top left being MSB, + /// 1st one will contain the next 6 pixels of the lefrmost column aligned towards MSB, 2nd one will contain the top 8px of the second column and so on. + SPRFMT_NATIVE +} sprite_fmt_t; + +/// @brief A piece of graphics with a size and optional mask typedef struct sprite { uint8_t width, height; const uint8_t* data; const uint8_t* mask; + sprite_fmt_t format; } sprite_t; /// @brief An animated sprite. @@ -22,6 +32,7 @@ typedef struct ani_sprite { /// @brief How many display frames should the first frame be shown before the animation loops uint8_t holdoff_frames; const uint8_t* data; + sprite_fmt_t format; } ani_sprite_t; /// @brief A context of a playing animated sprite @@ -38,11 +49,6 @@ typedef struct ani_sprite_state { typedef uint8_t* fanta_buffer_t; -/// @brief Convert a horizontally laid out, LSB aligned sprite bitmap of an arbitrary size, to a vertically aligned 16-bit-per-column Fanta buffer. -/// @note Unused pixels are filled with 0's. Transparency et al. should be handled by the drawing code. -extern fanta_buffer_t sprite_to_fanta(const sprite_t*); -extern fanta_buffer_t mask_to_fanta(const sprite_t*); - /// @brief Initialize a playback context for an animated sprite extern ani_sprite_state_t ani_sprite_prepare(const ani_sprite*); /// @brief Get the current animation frame to be drawn for an animated sprite diff --git a/include/input/keys.h b/include/input/keys.h index dc24501..9fbe623 100644 --- a/include/input/keys.h +++ b/include/input/keys.h @@ -3,11 +3,11 @@ #include typedef enum key_id { - KEY_UP = (1<< 1), - KEY_DOWN = (1 << 2), - KEY_LEFT = (1 << 3), - KEY_RIGHT = (1 << 4), - KEY_HEADPAT = (1 << 5), + KEY_UP = (1 << 0), + KEY_DOWN = (1 << 1), + KEY_LEFT = (1 << 2), + KEY_RIGHT = (1 << 3), + KEY_HEADPAT = (1 << 4), KEY_MAX_INVALID = 0xFF } key_id_t; diff --git a/include/network/admin_panel.h b/include/network/admin_panel.h index 0ce6c51..50a9599 100644 --- a/include/network/admin_panel.h +++ b/include/network/admin_panel.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include /// Set up and start the web admin service. -void admin_panel_prepare(SensorPool*, Beeper*); \ No newline at end of file +void admin_panel_prepare(SensorPool*, Beeper*, Screenshooter*); \ No newline at end of file diff --git a/include/network/otafvu.h b/include/network/otafvu.h index fd9f515..6a35de7 100644 --- a/include/network/otafvu.h +++ b/include/network/otafvu.h @@ -8,14 +8,14 @@ /// @brief Manages the ArduinoOTA update service class OTAFVUManager { public: - OTAFVUManager(Console*, BeepSequencer*); + OTAFVUManager(Console*, NewSequencer*); ~OTAFVUManager(); /// @brief Perform pending work of the service. Normally this is called by the internal task of the service and doesn't need to be called externally. void task(); private: Console *con; - BeepSequencer *seq; + NewSequencer *seq; /// @brief Prepare to install an OTA update void get_ready(); @@ -28,7 +28,7 @@ class OTAFVUManager { #else class OTAFVUManager { public: - OTAFVUManager(Console*, BeepSequencer*) {} + OTAFVUManager(Console*, NewSequencer*) {} ~OTAFVUManager() {} }; #endif \ No newline at end of file diff --git a/include/os_config.h b/include/os_config.h new file mode 100644 index 0000000..8561f59 --- /dev/null +++ b/include/os_config.h @@ -0,0 +1,24 @@ +#pragma once +#include + +// ----- Task Priorities ----- + +#define pisosTASK_PRIORITY_CONSOLE 2 +#define pisosTASK_PRIORITY_REMOTE_DESKTOP 3 +#define pisosTASK_PRIORITY_FRAMEBUFFER (configMAX_PRIORITIES - 1) +#define pisosTASK_PRIORITY_WAVEOUT (configMAX_PRIORITIES - 1) +#define pisosTASK_PRIORITY_KEYPAD (configMAX_PRIORITIES - 3) +#define pisosTASK_PRIORITY_WEBADMIN 4 +#define pisosTASK_PRIORITY_OTAFVU 10 +#define pisosTASK_PRIORITY_SENSOR 3 +#define pisosTASK_PRIORITY_ALARM 4 +#define pisosTASK_PRIORITY_BALANCEBOARD 2 +#define pisosTASK_PRIORITY_FOOBAR_CLIENT 2 +#define pisosTASK_PRIORITY_POWER_MANAGEMENT 4 +#define pisosTASK_PRIORITY_WORDNIK 1 +#define pisosTASK_PRIORITY_WEATHER 1 + +// ----- WaveOut channels ----- + +#define pisosWAVE_CHANNEL_BEEPER 0 +#define pisosWAVE_CHANNEL_SEQUENCER 1 \ No newline at end of file diff --git a/include/rsrc/common_icons.h b/include/rsrc/common_icons.h index b84527e..ada4569 100644 --- a/include/rsrc/common_icons.h +++ b/include/rsrc/common_icons.h @@ -18,7 +18,8 @@ static const sprite_t alarm_icns = { .width = 16, .height = 16, .data = alarm_icns_data, - .mask = nullptr + .mask = nullptr, + .format = SPRFMT_HORIZONTAL }; static const uint8_t good_icns_data[] = { @@ -26,14 +27,14 @@ static const uint8_t good_icns_data[] = { 0x7f, 0xfe, 0x7f, 0xfa, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xf4, 0x7f, 0xf8, 0x7f, 0xe8, 0x0f, 0xf0 }; -static const sprite_t good_icns = { .width = 16, .height = 16, .data = good_icns_data, .mask = nullptr }; +static const sprite_t good_icns = { .width = 16, .height = 16, .data = good_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; static const uint8_t hourglass_icns_data[] = { 0x3f, 0xfe, 0x00, 0x00, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x0b, 0xe8, 0x05, 0xd0, 0x02, 0xa0, 0x02, 0x20, 0x04, 0x10, 0x08, 0x88, 0x11, 0xc4, 0x12, 0xe4, 0x15, 0x74, 0x00, 0x00, 0x3f, 0xfe }; -static const sprite_t hourglass_icns = { .width = 16, .height = 16, .data = hourglass_icns_data, .mask = nullptr }; +static const sprite_t hourglass_icns = { .width = 16, .height = 16, .data = hourglass_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; static const uint8_t icon_thermo_data[] = { // By PiiXL @@ -46,5 +47,6 @@ static const sprite_t icon_thermo_1616 = { .width = 16, .height = 16, .data = icon_thermo_data, - .mask = nullptr + .mask = nullptr, + .format = SPRFMT_HORIZONTAL }; \ No newline at end of file diff --git a/include/service/prefs.h b/include/service/prefs.h index d22d9ed..60f38cc 100644 --- a/include/service/prefs.h +++ b/include/service/prefs.h @@ -28,6 +28,7 @@ static constexpr prefs_key_t PREFS_KEY_MOTIONLESS_TIME_HV_OFF_SECONDS = "mot_hv_ static constexpr prefs_key_t PREFS_KEY_WEATHER_LAT = "w_lat"; static constexpr prefs_key_t PREFS_KEY_WEATHER_LON = "w_lon"; +static constexpr prefs_key_t PREFS_KEY_WEATHER_OVERLAY = "w_ovl"; static constexpr prefs_key_t PREFS_KEY_WEATHER_APIKEY = "w_apikey"; static constexpr prefs_key_t PREFS_KEY_WEATHER_INTERVAL_MINUTES = "w_interval_m"; @@ -82,6 +83,8 @@ static constexpr prefs_key_t PREFS_KEY_TIMER_MELODY = "timer_melo"; static constexpr prefs_key_t PREFS_KEY_BALANCE_BOARD_OFFSET = "bbrd_offs"; +static constexpr prefs_key_t PREFS_KEY_REMOTE_SERVER = "rc_svr"; + void prefs_force_save(); String prefs_get_string(prefs_key_t, String def = String()); diff --git a/include/sound/beeper.h b/include/sound/beeper.h index bdc7b8b..75da021 100644 --- a/include/sound/beeper.h +++ b/include/sound/beeper.h @@ -1,6 +1,7 @@ #pragma once +#include +#include #include - typedef enum beeper_channels { /// @brief Channel for ambient sounds (clock ticking, etc) CHANNEL_AMBIANCE = 0, @@ -15,21 +16,26 @@ typedef enum beeper_channels { CHANNEL_SYSTEM = 7 } beeper_channel_t; -static const uint16_t DUTY_SQUARE = 0x1FF; +static const uint16_t DUTY_SQUARE = 2; -class Beeper { +class Beeper: public WaveGenerator { public: - Beeper(gpio_num_t pin, uint8_t ledcChannel); + Beeper(); + ~Beeper(); + void set_channel_state(beeper_channel_t, bool); bool is_channel_enabled(beeper_channel_t); + size_t fill_buffer(void* buffer, size_t length_) override; void start_tone(beeper_channel_t, uint, uint16_t duty = DUTY_SQUARE); void stop_tone(beeper_channel_t); /// @brief Play a tone for a precise amount of milliseconds. Blocks the whole tasks and might block neighboring tasks, so use sparingly. void beep_blocking(beeper_channel_t, uint freq, uint len, uint16_t duty = DUTY_SQUARE); private: + ToneGenerator* voice; uint8_t channel_status; int active_channel; - uint8_t pwm_channel; + int samples; + int duration_samples; }; \ No newline at end of file diff --git a/include/sound/generators.h b/include/sound/generators.h new file mode 100644 index 0000000..1a3dcd9 --- /dev/null +++ b/include/sound/generators.h @@ -0,0 +1,72 @@ +#pragma once +#include + +class ToneGenerator { +public: + enum Parameter { + PARAMETER_FREQUENCY, + PARAMETER_DUTY, + PARAMETER_ACTIVE, + PARAMETER_SAMPLE_ADDR, + }; + virtual size_t generate_samples(void* buffer, size_t length, uint32_t wanted_samples) { return 0; } + virtual void set_parameter(Parameter p, int v) { } + virtual void reset_phase() {} +}; + + +class SquareGenerator: public ToneGenerator { +public: + SquareGenerator(); + void set_frequency(int freq); + void set_active(bool a); + void reset_phase() override; + void set_parameter(Parameter p, int v) override; + size_t generate_samples(void* buffer, size_t length, uint32_t want_samples_) override; + +private: + int phase; + int wavelength; + int duty; + bool active; +}; + + +class NoiseGenerator: public ToneGenerator { +public: + NoiseGenerator(); + void set_parameter(Parameter p, int v) override; + size_t generate_samples(void* buffer, size_t length, uint32_t want_samples_) override; + +private: + int phase; + int wavelength; + bool state; + bool active; + uint32_t rng; +}; + +typedef struct rle_sample { + const uint16_t sample_rate; + const uint16_t root_frequency; + const uint8_t* rle_data; + const size_t length; +} rle_sample_t; + +class Sampler: public ToneGenerator { +public: + Sampler(); + void set_parameter(Parameter p, int v) override; + size_t generate_samples(void* buffer, size_t length, uint32_t want_samples_) override; + + void load_sample(const rle_sample_t *); +private: + bool active; + bool state; + const rle_sample_t * waveform; + int playhead; + int remaining_samples; + int skip_factor; + int stretch_factor; + void rewind(); +}; diff --git a/include/sound/melodies.h b/include/sound/melodies.h index ee7f1c6..87f1327 100644 --- a/include/sound/melodies.h +++ b/include/sound/melodies.h @@ -6,26 +6,10 @@ extern const melody_sequence_t just_beep; extern const melody_sequence_t pc98_pipo; extern const melody_sequence_t tulula_fvu; extern const melody_sequence_t oelutz_fvu; -extern const melody_sequence_t arise; -extern const melody_sequence_t caramell; -extern const melody_sequence_t duvet; -extern const melody_sequence_t truth; -extern const melody_sequence_t haruhi_no_omoi; -extern const melody_sequence_t wpip; -extern const melody_sequence_t hishoku; -extern const melody_sequence_t bouken; -extern const melody_sequence_t gentle_jena; -extern const melody_sequence_t gammapolisz; -extern const melody_sequence_t like_the_wind; -extern const melody_sequence_t waiting_freqs; -extern const melody_sequence_t the_way; -extern const melody_sequence_t guitar_hero; -extern const melody_sequence_t syabon; -extern const melody_sequence_t steiner; -extern const melody_sequence_t towa; + extern const char * all_chime_names_csv; extern const std::vector all_chime_names; extern const melody_sequence_t all_chime_list[]; extern const int all_chime_count; -melody_sequence_t melody_from_no(int melody_no); \ No newline at end of file +const melody_sequence_t * melody_from_no(int melody_no); \ No newline at end of file diff --git a/include/sound/sequencer.h b/include/sound/sequencer.h index 7233ae4..e323f44 100644 --- a/include/sound/sequencer.h +++ b/include/sound/sequencer.h @@ -1,14 +1,20 @@ #pragma once #include +#include -#define SEQ_LEN_FLAG_TIMBRE_SET (INT_MAX - 1) -#define SEQ_LEN_FLAG_THE_LOOPAH (INT_MAX - 2) +typedef enum melody_item_type { + FREQ_SET, // or 0 to turn off + DUTY_SET, + DELAY, + LOOP_POINT_SET, + SAMPLE_LOAD, + MAX_INVALID +} melody_item_type_t; typedef struct melody_item { - /// @brief Frequency of the note in Hz. 0 for a pause. - int frequency; - /// @brief Length of the note in ms. - int length; + const melody_item_type_t command : 4; + const uint8_t channel : 4; + const int argument1; } melody_item_t; typedef struct melody_sequence { @@ -19,29 +25,26 @@ typedef struct melody_sequence { #define SEQUENCER_REPEAT_INDEFINITELY -1 #define SEQUENCER_NO_REPEAT 0 -class BeepSequencer { +class NewSequencer: public WaveGenerator { public: - BeepSequencer(Beeper*); - ~BeepSequencer(); - - void play_sequence(const melody_sequence_t, beeper_channel_t, int repeat); + NewSequencer(); + ~NewSequencer(); + void play_sequence(const melody_sequence_t *, int repeat); void stop_sequence(); - /// @brief Block the current task until the playback has finished. void wait_end_play(); - - void task(); + size_t fill_buffer(void* buffer, size_t length) override; + private: - uint32_t timbre; - Beeper * beeper; - melody_sequence_t current_sequence; - beeper_channel_t current_channel; + static const int TONE_CHANNELS = 4; + static const int EXTRA_CHANNELS = 2; + static const int CHANNELS = TONE_CHANNELS + EXTRA_CHANNELS; + ToneGenerator * voices[CHANNELS] = { nullptr }; + const melody_sequence_t * sequence; size_t pointer; size_t loop_point; - bool is_running; int repetitions; - TaskHandle_t hTask; - EventGroupHandle_t waitEndGroup; - - void start_task(); - void end_task(); -}; \ No newline at end of file + bool is_running; + EventGroupHandle_t wait_end_group; + int remaining_delay_samples; + void process_steps_until_delay(); +}; diff --git a/include/sound/waveout.h b/include/sound/waveout.h new file mode 100644 index 0000000..d22e11b --- /dev/null +++ b/include/sound/waveout.h @@ -0,0 +1,38 @@ +#pragma once +#include +#include +#include + +/// @brief A wave generator callback. Due to resource constraints you are expected to mix with the buffer, not overwrite it. +typedef std::function WaveGeneratorCallback; + +static const WaveGeneratorCallback NULL_GENERATOR = [](uint8_t*, size_t) { return 0; }; + +class WaveOut { +public: + static const int BAUD_RATE = 352800*2; // <- don't ask why this is 4 times larger, I don't know myself + static const int NYQUIST = BAUD_RATE / 2; // <- we are not using this to connect a DAC but directly a speaker to the data bus, so the max possible frequency is achieved when outputting 01010101... + static const size_t RENDER_CHUNK_SIZE = 512; + static const int CHANNEL_COUNT = 2; + + static void init_I2S(gpio_num_t pin); + static void set_output_callback(int channel, WaveGeneratorCallback callback); + +private: + static const size_t SAMPLE_RATE = 22050; + static const i2s_port_t I2S_NUM = I2S_NUM_0; + static const size_t DMA_BUF_LEN = RENDER_CHUNK_SIZE; + static const size_t DMA_NUM_BUF = 3; + static bool i2sInited; + static TaskHandle_t hTask; + static void task(void*); + static WaveGeneratorCallback callback[CHANNEL_COUNT]; +}; + +class WaveGenerator { +public: + virtual size_t fill_buffer(void* buffer, size_t length) { return 0; } + WaveGeneratorCallback get_callback() { + return [this](void* buf, size_t len) { return this->fill_buffer(buf, len); }; + } +}; diff --git a/include/views/common/view.h b/include/views/common/view.h index 917041d..a83145c 100644 --- a/include/views/common/view.h +++ b/include/views/common/view.h @@ -31,6 +31,11 @@ class ClipView: public Composable { delete content; } + void prepare() { content->prepare(); } + void render(FantaManipulator*fb) { content->render(fb); } + void step() { content->step(); } + void cleanup() { content->cleanup(); } + protected: Renderable * content; }; diff --git a/include/views/menu/melody_selection_item.h b/include/views/menu/melody_selection_item.h index 9579b8d..88bf5ef 100644 --- a/include/views/menu/melody_selection_item.h +++ b/include/views/menu/melody_selection_item.h @@ -4,7 +4,7 @@ class MenuMelodySelectorView: public MenuListSelectorView { public: - MenuMelodySelectorView(Beeper * preview, const char * title, int melodyNo, std::function onActivated, std::function onChange): + MenuMelodySelectorView(NewSequencer * preview, const char * title, int melodyNo, std::function onActivated, std::function onChange): MenuListSelectorView( title, all_chime_names, @@ -17,26 +17,21 @@ class MenuMelodySelectorView: public MenuListSelectorView { [this, onChange](int newMelodyNo) { sequencer->stop_sequence(); if(newMelodyNo != all_chime_count) // Don't play the random one - sequencer->play_sequence(melody_from_no(newMelodyNo), CHANNEL_NOTICE, SEQUENCER_NO_REPEAT); + sequencer->play_sequence(melody_from_no(newMelodyNo), SEQUENCER_NO_REPEAT); onChange(newMelodyNo); } ) { - if(preview) { - sequencer = new BeepSequencer(preview); - } + sequencer = preview; } - ~MenuMelodySelectorView() { - if(sequencer) delete sequencer; - } private: - BeepSequencer * sequencer; + NewSequencer * sequencer; }; class MenuMelodySelectorPreferenceView: public MenuMelodySelectorView { public: - MenuMelodySelectorPreferenceView(Beeper * preview, const char * title, prefs_key_t prefs_key, std::function onActivated): + MenuMelodySelectorPreferenceView(NewSequencer * preview, const char * title, prefs_key_t prefs_key, std::function onActivated): key(prefs_key), MenuMelodySelectorView(preview, title, prefs_get_int(prefs_key), onActivated, [this](int newVal) { prefs_set_int(key, newVal); }) {} diff --git a/include/views/overlays/touch_arrows_ovl.h b/include/views/overlays/touch_arrows_ovl.h index 31312de..be4a21e 100644 --- a/include/views/overlays/touch_arrows_ovl.h +++ b/include/views/overlays/touch_arrows_ovl.h @@ -47,7 +47,8 @@ class TouchArrowOverlay: public Renderable { .width = 7, .height = 8, .data = arrow_top_data, - .mask = arrow_top_mask_data + .mask = arrow_top_mask_data, + .format = SPRFMT_HORIZONTAL }; static const uint8_t arrow_bottom_data[] = { @@ -74,7 +75,8 @@ class TouchArrowOverlay: public Renderable { .width = 7, .height = 8, .data = arrow_bottom_data, - .mask = arrow_bottom_mask_data + .mask = arrow_bottom_mask_data, + .format = SPRFMT_HORIZONTAL }; static const uint8_t arrow_right_data[] = { @@ -99,7 +101,8 @@ class TouchArrowOverlay: public Renderable { .width = 8, .height = 7, .data = arrow_right_data, - .mask = arrow_right_mask_data + .mask = arrow_right_mask_data, + .format = SPRFMT_HORIZONTAL }; static const uint8_t arrow_left_data[] = { @@ -124,7 +127,8 @@ class TouchArrowOverlay: public Renderable { .width = 8, .height = 7, .data = arrow_left_data, - .mask = arrow_left_mask_data + .mask = arrow_left_mask_data, + .format = SPRFMT_HORIZONTAL }; if(!active) return; diff --git a/lib/Wiimote/Wiimote.cpp b/lib/Wiimote/Wiimote.cpp index 456d498..091634e 100644 --- a/lib/Wiimote/Wiimote.cpp +++ b/lib/Wiimote/Wiimote.cpp @@ -21,7 +21,6 @@ static Wiimote *_singleton = NULL; static uint8_t tmp_data[256]; -static bool wiimoteConnected = false; static uint8_t _g_identifier = 1; static uint16_t _g_local_cid = 0x0040; diff --git a/platformio.ini b/platformio.ini index b8af2c1..d9bfaa6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -24,6 +24,7 @@ lib_deps = bblanchon/ArduinoJson@^7.0.4 gyverlibs/GyverPortal@^3.6.6 h2zero/NimBLE-Arduino@^1.4.2 + bitbank2/PNGenc@^1.2.0 extra_scripts = pre:helper/env-extra.py @@ -46,7 +47,7 @@ upload_flags = --auth=plasma-otafvu [env:smolclock-nodemcu-32s] board = esp32dev -build_flags = -DDEVICE_MICROPISOS ${common.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue +build_flags = -DDEVICE_MICROPISOS ${common.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DCONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY upload_speed = 921600 monitor_speed = 115200 monitor_filters = esp32_exception_decoder \ No newline at end of file diff --git a/src/app/alarm_editor.cpp b/src/app/alarm_editor.cpp index e05f879..0f85a8b 100644 --- a/src/app/alarm_editor.cpp +++ b/src/app/alarm_editor.cpp @@ -149,7 +149,7 @@ class AlarmDaySelectorView: public Composite { class AppShimAlarmEditor::AlarmEditorView: public ListView { public: - AlarmEditorView(alarm_setting_t *alm, Beeper *b, std::function activation, std::function pushPop): ListView::ListView() { + AlarmEditorView(alarm_setting_t *alm, Beeper *b, NewSequencer *s, std::function activation, std::function pushPop): ListView::ListView() { setting = alm; ts_view = new MenuTimeSettingView(b, setting->hour, setting->minute, [this, pushPop](int h, int m, int s) { setting->hour = h; @@ -167,7 +167,7 @@ class AppShimAlarmEditor::AlarmEditorView: public ListView { add_view(new MenuBooleanSelectorView("Smart Alarm", alm->smart, [alm](bool newSmart) { alm->smart = newSmart; })); add_view(new MenuNumberSelectorView("Smart margin", 1, 30, 1, alm->smart_margin_minutes, activation, [alm](int newMargin) { alm->smart_margin_minutes = newMargin; })); #endif - add_view(new MenuMelodySelectorView(b, "Melody", alm->melody_no, activation, [alm](int newMelodyNo) { alm->melody_no = newMelodyNo; })); + add_view(new MenuMelodySelectorView(s, "Melody", alm->melody_no, activation, [alm](int newMelodyNo) { alm->melody_no = newMelodyNo; })); } ~AlarmEditorView() { @@ -187,8 +187,9 @@ class AppShimAlarmEditor::AlarmEditorView: public ListView { MenuTimeSettingView *ts_view; }; -AppShimAlarmEditor::AppShimAlarmEditor(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { +AppShimAlarmEditor::AppShimAlarmEditor(Beeper *b, NewSequencer *s): ProtoShimNavMenu::ProtoShimNavMenu() { beeper = b; + sequencer = s; current_editor = nullptr; current_editing_idx = 0; edit_flag = false; @@ -210,7 +211,7 @@ AppShimAlarmEditor::AppShimAlarmEditor(Beeper *b): ProtoShimNavMenu::ProtoShimNa current_editing_idx = editIdx; const alarm_setting_t * settings = get_alarm_list(); current_editing_setting = settings[editIdx]; - current_editor = new AlarmEditorView(¤t_editing_setting, beeper, normalActivationFunction, pushPop); + current_editor = new AlarmEditorView(¤t_editing_setting, beeper, sequencer, normalActivationFunction, pushPop); push_renderable(current_editor, TRANSITION_SLIDE_HORIZONTAL_LEFT); }; diff --git a/src/app/alarming.cpp b/src/app/alarming.cpp index e885095..a16a337 100644 --- a/src/app/alarming.cpp +++ b/src/app/alarming.cpp @@ -31,7 +31,7 @@ typedef enum alarming_state { } alarming_state_t; static SimpleClock *clockView = nullptr; -static BeepSequencer *seq = nullptr; +static NewSequencer *seq = nullptr; static TouchArrowOverlay *arrows = nullptr; static TickType_t snoozeUntil; static alarming_state_t state; @@ -40,12 +40,12 @@ static bool clock_inverting = false; static uint8_t snooze_hold_remain = 0; static int snooze_minutes = 0; static bool is_snoozing = false; -static melody_sequence_t melody; +static const melody_sequence_t * melody; static TickType_t startedAt; static TickType_t maxDur; -void app_alarming_prepare(Beeper* beeper) { +void app_alarming_prepare(NewSequencer* s) { // do this prior to changing state because apparently this may get called from a separate thread, so step() goes ahead of prepare() and thus exits the alarm right away? // TODO: somehow stick the state switching to the UI thread!! and all that startedAt = xTaskGetTickCount(); @@ -53,9 +53,8 @@ void app_alarming_prepare(Beeper* beeper) { if(seq) { seq->stop_sequence(); - free(seq); } - seq = new BeepSequencer(beeper); + seq = s; if(!arrows) arrows = new TouchArrowOverlay(); if(!clockView) clockView = new SimpleClock(); @@ -68,7 +67,7 @@ void app_alarming_prepare(Beeper* beeper) { const alarm_setting_t * alarm = get_triggered_alarm(); if(alarm) { melody = melody_from_no(alarm->melody_no); - seq->play_sequence(melody, CHANNEL_ALARM, SEQUENCER_REPEAT_INDEFINITELY); + seq->play_sequence(melody, SEQUENCER_REPEAT_INDEFINITELY); } power_mgmt_pause(); state = BLINKERING; @@ -285,7 +284,7 @@ void app_alarming_process() { } else if(xTaskGetTickCount() >= snoozeUntil) { is_snoozing = false; state = BLINKERING; - seq->play_sequence(melody, CHANNEL_ALARM, SEQUENCER_REPEAT_INDEFINITELY); + seq->play_sequence(melody, SEQUENCER_REPEAT_INDEFINITELY); } break; diff --git a/src/app/idle.cpp b/src/app/idle.cpp index 229ff2d..1523907 100644 --- a/src/app/idle.cpp +++ b/src/app/idle.cpp @@ -50,7 +50,7 @@ int current_screen_time_ms = 0; static bool did_prepare = false; static Beeper * beepola; -static BeepSequencer * sequencer; +static NewSequencer * sequencer; static SensorPool * sensors; static Renderable * mainView; @@ -110,9 +110,9 @@ void hourly_chime() { && now.hour <= prefs_get_int(PREFS_KEY_HOURLY_CHIME_STOP_HOUR) ) { int melody_no = (now.hour == first_hour) ? prefs_get_int(PREFS_KEY_FIRST_CHIME_MELODY) : prefs_get_int(PREFS_KEY_HOURLY_CHIME_MELODY); - melody_sequence_t melody = melody_from_no(melody_no); + const melody_sequence_t * melody = melody_from_no(melody_no); - sequencer->play_sequence(melody, CHANNEL_CHIME, SEQUENCER_NO_REPEAT); + sequencer->play_sequence(melody, SEQUENCER_NO_REPEAT); } } } @@ -166,12 +166,12 @@ void weather_overlay_update() { } } -void app_idle_prepare(SensorPool* s, Beeper* b) { +void app_idle_prepare(SensorPool* s, Beeper* b, NewSequencer* seq) { if(did_prepare) return; did_prepare = true; beepola = b; - sequencer = new BeepSequencer(beepola); + sequencer = seq; sensors = s; tk_time_of_day now = get_current_time_coarse(); @@ -222,7 +222,8 @@ void app_idle_prepare(SensorPool* s, Beeper* b) { // thunder hurts readability on other views, so keep it on clock only ScreenCompositor * thunderClock = new ScreenCompositor(clockView); - thunderClock->add_layer(thunder); + if(prefs_get_bool(PREFS_KEY_WEATHER_OVERLAY)) + thunderClock->add_layer(thunder); slideShow = new ViewMultiplexor(); slideShow->add_view(thunderClock, VIEW_CLOCK); @@ -247,7 +248,8 @@ void app_idle_prepare(SensorPool* s, Beeper* b) { ViewCompositor * rainyClock = new ViewCompositor(); rainyClock->add_layer(slideShow); rainyClock->add_layer(signalIndicator); - rainyClock->add_layer(rain); + if(prefs_get_bool(PREFS_KEY_WEATHER_OVERLAY)) + rainyClock->add_layer(rain); rainyClock->add_layer(touchArrows); mainView = rainyClock; @@ -323,7 +325,11 @@ void app_idle_process() { } else { change_screen_if_needed(); - touchArrows->active = hid_test_key_any(KEYMASK_ALL) != KEYSTATE_RELEASED; + key_state_t anykey = hid_test_key_any(KEYMASK_ALL); + touchArrows->active = anykey != KEYSTATE_RELEASED; + if(anykey != KEYSTATE_RELEASED) { + sequencer->stop_sequence(); + } } hourly_chime(); diff --git a/src/app/menu.cpp b/src/app/menu.cpp index e234d11..1755a07 100644 --- a/src/app/menu.cpp +++ b/src/app/menu.cpp @@ -14,7 +14,7 @@ class UptimeView: public MenuInfoItemView { void step() { tk_time_of_day_t uptime = get_uptime(); - snprintf(buf, 16, "%d:%d:%d", uptime.hour, uptime.minute, uptime.second, uptime.millisecond); + snprintf(buf, 16, "%02d:%02d:%02d", uptime.hour, uptime.minute, uptime.second, uptime.millisecond); bottom_label->set_string(buf); MenuInfoItemView::step(); } @@ -23,7 +23,7 @@ class UptimeView: public MenuInfoItemView { char buf[16]; }; -AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { +AppShimMenu::AppShimMenu(Beeper *b, NewSequencer *s): ProtoShimNavMenu::ProtoShimNavMenu() { beeper = b; std::function normalActivationFunction = [this](bool isActive, Renderable* instance) { if(isActive) push_renderable(instance, TRANSITION_NONE); @@ -40,8 +40,8 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { clock_menu->add_view(new MenuBooleanSettingView("Tick sound", PREFS_KEY_TICKING_SOUND)); clock_menu->add_view(new MenuBooleanSettingView("Ticking only when screen on", PREFS_KEY_NO_SOUND_WHEN_OFF)); clock_menu->add_view(new MenuBooleanSettingView("Hourly chime", PREFS_KEY_HOURLY_CHIME_ON)); - clock_menu->add_view(new MenuMelodySelectorPreferenceView(beeper, "First chime", PREFS_KEY_FIRST_CHIME_MELODY, normalActivationFunction)); - clock_menu->add_view(new MenuMelodySelectorPreferenceView(beeper, "Other chimes", PREFS_KEY_HOURLY_CHIME_MELODY, normalActivationFunction)); + clock_menu->add_view(new MenuMelodySelectorPreferenceView(s, "First chime", PREFS_KEY_FIRST_CHIME_MELODY, normalActivationFunction)); + clock_menu->add_view(new MenuMelodySelectorPreferenceView(s, "Other chimes", PREFS_KEY_HOURLY_CHIME_MELODY, normalActivationFunction)); clock_menu->add_view(new MenuNumberSelectorPreferenceView("Chime from", PREFS_KEY_HOURLY_CHIME_START_HOUR, 0, 23, 1, normalActivationFunction)); clock_menu->add_view(new MenuNumberSelectorPreferenceView("Chime until", PREFS_KEY_HOURLY_CHIME_STOP_HOUR, 0, 23, 1, normalActivationFunction)); clock_menu->add_view(new MenuActionItemView("Set time", [this]() { @@ -100,6 +100,8 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { normalActivationFunction )); display_menu->add_view(new MenuBooleanSettingView("FPS counter", PREFS_KEY_FPS_COUNTER)); + display_menu->add_view(new MenuBooleanSettingView("Weather effects", PREFS_KEY_WEATHER_OVERLAY)); + display_menu->add_view(new MenuBooleanSettingView("Remote Control Server", PREFS_KEY_REMOTE_SERVER)); display_menu->add_view(new MenuListSelectorPreferenceView( "WiFi signal", {"Off", "Disconnected", "Display power on", "Always"}, @@ -127,7 +129,7 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { 0x7f, 0xfe, 0x6e, 0x3e, 0x57, 0xfe, 0x50, 0x3e, 0x3f, 0xdc, 0x7c, 0x38, 0x7d, 0xf0, 0x3c, 0x00 }; - static const sprite_t status_icns = { .width = 16, .height = 16, .data = status_icns_data, .mask = nullptr }; + static const sprite_t status_icns = { .width = 16, .height = 16, .data = status_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; static const uint8_t clock_icns_data[] = { // By PiiXL @@ -135,7 +137,7 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { 0x4f, 0x09, 0x5f, 0xfd, 0x5f, 0xfd, 0x5f, 0xfd, 0x6f, 0xfb, 0x37, 0x76, 0x18, 0x0c, 0x0f, 0xf8 }; - static const sprite_t clock_icns = { .width = 16, .height = 16, .data = clock_icns_data, .mask = nullptr }; + static const sprite_t clock_icns = { .width = 16, .height = 16, .data = clock_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; static const uint8_t display_icns_data[] = { // By PiiXL @@ -143,7 +145,7 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { 0x40, 0x09, 0x40, 0x0f, 0x40, 0x09, 0x40, 0x0f, 0x60, 0x19, 0x7f, 0xff, 0x00, 0x00, 0x18, 0x0c }; - static const sprite_t display_icns = { .width = 16, .height = 16, .data = display_icns_data, .mask = nullptr }; + static const sprite_t display_icns = { .width = 16, .height = 16, .data = display_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; static const uint8_t wrench_icns_data[] = { // By PiiXL @@ -151,7 +153,7 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { 0x0f, 0xc7, 0x1f, 0xff, 0x3f, 0xff, 0x6f, 0xfe, 0x5f, 0xfc, 0x3b, 0x00, 0x76, 0x00, 0x6c, 0x00 }; - static const sprite_t wrench_icns = { .width = 16, .height = 16, .data = wrench_icns_data, .mask = nullptr }; + static const sprite_t wrench_icns = { .width = 16, .height = 16, .data = wrench_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; static const uint8_t stopwatch_icns_data[] = { // By PiiXL @@ -159,7 +161,7 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { 0xd7, 0x7a, 0xd7, 0x7a, 0xd7, 0x0a, 0xd7, 0xfa, 0xd7, 0xfa, 0xdb, 0xf6, 0x6c, 0x0c, 0x37, 0xf8 }; - static const sprite_t stopwatch_icns = { .width = 16, .height = 16, .data = stopwatch_icns_data, .mask = nullptr }; + static const sprite_t stopwatch_icns = { .width = 16, .height = 16, .data = stopwatch_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; #if HAS(BALANCE_BOARD_INTEGRATION) static const uint8_t weight_icns_data[] = { @@ -168,7 +170,7 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { 0xab, 0xd5, 0xab, 0xd5, 0x28, 0x14, 0x28, 0x14, 0x08, 0x10, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00 }; - static const sprite_t weight_icns = { .width = 16, .height = 16, .data = weight_icns_data, .mask = nullptr }; + static const sprite_t weight_icns = { .width = 16, .height = 16, .data = weight_icns_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; #endif static ListView * settings_menu = new ListView(); @@ -179,9 +181,6 @@ AppShimMenu::AppShimMenu(Beeper *b): ProtoShimNavMenu::ProtoShimNavMenu() { settings_menu->add_view(new MenuInfoItemView("Notice", "Full settings are only available in the Web UI")); settings_menu->add_view(new MenuActionItemView("Save & Restart", [this](){ prefs_force_save(); - BeepSequencer * s = new BeepSequencer(beeper); - s->play_sequence(tulula_fvu, CHANNEL_ALARM, SEQUENCER_NO_REPEAT); - s->wait_end_play(); ESP.restart(); }, &good_icns)); diff --git a/src/app/timer_editor.cpp b/src/app/timer_editor.cpp index 26ba01c..1135878 100644 --- a/src/app/timer_editor.cpp +++ b/src/app/timer_editor.cpp @@ -12,7 +12,7 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { that->tick(); } - TimerEditorMainScreen(Beeper *b, std::function _activation) { + TimerEditorMainScreen(Beeper *b, NewSequencer *s, std::function _activation) { hourView = new DroppingDigitView(2, 0, b); minuteView = new DroppingDigitView(2, 0, b); secondView = new DroppingDigitView(2, 0, b); @@ -31,19 +31,16 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { add_composable(secondView); beeper = b; + sequencer = s; activation = _activation; if(beeper != nullptr) { - sequencer = new BeepSequencer(beeper); - melodySelector = new MenuMelodySelectorPreferenceView(beeper, "Timer Melody", PREFS_KEY_TIMER_MELODY, [_activation](bool isActive, Renderable * that) { + melodySelector = new MenuMelodySelectorPreferenceView(sequencer, "Timer Melody", PREFS_KEY_TIMER_MELODY, [_activation](bool isActive, Renderable * that) { if(!isActive) { _activation(false, that); } }); } load_prefs(); - hourView->value = hour; - minuteView->value = minute; - secondView->value = second; cursorTimer = 0; isRunning = false; @@ -57,9 +54,6 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { } ~TimerEditorMainScreen() { - if(sequencer != nullptr) { - delete sequencer; - } if(melodySelector != nullptr) { delete melodySelector; } @@ -144,7 +138,7 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { if(hour == 0 && minute == 0 && second == 0) { isRunning = false; push_state(STATE_TIMER_EDITOR); // in case we are on a different screen - if(sequencer) sequencer->play_sequence(melody_from_no(prefs_get_int(PREFS_KEY_TIMER_MELODY)), CHANNEL_ALARM, SEQUENCER_REPEAT_INDEFINITELY); + if(sequencer) sequencer->play_sequence(melody_from_no(prefs_get_int(PREFS_KEY_TIMER_MELODY)), SEQUENCER_REPEAT_INDEFINITELY); load_prefs(); } else { add_sec(false); @@ -154,7 +148,7 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { private: std::function activation; Beeper *beeper; - BeepSequencer *sequencer; + NewSequencer *sequencer; MenuMelodySelectorPreferenceView * melodySelector; enum CursorPosition { HOUR, MINUTE, SECOND, PLAY_PAUSE @@ -175,6 +169,9 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { minute = (saved_time % 3600) / 60; second = saved_time % 60; cursorPosition = saved_time == 0 ? CursorPosition::SECOND : CursorPosition::PLAY_PAUSE; + hourView->value = hour; + minuteView->value = minute; + secondView->value = second; } void save_prefs() { @@ -239,8 +236,8 @@ class AppShimTimerEditor::TimerEditorMainScreen: public Composite { } }; -AppShimTimerEditor::AppShimTimerEditor(Beeper * b): ProtoShimNavigationStack( - new TimerEditorMainScreen(b, [this](bool isActive, Renderable * dst) { +AppShimTimerEditor::AppShimTimerEditor(Beeper * b, NewSequencer * s): ProtoShimNavigationStack( + new TimerEditorMainScreen(b, s, [this](bool isActive, Renderable * dst) { if(isActive) push_renderable(dst); else pop_renderable(); }) diff --git a/src/console.cpp b/src/console.cpp index a365a43..6704931 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -1,6 +1,7 @@ #include #include #include +#include static const char CURSOR_OFF = ' '; static char LOG_TAG[] = "CONS"; @@ -12,7 +13,6 @@ void ConsoleTaskFunction( void * pvParameter ) ESP_LOGV(LOG_TAG, "Running task"); Console * that = static_cast ( pvParameter ); - while(1) { that->task(); } @@ -35,7 +35,7 @@ Console::Console(const font_definition_t * f, DisplayFramebuffer * fb) { "CONS", 4096, this, - 2, + pisosTASK_PRIORITY_CONSOLE, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); @@ -170,13 +170,18 @@ void Console::set_font(const font_definition_t* f) { } void Console::set_active(bool act) { - active = act; if(act) { + if(hTask != NULL) vTaskResume(hTask); disp->wait_next_frame(); + } else { + flush(); + if(hTask != NULL) vTaskSuspend(hTask); } + active = act; } void Console::flush() { + if(!active) return; char * next_line = nullptr; while(xQueuePeek(hQueue, &next_line, 0)) { vTaskDelay(100); diff --git a/src/display/md_plasma.cpp b/src/display/md_plasma.cpp index 8cd7f4a..08e1604 100644 --- a/src/display/md_plasma.cpp +++ b/src/display/md_plasma.cpp @@ -25,8 +25,6 @@ MorioDenkiPlasmaDriver::MorioDenkiPlasmaDriver( bright_gpio = bright; show_gpio = show; hv_en_gpio = hv_enable; - - initialize(); } void MorioDenkiPlasmaDriver::initialize() { diff --git a/src/display/ws0010.cpp b/src/display/ws0010.cpp index 13b6404..aec1805 100644 --- a/src/display/ws0010.cpp +++ b/src/display/ws0010.cpp @@ -21,11 +21,10 @@ Ws0010OledDriver::Ws0010OledDriver( en_gpio = en; is_writing_ddram = false; ddram_ptr = 0; - - initialize(); } void Ws0010OledDriver::initialize() { + // TODO use parlio? ESP_LOGI(LOG_TAG, "Initializing Winstar WS0010 OLED bus with data bus: %i %i %i %i %i %i %i %i, rs=%i, en=%i", databus_gpios[0], databus_gpios[1], databus_gpios[2], databus_gpios[3], databus_gpios[4], databus_gpios[5], databus_gpios[6], databus_gpios[7], rs_gpio, en_gpio); gpio_config_t io_conf = { diff --git a/src/graphics/fanta_manipulator.cpp b/src/graphics/fanta_manipulator.cpp index d18a701..16f4a95 100644 --- a/src/graphics/fanta_manipulator.cpp +++ b/src/graphics/fanta_manipulator.cpp @@ -70,7 +70,7 @@ void FantaManipulator::plot_pixel(int x, int y, bool state) { } // NB: This still relies too much on the fact our displays are 16 bits tall. Someday when porting to another display this will bite us in the ass. -void FantaManipulator::put_fanta(fanta_buffer_t fanta, int x, int y, int w, int h, fanta_buffer_t mask, bool invert) { +void FantaManipulator::put_fanta(const fanta_buffer_t fanta, int x, int y, int w, int h, fanta_buffer_t mask, bool invert) { if(w <= 0 || h <= 0) return; uint16_t fanta_column_mask = 0x0; @@ -102,16 +102,67 @@ void FantaManipulator::put_fanta(fanta_buffer_t fanta, int x, int y, int w, int *dirty = true; } +void FantaManipulator::put_horizontal_data(const uint8_t* data, int x, int y, int w, int h, const uint8_t* mask, bool invert) { + if(w <= 0 || h <= 0) return; + + uint16_t fanta_column_mask = 0x0; + for(int i = std::max(y, 0); i < std::min(y + h, 16); i++) { + fanta_column_mask |= (1 << i); + } + + uint8_t * mask_data = (uint8_t*) &fanta_column_mask; + + int target_idx = x * 2; + for(int i = std::max(0, -target_idx); i < w*2; i++) { + if(target_idx + i > buffer_size - 1) break; + int i_spr = i / 2; + uint8_t current_halfcolumn_mask = mask_data[i % 2]; + + if(mask) { + uint16_t buf_mask_column = 0; + + for(int j = std::min(h, 16) - 1; j >= 0; j--) { + buf_mask_column <<= 1; + uint8_t cur_byte = mask[j*std::max((w/8), 1) + i_spr / 8]; + if(w < 8) cur_byte <<= (8 - w); + buf_mask_column |= (cur_byte >> (7 - (i_spr % 8))) & 0x1; + } + + if(y > 0) buf_mask_column <<= y; + else if(y < 0) buf_mask_column >>= abs(y); + + current_halfcolumn_mask &= ((uint8_t*)&buf_mask_column)[i % 2]; + } + + uint16_t buf_column = 0; + for(int j = std::min(h, 16) - 1; j >= 0; j--) { + buf_column <<= 1; + uint8_t cur_byte = data[j*std::max((w/8), 1) + i_spr / 8]; + if(w < 8) cur_byte <<= (8 - w); + buf_column |= (cur_byte >> (7 - (i_spr % 8))) & 0x1; + } + if(y > 0) buf_column <<= y; + else if(y < 0) buf_column >>= abs(y); + uint8_t buf_halfcolumn = ((uint8_t*)&buf_column)[i % 2]; + buffer[target_idx + i] = ((uint8_t) (invert ? ~buf_halfcolumn : buf_halfcolumn) & current_halfcolumn_mask) | (buffer[target_idx + i] & ~current_halfcolumn_mask); + } + + *dirty = true; +} + void FantaManipulator::put_sprite(const sprite_t * sprite, int x, int y, bool invert) { - fanta_buffer_t fanta = sprite_to_fanta(sprite); - fanta_buffer_t mask = nullptr; - if(sprite->mask) { - mask = mask_to_fanta(sprite); - } - put_fanta(fanta, x, y, sprite->width, sprite->height, mask, invert); - free(fanta); - if(mask) { - free(mask); + switch(sprite->format) { + case SPRFMT_NATIVE: + put_fanta((const fanta_buffer_t) sprite->data, x, y, sprite->width, sprite->height, (const fanta_buffer_t) sprite->mask, invert); + break; + + case SPRFMT_HORIZONTAL: + put_horizontal_data(sprite->data, x, y, sprite->width, sprite->height, sprite->mask, invert); + break; + + default: + ESP_LOGE(LOG_TAG, "Unsupported sprfmt=%i !!", sprite->format); + break; } } diff --git a/src/graphics/font.cpp b/src/graphics/font.cpp index 0ced663..b66d97a 100644 --- a/src/graphics/font.cpp +++ b/src/graphics/font.cpp @@ -15,7 +15,8 @@ sprite_t sprite_from_glyph(const font_definition_t* font, char16_t glyph) { .width = font->width, .height = font->height, .data = &font->data[start_idx], - .mask = nullptr + .mask = nullptr, + .format = SPRFMT_HORIZONTAL }; return rslt; diff --git a/src/graphics/framebuffer.cpp b/src/graphics/framebuffer.cpp index a5f463c..8f82054 100644 --- a/src/graphics/framebuffer.cpp +++ b/src/graphics/framebuffer.cpp @@ -2,8 +2,9 @@ #include #include #include +#include -static const int DESIRED_FPS = 65; +static const int DESIRED_FPS = 60; #define EVT_BIT_ENDED_DRAWING (1 << 0) @@ -80,7 +81,7 @@ void DisplayFramebuffer::setup_task() { "FBuf", 4096, this, - configMAX_PRIORITIES - 1, + pisosTASK_PRIORITY_FRAMEBUFFER, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/graphics/screenshooter.cpp b/src/graphics/screenshooter.cpp new file mode 100644 index 0000000..53af5fc --- /dev/null +++ b/src/graphics/screenshooter.cpp @@ -0,0 +1,245 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static char LOG_TAG[] = "SCAP"; + +// Why PNGEnc won't expose this more memory-saving API by default I don't know + +extern int PNG_openRAM(PNGIMAGE *pPNG, uint8_t *pData, int iDataSize); +extern int PNG_close(PNGIMAGE *pPNG); +extern int PNG_encodeBegin(PNGIMAGE *pPNG, int iWidth, int iHeight, uint8_t ucPixelType, uint8_t ucBpp, uint8_t *pPalette, uint8_t ucCompLevel); +extern void PNG_encodeEnd(PNGIMAGE *pPNG); +extern int PNG_addLine(PNGIMAGE *, uint8_t *pPixels, int y); +extern int PNG_setTransparentColor(PNGIMAGE *pPNG, uint32_t u32Color); +extern int PNG_setAlphaPalette(PNGIMAGE *pPNG, uint8_t *pPalette); + +#define SS_REQ_MAGIC 0x3939 +#define SS_RES_MAGIC 0x8888 + +typedef struct ss_server_req_pkt { + uint16_t magic; + key_id_t pressed; + key_id_t released; +} ss_server_req_pkt_t; + +typedef struct ss_server_res_pkt { + uint16_t magic; + uint16_t width; + uint16_t height; + uint8_t data[DisplayFramebuffer::BUFFER_SIZE]; +} ss_server_res_pkt_t; + +static uint16_t server_port = 0; +static int server_sock = 0; + +static void serverTaskFunc(void * pvFramebuffer) { + FantaManipulator *fb = static_cast ( pvFramebuffer ); + static const TickType_t BAIL_DELAY = pdMS_TO_TICKS(5000); + while(1) { + server_sock = socket(AF_INET, SOCK_DGRAM, 0); // Create UDP socket + if (server_sock < 0) { + ESP_LOGE(LOG_TAG, "Failed to create socket"); + vTaskDelay(BAIL_DELAY); + continue; + } + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_port = htons(server_port); + if (bind(server_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + ESP_LOGE(LOG_TAG, "Failed to bind socket"); + close(server_sock); + server_sock = 0; + vTaskDelay(BAIL_DELAY); + continue; + } + + struct sockaddr_in client_addr; + socklen_t client_addr_len = sizeof(client_addr); + ESP_LOGI(LOG_TAG, "Server up and running"); + while (1) { + ss_server_req_pkt_t req; + int bytes_read = recvfrom(server_sock, &req, sizeof(req), 0, (struct sockaddr *)&client_addr, &client_addr_len); + if (bytes_read < 0) { + ESP_LOGE(LOG_TAG, "Failed to receive request from client"); + continue; + } + + if (bytes_read != sizeof(req)) { + ESP_LOGE(LOG_TAG, "Incomplete request received, wanted %i bytes, got %i", sizeof(req), bytes_read); + continue; + } + + if (req.magic != SS_REQ_MAGIC) { + ESP_LOGE(LOG_TAG, "Invalid request magic, wanted 0x%x, got 0x%x", SS_REQ_MAGIC, req.magic); + continue; + } + + ESP_LOGI(LOG_TAG, "Got packet: magic 0x%x, pressed 0x%x, released 0x%x", req.magic, req.pressed, req.released); + + // Virtual keyboard handling + key_id_t mask = (key_id_t) 0; + for(int i = 0; i < sizeof(key_id_t) * 8; i++) { + mask = (key_id_t) (1 << i); + if(mask >= KEY_MAX_INVALID) break; + if((req.pressed & mask) != 0) { + ESP_LOGI(LOG_TAG, "PRESS 0x%x", mask); + hid_set_key_state((key_id_t) (req.pressed & mask), true); + } + if((req.released & mask) != 0) { + ESP_LOGI(LOG_TAG, "RELEASE 0x%x", mask); + hid_set_key_state((key_id_t) (req.released & mask), false); + } + } + + ss_server_res_pkt_t res; + res.magic = SS_RES_MAGIC; + res.width = fb->get_width(); + res.height = fb->get_height(); + // Capture and send the screen + if(!fb->lock()) { + ESP_LOGE(LOG_TAG, "Failed to lock framebuffer"); + continue; + } + memcpy(&res.data, fb->get_fanta(), DisplayFramebuffer::BUFFER_SIZE); + fb->unlock(); + + int bytes_sent = sendto(server_sock, &res, sizeof(res), 0, (struct sockaddr *)&client_addr, client_addr_len); + if (bytes_sent < 0) { + ESP_LOGE(LOG_TAG, "Failed to send response to client"); + continue; + } + } + + // Close the server socket + close(server_sock); + server_sock = 0; + } +} + +Screenshooter::Screenshooter(FantaManipulator * fb) { + framebuffer = fb; +} + +bool Screenshooter::capture_png(const uint8_t **outBufAddr, size_t* outBufLen) { + const size_t scratch_size = 4096; + uint8_t * scratch = nullptr; + uint8_t * line_scratch = nullptr; + uint16_t * src_buf; + static uint8_t ucPal[768] = {0,0,0,255,255,255}; + int rslt, y, x, w, h; + size_t dataLen; + PNGIMAGE * tmp; + + tmp = (PNGIMAGE*) ps_malloc(sizeof(PNGIMAGE)); + if(tmp == nullptr) { + ESP_LOGE(LOG_TAG, "Failed to allocate PNGIMAGE"); + goto free_shit_and_bail; + } + + scratch = (uint8_t*) ps_malloc(scratch_size); // not gralloc here as this won't be rendered! + if(scratch == nullptr) { + ESP_LOGE(LOG_TAG, "Failure when allocating PNG scratch buffer"); + goto free_shit_and_bail; + } + + line_scratch = (uint8_t*) ps_malloc(framebuffer->get_width()); + if(line_scratch == nullptr) { + ESP_LOGE(LOG_TAG, "Failure when allocating line scratch buffer"); + goto free_shit_and_bail; + } + + rslt = PNG_openRAM(tmp, scratch, scratch_size); + if(rslt != PNG_SUCCESS) { + ESP_LOGE(LOG_TAG, "Error %i initializing PNG encoder", rslt); + goto free_shit_and_bail; + } + + w = framebuffer->get_width(); + h = framebuffer->get_height(); + + rslt = PNG_encodeBegin(tmp, w, h, PNG_PIXEL_INDEXED, 8, ucPal, 3); + if(rslt != PNG_SUCCESS) { + ESP_LOGE(LOG_TAG, "Error %i initializing PNG encoder", rslt); + goto free_shit_and_bail; + } + + if(!framebuffer->lock()) { + ESP_LOGE(LOG_TAG, "Could not lock source buffer"); + goto free_shit_and_bail; + } + + src_buf = (uint16_t*) framebuffer->get_fanta(); + + for(y = 0; y < h && rslt == PNG_SUCCESS; y++) { + for(x = 0; x < w; x++) { + line_scratch[x] = ((src_buf[x] & (1 << y)) != 0) ? 1 : 0; + } + rslt = PNG_addLine(tmp, line_scratch, y); + } + + framebuffer->unlock(); + + if(rslt != PNG_SUCCESS) { + ESP_LOGE(LOG_TAG, "Encoder failed"); + goto free_shit_and_bail; + } + + dataLen = PNG_close(tmp); + ESP_LOGI(LOG_TAG, "Encoded %i bytes", dataLen); + + if(dataLen < scratch_size) { + scratch = (uint8_t*) realloc(scratch, dataLen); + } + + *outBufAddr = scratch; + *outBufLen = dataLen; + free(line_scratch); + free(tmp); + + return true; + +free_shit_and_bail: + if(scratch != nullptr) free(scratch); + if(line_scratch != nullptr) free(line_scratch); + if(tmp != nullptr) free(tmp); + *outBufLen = 0; + return false; +} + +void Screenshooter::start_server(uint16_t port) { + if(hServerTask != NULL) { + ESP_LOGE(LOG_TAG, "Server already running!"); + return; + } + + server_port = port; + if(port == 0) return; + + xTaskCreate( + serverTaskFunc, + "VNC", + 2048, + framebuffer, + pisosTASK_PRIORITY_REMOTE_DESKTOP, + &hServerTask + ); +} + +void Screenshooter::stop_server() { + if(hServerTask != NULL) vTaskDelete(hServerTask); + if(server_sock != 0) { + close(server_sock); + server_sock = 0; + } +} diff --git a/src/graphics/sprite.cpp b/src/graphics/sprite.cpp index 4b9e9e2..04a2291 100644 --- a/src/graphics/sprite.cpp +++ b/src/graphics/sprite.cpp @@ -2,6 +2,7 @@ #include #include #include +#include static char LOG_TAG[] = "FB_SPR"; @@ -13,41 +14,6 @@ void* gralloc(const size_t size) { #endif } -fanta_buffer_t _convert_to_fanta(uint8_t width, uint8_t height, const uint8_t* data) { - size_t required_size = width; - - uint16_t * columns = (uint16_t*) gralloc(required_size * sizeof(uint16_t)); - if(columns == nullptr) { - ESP_LOGE(LOG_TAG, "Allocation failed"); - return nullptr; - } - - memset(columns, 0, required_size * sizeof(uint16_t)); - - for(int i = 0; i < width; i++) { - for(int j = std::min(height, (uint8_t) 16) - 1; j >= 0; j--) { - columns[i] <<= 1; - uint8_t cur_byte = data[j*(std::max((width/8), 1)) + i / 8]; - if(width < 8) { - // move the bits towards MSB - cur_byte <<= (8 - width); - } - columns[i] |= (cur_byte >> (7 - (i % 8)) & 1); - } - } - - return (uint8_t*) columns; -} - -fanta_buffer_t mask_to_fanta(const sprite_t* sprite) { - if(sprite->mask == nullptr) return nullptr; - return _convert_to_fanta(sprite->width, sprite->height, sprite->mask); -} - -fanta_buffer_t sprite_to_fanta(const sprite_t* sprite) { - return _convert_to_fanta(sprite->width, sprite->height, sprite->data); -} - ani_sprite_state_t ani_sprite_prepare(const ani_sprite* as) { return ani_sprite_state_t { .ani_sprite = as, @@ -82,6 +48,7 @@ sprite_t ani_sprite_frame(ani_sprite_state_t* as) { .width = as->ani_sprite->width, .height = as->ani_sprite->height, .data = cur_frame, - .mask = nullptr + .mask = nullptr, + .format = as->ani_sprite->format }; } \ No newline at end of file diff --git a/src/input/keypad.cpp b/src/input/keypad.cpp index 1fb535b..cfe6d46 100644 --- a/src/input/keypad.cpp +++ b/src/input/keypad.cpp @@ -1,17 +1,23 @@ #include #include #include +#include +#include static char LOG_TAG[] = "KEYP"; static TaskHandle_t hTask; +static std::map oldStates = {}; static void keypad_task(void*) { #if HAS(KEYPAD) while(1) { for(auto i: HWCONF_KEYPAD) { - int lvl = gpio_get_level(i.first); - hid_set_key_state(i.second, lvl > 0); + bool lvl = gpio_get_level(i.first) > 0; + if(oldStates[i.first] != lvl) { + oldStates[i.first] = lvl; + hid_set_key_state(i.second, lvl); + } } vTaskDelay(pdMS_TO_TICKS(10)); @@ -29,6 +35,7 @@ void keypad_start() { for(auto i: HWCONF_KEYPAD) { io_conf.pin_bit_mask |= 1ULL << i.first; + oldStates[i.first] = false; } ESP_ERROR_CHECK(gpio_config(&io_conf)); @@ -39,7 +46,7 @@ void keypad_start() { "KEYPAD", 4096, nullptr, - configMAX_PRIORITIES - 3, + pisosTASK_PRIORITY_KEYPAD, &hTask ); #endif diff --git a/src/input/touch_plane.cpp b/src/input/touch_plane.cpp index a65faa5..07606c1 100644 --- a/src/input/touch_plane.cpp +++ b/src/input/touch_plane.cpp @@ -7,6 +7,7 @@ #include #include #include +#include // I don't know how this works // But seems like it works with my janky tinfoil touch screen thingamajiggie @@ -121,7 +122,7 @@ esp_err_t touchplane_start() { "TOUCH", 1024, nullptr, - configMAX_PRIORITIES - 3, + pisosTASK_PRIORITY_KEYPAD, &hTask ); } diff --git a/src/main.cpp b/src/main.cpp index d0ab821..7ab151f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,13 +1,16 @@ #include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -45,13 +48,14 @@ static ViewCompositor * desktop; static ViewMultiplexor * appHost; static FpsCounter * fpsCounter; -IRAM_ATTR static DisplayFramebuffer * fb; +static DisplayFramebuffer * fb; +static Screenshooter * screenshooter; static FantaManipulator * graph; static Console * con; static SensorPool * sensors; static OTAFVUManager * ota; static Beeper * beepola; -static BeepSequencer * bs; +static NewSequencer * seq; void change_state(device_state_t to, transition_type_t transition) { if(to == STATE_OTAFVU) { @@ -85,6 +89,13 @@ void pop_state(device_state_t expected, transition_type_t transition) { } } +void bringup_sound() { + beepola = new Beeper(); + seq = new NewSequencer(); + WaveOut::set_output_callback(pisosWAVE_CHANNEL_BEEPER, beepola->get_callback()); + WaveOut::set_output_callback(pisosWAVE_CHANNEL_SEQUENCER, seq->get_callback()); +} + void bringup_light_sensor() { #if HAS(LIGHT_SENSOR) sensors->add(SENSOR_ID_AMBIENT_LIGHT, new AmbientLightSensor(HWCONF_LIGHTSENSE_GPIO), pdMS_TO_TICKS(250)); @@ -167,13 +178,17 @@ void bringup_hid() { } void setup() { + vTaskPrioritySet(NULL, configMAX_PRIORITIES - 2); // Set up serial for logs Serial.begin(115200); - #ifdef BOARD_HAS_PSRAM heap_caps_malloc_extmem_enable(16); #endif + // The I2S driver messes up display pinmux, so it must initialize first + WaveOut::init_I2S(HWCONF_BEEPER_GPIO); + + display_driver.initialize(); display_driver.reset(); display_driver.set_power(true); @@ -184,15 +199,16 @@ void setup() { #endif fb = new DisplayFramebuffer(&display_driver); + screenshooter = new Screenshooter(fb->manipulate()); + con = new Console(&keyrus0808_font, fb); con->set_cursor(true); con->print(""); con->print(PRODUCT_NAME " v" PRODUCT_VERSION); - delay(500); - beepola = new Beeper(HWCONF_BEEPER_GPIO, HWCONF_BEEPER_PWM_CHANNEL); - bs = new BeepSequencer(beepola); - bs->play_sequence(pc98_pipo, CHANNEL_SYSTEM, SEQUENCER_NO_REPEAT); + bringup_sound(); + + seq->play_sequence(&pc98_pipo, SEQUENCER_NO_REPEAT); #if HAS(TOUCH_PLANE) // No beeper on non-touch because it will be annoying with physical buttons @@ -209,13 +225,18 @@ void setup() { } con->clear(); + if(prefs_get_bool(PREFS_KEY_REMOTE_SERVER)) { + screenshooter->start_server(3939); + con->print("RC server up!"); + delay(1000); + } con->print(NetworkManager::network_name()); con->print("%i dBm", NetworkManager::rssi()); delay(2000); con->print(NetworkManager::current_ip().c_str()); delay(2000); - ota = new OTAFVUManager(con, bs); + ota = new OTAFVUManager(con, seq); sensors = new SensorPool(); @@ -234,9 +255,7 @@ void setup() { wotd_start(); foo_client_begin(); power_mgmt_start(sensors, &display_driver, beepola); - admin_panel_prepare(sensors, beepola); - - vTaskPrioritySet(NULL, configMAX_PRIORITIES - 1); + admin_panel_prepare(sensors, beepola, screenshooter); con->set_active(false); fb->clear(); @@ -246,11 +265,11 @@ void setup() { desktop->add_layer(appHost); desktop->add_layer(new FpsCounter(fb)); - appHost->add_view(new AppShimIdle(sensors, beepola), STATE_IDLE); - appHost->add_view(new AppShimAlarming(beepola), STATE_ALARMING); - appHost->add_view(new AppShimMenu(beepola), STATE_MENU); - appHost->add_view(new AppShimAlarmEditor(beepola), STATE_ALARM_EDITOR); - appHost->add_view(new AppShimTimerEditor(beepola), STATE_TIMER_EDITOR); + appHost->add_view(new AppShimIdle(sensors, beepola, seq), STATE_IDLE); + appHost->add_view(new AppShimAlarming(seq), STATE_ALARMING); + appHost->add_view(new AppShimMenu(beepola, seq), STATE_MENU); + appHost->add_view(new AppShimAlarmEditor(beepola, seq), STATE_ALARM_EDITOR); + appHost->add_view(new AppShimTimerEditor(beepola, seq), STATE_TIMER_EDITOR); appHost->add_view(new AppShimStopwatch(beepola), STATE_STOPWATCH); #if HAS(BALANCE_BOARD_INTEGRATION) appHost->add_view(new AppShimWeighing(sensors), STATE_WEIGHING); diff --git a/src/network/admin_panel.cpp b/src/network/admin_panel.cpp index 001b4cb..d108852 100644 --- a/src/network/admin_panel.cpp +++ b/src/network/admin_panel.cpp @@ -7,15 +7,19 @@ #include #include #include +#include +#include #include #include #include +#include static char LOG_TAG[] = "ADMIN"; static TaskHandle_t hTask = NULL; static GyverPortal ui; static SensorPool *sensors; static Beeper *beeper; +static Screenshooter *screenshooter; extern "C" void AdminTaskFunction( void * pvParameter ); @@ -89,12 +93,6 @@ static void save_melody(prefs_key_t key) { ESP_LOGV(LOG_TAG, "Preview chime #%i for %s", temp_chime, key); prefs_set_int(key, temp_chime); - - melody_sequence_t melody = melody_from_no(temp_chime); - BeepSequencer * s = new BeepSequencer(beeper); - s->play_sequence(melody, CHANNEL_NOTICE, SEQUENCER_NO_REPEAT); - s->wait_end_play(); - delete s; } } @@ -159,8 +157,8 @@ static void render_alarms() { GP.FORM_END(); } -static void save_alarms() { - if(!ui.form("/alarms")) return; +static bool save_alarms() { + if(!ui.form("/alarms")) return false; ESP_LOGI(LOG_TAG, "Save alarms"); for(int i = 0; i < ALARM_LIST_SIZE; i++) { alarm_setting_t a = {0}; @@ -184,10 +182,35 @@ static void save_alarms() { set_alarm(i, a); } beeper->beep_blocking(CHANNEL_NOTICE, 1000, 50); + return true; +} +static inline bool _rmc_key(const char * key, key_id_t id) { + if(ui.clickDown(key)) { + hid_set_key_state(id, true); + return true; + } + else if(ui.clickUp(key)) { + hid_set_key_state(id, false); + return true; + } + return false; } -void build() { +static bool process_remote() { + if(ui.hold()) { + bool rslt = false; + rslt |= _rmc_key("rmc_up", KEY_UP); + rslt |= _rmc_key("rmc_down", KEY_DOWN); + rslt |= _rmc_key("rmc_left", KEY_LEFT); + rslt |= _rmc_key("rmc_right", KEY_RIGHT); + rslt |= _rmc_key("rmc_headpat", KEY_HEADPAT); + return rslt; + } + return false; +} + +static void build() { GP.BUILD_BEGIN(); GP.PAGE_TITLE(PRODUCT_NAME " Admin Panel " PRODUCT_VERSION); GP.THEME(GP_DARK); @@ -195,6 +218,32 @@ void build() { GP.TITLE(PRODUCT_NAME " Admin Panel " PRODUCT_VERSION); + GP.SPOILER_BEGIN("Remote", GP_BLUE); + GP.BUTTON("rmc_headpat", "Headpat"); + GP.HR(); + GP.TABLE_BEGIN(); + GP.TR(); + GP.TD(); + GP.TD(); + GP.BUTTON("rmc_up", "↑"); + GP.TD(); + GP.TR(); + GP.TD(); + GP.BUTTON("rmc_left", "←"); + GP.TD(); + GP.TD(); + GP.BUTTON("rmc_right", "→"); + GP.TR(); + GP.TD(); + GP.TD(); + GP.BUTTON("rmc_down", "↓"); + GP.TD(); + GP.TABLE_END(); + GP.HR(); + GP.BUTTON_DOWNLOAD("screen.png", "Screenshot", GP_BLUE); + GP.SPOILER_END(); + GP.BREAK(); + GP.SPOILER_BEGIN("WiFi", GP_BLUE); render_string("SSID", PREFS_KEY_WIFI_SSID); render_string("Password", PREFS_KEY_WIFI_PASS, true); @@ -280,7 +329,7 @@ void build() { GP.BREAK(); GP.SPOILER_BEGIN("Sensors", GP_BLUE); - GP.JQ_UPDATE_BEGIN(1000); + GP.JQ_UPDATE_BEGIN(10000); sensor_info_t* sens; GP.LABEL("WiFi: "); @@ -290,6 +339,12 @@ void build() { GP.LABEL(buf, "rssi_val"); GP.BREAK(); + GP.LABEL("Uptime: "); + tk_time_of_day_t uptime = get_uptime(); + snprintf(buf, 16, "%02d:%02d:%02d", uptime.hour, uptime.minute, uptime.second, uptime.millisecond); + GP.LABEL(buf, "uptime_val"); + GP.BREAK(); + #if HAS(LIGHT_SENSOR) GP.LABEL("Light sensor: "); sens = sensors->get_info(SENSOR_ID_AMBIENT_LIGHT); @@ -374,6 +429,7 @@ void build() { render_string("Longitude", PREFS_KEY_WEATHER_LON); render_string("API Key", PREFS_KEY_WEATHER_APIKEY, true); render_int("Update interval [m]:", PREFS_KEY_WEATHER_INTERVAL_MINUTES); + render_bool("Weather effects on display:", PREFS_KEY_WEATHER_OVERLAY); current_weather_t weather; if(weather_get_current(&weather)) { @@ -427,6 +483,7 @@ void build() { GP.BREAK(); GP.SPOILER_BEGIN("Administration", GP_BLUE); + render_bool("Remote control server", PREFS_KEY_REMOTE_SERVER); GP.BUTTON_DOWNLOAD("prefs_backup.bin", "Settings backup", GP_BLUE); GP.BUTTON_DOWNLOAD("crashdump.elf", "Last crash dump", GP_BLUE); GP.FILE_UPLOAD_RAW("prefs_restore", "Settings restore", GP_BLUE, "", "", "/prefs_restore"); @@ -438,33 +495,13 @@ void build() { } static char binary_mime[] = "application/octet-stream"; +static char png_mime[] = "image/png"; void downloadPartition(const void * partition, size_t size) { ui.server.send_P(200, binary_mime, (const char*) partition, size); } void action() { - if(ui.download()) { - const void * ptrPart; - partition_handle_t hPart; - size_t szPart; - - if(ui.uri().endsWith("prefs_backup.bin")) { - if(mount_settings(&ptrPart, &hPart, &szPart)) { - downloadPartition(ptrPart, szPart); - unmount_partition(hPart); - } - } - else if(ui.uri().endsWith("crashdump.elf")) { - // MEMO: read with - // python %IDF_PATH%\components\espcoredump\espcoredump.py info_corefile --core R:\crashdump.elf .pio\build\bigclock-nodemcu-32s\firmware.elf - if(mount_crash(&ptrPart, &hPart, &szPart)) { - downloadPartition(ptrPart, szPart); - unmount_partition(hPart); - } - } - return; - } - - save_alarms(); + if(process_remote()) return; + if(save_alarms()) return; if(ui.click()) { save_int(PREFS_KEY_ALARM_SNOOZE_MINUTES, 0, 30); save_int(PREFS_KEY_ALARM_MAX_DURATION_MINUTES, 0, 120); @@ -499,6 +536,7 @@ void action() { save_string(PREFS_KEY_WEATHER_APIKEY); save_string(PREFS_KEY_WEATHER_LAT); save_string(PREFS_KEY_WEATHER_LON); + save_bool(PREFS_KEY_WEATHER_OVERLAY); save_int(PREFS_KEY_WEATHER_INTERVAL_MINUTES, 30, 24 * 60); save_string(PREFS_KEY_WORDNIK_APIKEY); save_int(PREFS_KEY_WORDNIK_INTERVAL_MINUTES, 60, 3600); @@ -525,19 +563,49 @@ void action() { if(ui.click(reboot_btn)) { prefs_force_save(); - BeepSequencer * s = new BeepSequencer(beeper); - s->play_sequence(tulula_fvu, CHANNEL_NOTICE, SEQUENCER_NO_REPEAT); - s->wait_end_play(); ESP.restart(); } + return; + } + + if(ui.download()) { + const void * ptrPart; + partition_handle_t hPart; + size_t szPart; + + if(ui.uri().endsWith("prefs_backup.bin")) { + if(mount_settings(&ptrPart, &hPart, &szPart)) { + downloadPartition(ptrPart, szPart); + unmount_partition(hPart); + } + } + else if(ui.uri().endsWith("crashdump.elf")) { + // MEMO: read with + // python %IDF_PATH%\components\espcoredump\espcoredump.py info_corefile --core R:\crashdump.elf .pio\build\bigclock-nodemcu-32s\firmware.elf + if(mount_crash(&ptrPart, &hPart, &szPart)) { + downloadPartition(ptrPart, szPart); + unmount_partition(hPart); + } + } + else if(ui.uri().endsWith("screen.png")) { + const uint8_t * outBuf = nullptr; + size_t outLen = 0; + if(screenshooter->capture_png(&outBuf, &outLen)) { + ui.server.send_P(200, png_mime, (const char*) outBuf, outLen); + free((void*)outBuf); + } else { + ui.server.send(500, "", ""); + } + } } } bool prefs_uploading = false; -void admin_panel_prepare(SensorPool* s, Beeper* b) { +void admin_panel_prepare(SensorPool* s, Beeper* b, Screenshooter * ss) { sensors = s; beeper = b; + screenshooter = ss; ui.attachBuild(build); ui.attach(action); ui.downloadAuto(false); @@ -592,7 +660,7 @@ void admin_panel_prepare(SensorPool* s, Beeper* b) { "ADM", 4096, nullptr, - 2, + pisosTASK_PRIORITY_WEBADMIN, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/network/otafvu.cpp b/src/network/otafvu.cpp index af3d9ae..b19268d 100644 --- a/src/network/otafvu.cpp +++ b/src/network/otafvu.cpp @@ -1,5 +1,6 @@ #include #include +#include #if HAS(OTAFVU) #include @@ -23,7 +24,7 @@ void OtaFvuTaskFunction( void * pvParameter ) } } -OTAFVUManager::OTAFVUManager(Console* c, BeepSequencer*s) { +OTAFVUManager::OTAFVUManager(Console* c, NewSequencer*s) { ESP_LOGI(LOG_TAG, "Initializing"); con = c; seq = s; @@ -52,7 +53,7 @@ OTAFVUManager::OTAFVUManager(Console* c, BeepSequencer*s) { "OTAFVU", 4096, this, - 10, + pisosTASK_PRIORITY_OTAFVU, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); @@ -79,7 +80,7 @@ void OTAFVUManager::get_ready() { // Keep display on when updating power_mgmt_pause(); - seq->play_sequence(tulula_fvu, CHANNEL_SYSTEM, SEQUENCER_NO_REPEAT); + seq->play_sequence(tulula_fvu, SEQUENCER_NO_REPEAT); } void OTAFVUManager::shut_up_and_explode() { @@ -87,7 +88,7 @@ void OTAFVUManager::shut_up_and_explode() { con->set_font(&keyrus0816_font); con->clear(); con->print("OTAFVU Done!"); - seq->play_sequence(oelutz_fvu, CHANNEL_SYSTEM, SEQUENCER_NO_REPEAT); + seq->play_sequence(oelutz_fvu, SEQUENCER_NO_REPEAT); seq->wait_end_play(); ESP.restart(); } diff --git a/src/sensor/sensor_pool.cpp b/src/sensor/sensor_pool.cpp index 71ba1d1..8c6bf4f 100644 --- a/src/sensor/sensor_pool.cpp +++ b/src/sensor/sensor_pool.cpp @@ -1,6 +1,7 @@ #include #include #include +#include static char LOG_TAG[] = "SENS"; @@ -25,7 +26,7 @@ SensorPool::SensorPool() { "SENS", 4096, this, - 3, + pisosTASK_PRIORITY_SENSOR, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/service/alarm.cpp b/src/service/alarm.cpp index dbf9198..038fe24 100644 --- a/src/service/alarm.cpp +++ b/src/service/alarm.cpp @@ -2,6 +2,7 @@ #include #include #include +#include static char LOG_TAG[] = "ALM"; @@ -158,7 +159,7 @@ void alarm_init(SensorPool* s) { "ALARM", 4096, nullptr, - 4, + pisosTASK_PRIORITY_ALARM, &hTask ); } \ No newline at end of file diff --git a/src/service/balance_board.cpp b/src/service/balance_board.cpp index 71f780d..7acf2e6 100644 --- a/src/service/balance_board.cpp +++ b/src/service/balance_board.cpp @@ -1,5 +1,7 @@ #include #include +#include + #if HAS(BALANCE_BOARD_INTEGRATION) #include @@ -132,7 +134,7 @@ void balance_board_start(SensorPool *sensors) LOG_TAG, 8192, nullptr, - 2, + pisosTASK_PRIORITY_BALANCEBOARD, &hTask)) { ESP_LOGE(LOG_TAG, "Task creation failed"); diff --git a/src/service/foo_client.cpp b/src/service/foo_client.cpp index bd85e70..ab5aa09 100644 --- a/src/service/foo_client.cpp +++ b/src/service/foo_client.cpp @@ -6,6 +6,7 @@ #include #include #include +#include static char LOG_TAG[] = "FOOCLI"; @@ -225,7 +226,7 @@ void foo_client_begin() { "FOOCLI", 4096, nullptr, - 2, + pisosTASK_PRIORITY_FOOBAR_CLIENT, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/service/owm/weather.cpp b/src/service/owm/weather.cpp index b3aa821..8067d20 100644 --- a/src/service/owm/weather.cpp +++ b/src/service/owm/weather.cpp @@ -4,6 +4,7 @@ #include #include #include +#include static char LOG_TAG[] = "WEATHER"; @@ -88,7 +89,6 @@ void WeatherTaskFunction( void * pvParameter ) } } else { ESP_LOGE(LOG_TAG, "Unexpected response code %i when refreshing", response); - ESP_LOGE(LOG_TAG, "%s", http.getString()); isFailure = true; } vTaskDelay(isFailure ? pdMS_TO_TICKS(5000) : interval); @@ -120,7 +120,7 @@ void weather_start() { "OWM", 4096, nullptr, - 1, + pisosTASK_PRIORITY_WEATHER, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/service/owm/weather_icons.cpp b/src/service/owm/weather_icons.cpp index 28d6bfc..8f661b3 100644 --- a/src/service/owm/weather_icons.cpp +++ b/src/service/owm/weather_icons.cpp @@ -42,7 +42,8 @@ const ani_sprite_t thunderstorm_icon = { .frames = 9, .screen_frames_per_frame = 7, .holdoff_frames = 0, - .data = thunderstorm_data + .data = thunderstorm_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t drizzle_data[] = { @@ -71,7 +72,8 @@ const ani_sprite_t drizzle_icon = { .frames = 9, .screen_frames_per_frame = 7, .holdoff_frames = 0, - .data = drizzle_data + .data = drizzle_data, + .format = SPRFMT_HORIZONTAL }; @@ -102,7 +104,8 @@ const ani_sprite_t rain_icon = { .frames = 10, .screen_frames_per_frame = 7, .holdoff_frames = 0, - .data = rain_data + .data = rain_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t sun_data[] = { @@ -132,7 +135,8 @@ const ani_sprite_t sun_icon = { .frames = 10, .screen_frames_per_frame = 7, .holdoff_frames = 0, - .data = sun_data + .data = sun_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t clouds_data[] = { @@ -184,7 +188,8 @@ const ani_sprite_t clouds_icon = { .frames = 21, .screen_frames_per_frame = 7, .holdoff_frames = 2, - .data = clouds_data + .data = clouds_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t broken_clouds_data[] = { @@ -220,7 +225,8 @@ const ani_sprite_t broken_clouds_icon = { .frames = 13, .screen_frames_per_frame = 7, .holdoff_frames = 0, - .data = broken_clouds_data + .data = broken_clouds_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t overcast_data[] = { @@ -238,7 +244,8 @@ const ani_sprite_t overcast_icon = { .frames = 4, .screen_frames_per_frame = 14, .holdoff_frames = 4, - .data = overcast_data + .data = overcast_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t snow_data[] = { @@ -251,7 +258,8 @@ const ani_sprite_t snow_icon = { .frames = 1, .screen_frames_per_frame = 60, .holdoff_frames = 0, - .data = snow_data + .data = snow_data, + .format = SPRFMT_HORIZONTAL }; const uint8_t mist_data[] = { @@ -264,5 +272,6 @@ const ani_sprite_t mist_icon = { .frames = 1, .screen_frames_per_frame = 60, .holdoff_frames = 0, - .data = mist_data + .data = mist_data, + .format = SPRFMT_HORIZONTAL }; \ No newline at end of file diff --git a/src/service/power_management.cpp b/src/service/power_management.cpp index 2cb69fe..16ed456 100644 --- a/src/service/power_management.cpp +++ b/src/service/power_management.cpp @@ -2,6 +2,7 @@ #include #include #include +#include static char LOG_TAG[] = "PM"; static TaskHandle_t hTask = NULL; @@ -164,7 +165,7 @@ void power_mgmt_start(SensorPool * s, DisplayDriver * d, Beeper * b) { "PM", 4096, nullptr, - 4, + pisosTASK_PRIORITY_POWER_MANAGEMENT, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/service/wordnik.cpp b/src/service/wordnik.cpp index 9d0989c..a87cb0f 100644 --- a/src/service/wordnik.cpp +++ b/src/service/wordnik.cpp @@ -1,5 +1,6 @@ #include #include +#include #if HAS(WORDNIK_API) #include @@ -58,7 +59,7 @@ void WordnikTaskFunction( void * pvParameter ) ESP_LOGV(LOG_TAG, "Query: %s", url); int response = http.GET(); if(response == 200) { - EXT_RAM_ATTR JsonDocument response; + EXT_RAM_ATTR static JsonDocument response; DeserializationError error = deserializeJson(response, http.getStream()); @@ -87,9 +88,9 @@ void WordnikTaskFunction( void * pvParameter ) } } else { ESP_LOGE(LOG_TAG, "Unexpected response code %i when refreshing", response); - ESP_LOGE(LOG_TAG, "%s", http.getString()); isFailure = true; } + client.stop(); vTaskDelay(isFailure ? pdMS_TO_TICKS(10000) : interval); } } @@ -113,7 +114,7 @@ void wotd_start() { "WOTD", 8000, nullptr, - 1, + pisosTASK_PRIORITY_WORDNIK, &hTask ) != pdPASS) { ESP_LOGE(LOG_TAG, "Task creation failed!"); diff --git a/src/sound/beeper.cpp b/src/sound/beeper.cpp index f4c0989..302e300 100644 --- a/src/sound/beeper.cpp +++ b/src/sound/beeper.cpp @@ -1,43 +1,20 @@ #include -#include -#include +#include +#include +#include -static void ledcWriteToneD(uint8_t chan, uint32_t freq, uint32_t duty) -{ - if(!freq){ - ledcWrite(chan, 0); - return; - } - - uint8_t group=(chan/8), timer=((chan/2)%4); - - ledc_timer_config_t ledc_timer = { - .speed_mode = (ledc_mode_t) group, - .duty_resolution = (ledc_timer_bit_t) 10, - .timer_num = (ledc_timer_t) timer, - .freq_hz = freq, - .clk_cfg = (ledc_clk_cfg_t) 0 - }; - - if(ledc_timer_config(&ledc_timer) != ESP_OK) - { - log_e("ledcSetup failed!"); - return; - } +static char LOG_TAG[] = "BOOP"; - ledcWrite(chan, duty); +Beeper::Beeper(): + duration_samples{0}, + samples {0}, + channel_status { 0xFF }, + active_channel { -1 } { + voice = new SquareGenerator(); } -static portMUX_TYPE _spinlock = portMUX_INITIALIZER_UNLOCKED; - -Beeper::Beeper(gpio_num_t pin, uint8_t ch) { - pwm_channel = ch; - channel_status = 0xFF; - active_channel = -1; - - ledcSetup(pwm_channel, 10000, 8); - ledcAttachPin(pin, pwm_channel); - ledcWrite(pwm_channel, 0); +Beeper::~Beeper() { + delete voice; } void Beeper::set_channel_state(beeper_channel_t ch, bool active) { @@ -55,24 +32,44 @@ bool Beeper::is_channel_enabled(beeper_channel_t ch) { return (channel_status & (1 << ch)) > 0; } +size_t Beeper::fill_buffer(void* buffer, size_t length_) { + int want_samples = duration_samples == 0? 0: (duration_samples - samples); + size_t length = duration_samples == 0? length_ : std::min(length_, (size_t) (want_samples / 8)); + size_t generated = voice->generate_samples(buffer, length, want_samples); + samples += generated*8; + if(duration_samples > 0 && duration_samples <= samples) { + voice->set_parameter(ToneGenerator::Parameter::PARAMETER_ACTIVE, false); + } + return generated; +} + void Beeper::start_tone(beeper_channel_t ch, uint freq, uint16_t duty) { if(active_channel > ch) return; if(!is_channel_enabled(ch)) return; if(active_channel < ch) active_channel = ch; - ledcWriteToneD(pwm_channel, freq, duty); + + duration_samples = 0; + samples = 0; + voice->set_parameter(ToneGenerator::Parameter::PARAMETER_FREQUENCY, freq); } void Beeper::stop_tone(beeper_channel_t ch) { if(active_channel != ch) return; - ledcWrite(pwm_channel, 0); active_channel = -1; + + voice->set_parameter(ToneGenerator::Parameter::PARAMETER_ACTIVE, false); } void Beeper::beep_blocking(beeper_channel_t ch, uint freq, uint len, uint16_t duty) { - taskENTER_CRITICAL(&_spinlock); - start_tone(ch, freq, duty); - delayMicroseconds(len * 1000); - stop_tone(ch); - taskEXIT_CRITICAL(&_spinlock); + if(active_channel > ch) return; + if(!is_channel_enabled(ch)) return; + + if(active_channel < ch) active_channel = ch; + + samples = 0; + duration_samples = len * (WaveOut::BAUD_RATE / 1000); + voice->set_parameter(ToneGenerator::Parameter::PARAMETER_FREQUENCY, freq); + vTaskDelay(len); + active_channel = -1; } \ No newline at end of file diff --git a/src/sound/generators.cpp b/src/sound/generators.cpp new file mode 100644 index 0000000..84e5018 --- /dev/null +++ b/src/sound/generators.cpp @@ -0,0 +1,242 @@ +#include +#include + +SquareGenerator::SquareGenerator(): + phase{0}, + wavelength{0}, + active { false }, + duty { 2 } + {} + +void SquareGenerator::set_frequency(int freq) { + if(freq == 0) return; + if(freq > WaveOut::NYQUIST) { + ESP_LOGE("SQGEN", "Cannot %i hz!", freq); + return; + } + + wavelength = (WaveOut::BAUD_RATE / freq); + phase = 0; +} + +void SquareGenerator::set_active(bool a) { + active = a; + phase = 0; +} + +void SquareGenerator::reset_phase() { + phase = 0; +} + +void SquareGenerator::set_parameter(Parameter p, int v) { + switch(p) { + case PARAMETER_ACTIVE: + set_active(v != 0); + break; + + case PARAMETER_FREQUENCY: + set_frequency(v); + set_active(v != 0); + break; + + case PARAMETER_DUTY: + if(abs(v) < 2) duty = 2; + else duty = v; + break; + + default: break; + } +} + +size_t SquareGenerator::generate_samples(void* buffer, size_t length, uint32_t want_samples_) { + if(!active || wavelength == 0) return 0; + + int bits_high = wavelength / abs(duty); + if(duty < 0) bits_high = wavelength - bits_high; + uint8_t* buff = (uint8_t*) buffer; + uint32_t want_samples = want_samples_ == 0 ? (length * 8) : std::min(want_samples_, length * 8); + size_t idx = 0; + int bit = 7; + + for(int s = 0; s < want_samples; s++) { + bool state = (phase < bits_high); + idx = s / 8; + bit = 8 - (s % 8); + if(state) { + buff[idx] |= (1 << bit); + } + phase = (phase + 1) % wavelength; + } + + return idx + 1; +} + + +static const int NOISETAB_SIZE = 256; +static uint8_t NOISETAB[NOISETAB_SIZE] = { 0 }; +static bool NOISETAB_READY = false; + +static void _create_noisetab_if_needed() { + if(!NOISETAB_READY) { + esp_fill_random(NOISETAB, NOISETAB_SIZE); + NOISETAB_READY = true; + } +} + +NoiseGenerator::NoiseGenerator(): + phase { 0 }, + wavelength { 0 }, + active { false } { + rng = 1; +} + +void NoiseGenerator::set_parameter(Parameter p, int v) { + switch(p) { + case PARAMETER_ACTIVE: + active = (v != 0); + phase = 0; + break; + + case PARAMETER_FREQUENCY: + if(v == 0) { + active = false; + } + else { + wavelength = (WaveOut::BAUD_RATE / (v * 2)); + active = true; + } + break; + + case PARAMETER_DUTY: + // Not supported + break; + + default: break; + } +} + +size_t NoiseGenerator::generate_samples(void* buffer, size_t length, uint32_t want_samples_) { + if(!active || wavelength == 0) return 0; + + uint8_t* buff = (uint8_t*) buffer; + uint32_t want_samples = want_samples_ == 0 ? (length * 8) : std::min(want_samples_, length * 8); + size_t idx = 0; + int bit = 7; + + for(int s = 0; s < want_samples; s++) { + idx = s / 8; + bit = 8 - (s % 8); + if(state && (rng & 1) > 0) { + buff[idx] |= (1 << bit); + } + phase = (phase + 1) % wavelength; + if(phase == 0) { + state ^= 1; + if (state) { + // random number generator from MAME: + // https://github.com/mamedev/mame/blob/master/src/devices/sound/ay8910.cpp + + rng ^= (((rng & 1) ^ ((rng >> 3) & 1)) << 17); + rng >>= 1; + } + } + } + + return idx + 1; +} + +Sampler::Sampler(): + playhead { 0 }, + waveform { nullptr }, + remaining_samples { 0 }, + skip_factor { 1 }, + stretch_factor { 1 }, + active { false }, + state { false } +{} + +void Sampler::load_sample(const rle_sample_t * s) { + waveform = s; + rewind(); + skip_factor = 1; + stretch_factor = 1; +} + +void Sampler::rewind() { + if(waveform == nullptr || waveform->rle_data == nullptr || waveform->length == 0) return; + playhead = 0; + remaining_samples = waveform->rle_data[0]; +} + +void Sampler::set_parameter(Parameter p, int v) { + switch(p) { + case PARAMETER_ACTIVE: + active = (v != 0); + rewind(); + break; + + case PARAMETER_FREQUENCY: + if(waveform == nullptr) return; + if(v == 0) { + active = false; + } + else { + if(v >= waveform->root_frequency) { + stretch_factor = std::max(WaveOut::BAUD_RATE / waveform->sample_rate , 1); + skip_factor = std::max(v / waveform->root_frequency, 1); // not handling the case where sample rate is > waveout rate + } + else if(v < waveform->root_frequency) { + stretch_factor = std::max(WaveOut::BAUD_RATE / waveform->sample_rate, 1) * std::max(waveform->root_frequency / v, 1); + skip_factor = 1; // not handling the case where sample rate is > waveout rate + } + ESP_LOGV("SAMP", "New stretch = %i, skip = %i", stretch_factor, skip_factor); + active = true; + rewind(); + } + break; + + case PARAMETER_SAMPLE_ADDR: + if(v == 0) return; + load_sample((const rle_sample_t*) v); + break; + + default: break; + } +} + +size_t Sampler::generate_samples(void * buffer, size_t length, uint32_t want_samples_) { + if(!active || waveform == nullptr || waveform->length == 0 || waveform->rle_data == nullptr) + return 0; + + uint8_t* buff = (uint8_t*) buffer; + uint32_t want_samples = want_samples_ == 0 ? (length * 8) : std::min(want_samples_, length * 8); + size_t idx = 0; + int bit = 7; + + for(int s = 0; s < want_samples; s++) { + idx = s / 8; + bit = 8 - (s % 8); + + if(state) { + buff[idx] |= (1 << bit); + } + + if(stretch_factor == 1 || (s > 0 && (s % stretch_factor) == 0)) { + if(skip_factor > remaining_samples) { + playhead = (playhead + std::max(skip_factor / 8, 1)) % waveform->length; + remaining_samples = waveform->rle_data[playhead] - ((skip_factor % 8) - remaining_samples); + state ^= 1; + } else { + remaining_samples -= skip_factor; + } + + if(remaining_samples == 0) { + playhead = (playhead + 1) % waveform->length; + remaining_samples = waveform->rle_data[playhead]; + state ^= 1; + } + } + } + + return idx + 1; +} \ No newline at end of file diff --git a/src/sound/melodies.cpp b/src/sound/melodies.cpp index 4839ffb..7c85403 100644 --- a/src/sound/melodies.cpp +++ b/src/sound/melodies.cpp @@ -2,15 +2,14 @@ #include #include -melody_sequence_t melody_from_no(int melody_no) { +const melody_sequence_t * melody_from_no(int melody_no) { int no = std::min(melody_no, all_chime_count); no = std::max(no, 0); if(no == all_chime_count) { no = esp_random() % all_chime_count; } - melody_sequence_t melody = all_chime_list[no]; - return melody; + return &all_chime_list[no]; } #define MELODY_OF(x) {\ @@ -19,2044 +18,7738 @@ melody_sequence_t melody_from_no(int melody_no) { } static const melody_item_t just_beep_data[] = { - {1000, 250}, + {FREQ_SET, 0, 1000}, + {DELAY, 0, 250}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 500}, }; const melody_sequence_t just_beep = MELODY_OF(just_beep_data); static const melody_item_t pc98_pipo_data[] = { - {2000, 125}, - {1000, 125} + {FREQ_SET, 0, 2000}, + {DELAY, 0, 125}, + {FREQ_SET, 0, 1000}, + {DELAY, 0, 125}, }; const melody_sequence_t pc98_pipo = MELODY_OF(pc98_pipo_data); static const melody_item_t tulula_fvu_data[] = { - {392, 125}, - {392, 125}, - {392, 125}, - {293, 250} + {FREQ_SET, 0, 392}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 392}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 392}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 250}, + }; const melody_sequence_t tulula_fvu = MELODY_OF(tulula_fvu_data); static const melody_item_t oelutz_fvu_data[] = { - {587, 250}, - {698, 250}, - {880, 250}, - {1046, 125}, - {988, 500}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 250}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 250}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 250}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 125}, + {FREQ_SET, 0, 988}, + {DELAY, 0, 500}, }; const melody_sequence_t oelutz_fvu = MELODY_OF(oelutz_fvu_data); // A.M. - Arise static const melody_item_t arise_data[] = { - {622, 692}, - {932, 1153}, - {554, 692}, - {830, 634}, - {0, 57}, - {830, 230}, - {739, 230}, - {698, 1269}, - {0, 115}, - {698, 230}, - {622, 230}, - {415, 692}, - {466, 692}, - {554, 461}, - {622, 519}, - {0, 115}, - {932, 1153}, - {554, 692}, - {830, 634}, - {0, 57}, - {830, 230}, - {739, 230}, - {698, 1269}, - {0, 115}, - {698, 230}, - {739, 230}, - {830, 692}, - {932, 692}, - {1108, 519}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 466}, + {DELAY, 0, 1153}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 634}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 369}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {DELAY, 0, 1269}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 115}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 415}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 466}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 461}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 115}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 466}, + {DELAY, 0, 1153}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 634}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 369}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {DELAY, 0, 1269}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 115}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 369}, + {DELAY, 0, 230}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 466}, + {DELAY, 0, 692}, + {FREQ_SET, 0, 1108}, + {FREQ_SET, 1, 554}, + {DELAY, 0, 519}, }; const melody_sequence_t arise = MELODY_OF(arise_data); // Caramell - Caramelldansen static const melody_item_t caramell_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {880, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {293, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1479, 181}, - {1318, 181}, - {1174, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {293, 181}, - {0, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1318, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {220, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1174, 181}, - {1318, 181}, - {1174, 181}, - {1318, 181}, - {1318, 181}, - {1479, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {220, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {987, 181}, - {0, 181}, - {1479, 181}, - {1318, 181}, - {1174, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {246, 181}, - {246, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1318, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {195, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1174, 181}, - {1318, 181}, - {1479, 181}, - {1318, 181}, - {1318, 181}, - {1174, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {195, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {880, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {293, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1479, 181}, - {1318, 181}, - {1174, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {293, 181}, - {0, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1318, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {220, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1174, 181}, - {1318, 181}, - {1174, 181}, - {1318, 181}, - {1318, 181}, - {1479, 363}, - {1760, 181}, - {0, 181}, - {1567, 181}, - {1479, 181}, - {1174, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {293, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1174, 181}, - {1318, 181}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {293, 181}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1174, 181}, - {1479, 181}, - {1479, 181}, - {1318, 363}, - {1174, 181}, - {0, 181}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 246}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 246}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 195}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 195}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 363}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 293}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 363}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 181}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 181}, }; const melody_sequence_t caramell = MELODY_OF(caramell_data); // BoA - Duvet (Serial Experiments Lain OP) static const melody_item_t duvet_data[] = { - {783, 575}, - {0, 69}, - {698, 284}, - {0, 37}, - {523, 284}, - {0, 37}, - {523, 575}, - {0, 69}, - {523, 284}, - {0, 682}, - {783, 284}, - {0, 37}, - {698, 284}, - {0, 37}, - {523, 284}, - {0, 37}, - {523, 575}, - {0, 69}, - {523, 284}, - {0, 682}, - {783, 284}, - {0, 37}, - {698, 284}, - {0, 37}, - {523, 284}, - {0, 37}, - {523, 575}, - {0, 69}, - {523, 284}, - {0, 37}, - {523, 575}, - {0, 69}, - {466, 284}, - {0, 37}, - {466, 284}, - {0, 37}, - {523, 284}, - {0, 37}, - {698, 575}, - {587, 634}, - {0, 1693}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 575}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 69}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 575}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 69}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 682}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 575}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 69}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 682}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 575}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 69}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 575}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 69}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 682}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 1591}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 1252}, }; const melody_sequence_t duvet = MELODY_OF(duvet_data); // T-Square - Truth static const melody_item_t truth_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {932, 371}, - {0, 12}, - {698, 182}, - {0, 9}, - {1046, 374}, - {0, 9}, - {698, 371}, - {0, 12}, - {1108, 374}, - {0, 9}, - {698, 371}, - {0, 12}, - {1244, 374}, - {0, 9}, - {1108, 182}, - {0, 9}, - {1046, 57}, - {0, 6}, - {1108, 57}, - {0, 6}, - {1046, 57}, - {0, 6}, - {932, 182}, - {0, 9}, - {830, 371}, - {0, 12}, - {622, 182}, - {0, 9}, - {932, 374}, - {0, 9}, - {622, 371}, - {0, 12}, - {1046, 374}, - {0, 9}, - {622, 371}, - {0, 12}, - {1108, 374}, - {0, 9}, - {1046, 182}, - {0, 9}, - {932, 57}, - {0, 6}, - {1046, 57}, - {0, 6}, - {932, 57}, - {0, 6}, - {830, 182}, - {0, 9}, - {739, 371}, - {0, 12}, - {554, 182}, - {0, 9}, - {830, 374}, - {0, 9}, - {554, 371}, - {0, 12}, - {932, 374}, - {0, 9}, - {554, 371}, - {0, 12}, - {1046, 374}, - {0, 9}, - {932, 182}, - {0, 9}, - {830, 57}, - {0, 6}, - {932, 57}, - {0, 6}, - {830, 57}, - {0, 6}, - {739, 182}, - {0, 9}, - {698, 951}, - {0, 9}, - {739, 182}, - {0, 9}, - {698, 182}, - {0, 9}, - {622, 182}, - {0, 9}, - {554, 182}, - {0, 9}, - {622, 182}, - {0, 9}, - {698, 182}, - {0, 9}, - {739, 374}, - {0, 9}, - {622, 182}, - {0, 9}, - {830, 182}, - {0, 201}, + {DUTY_SET, 0, 3}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 371}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 57}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 951}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 374}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 9}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 182}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 201}, }; const melody_sequence_t truth = MELODY_OF(truth_data); // Kosaki Satoru - Haruhi no omoi static const melody_item_t haruhi_no_omoi_data[] = { - {466, 681}, - {622, 1363}, - {587, 681}, - {932, 1363}, - {932, 681}, - {830, 1363}, - {932, 681}, - {698, 1363}, - {783, 340}, - {830, 340}, - {932, 1363}, - {622, 681}, - {830, 1363}, - {783, 681}, - {698, 2045}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 681}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 1363}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 681}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 1363}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 681}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 1363}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 681}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 1363}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 340}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 340}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 1363}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 681}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 1363}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 681}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 2045}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 3579}, }; const melody_sequence_t haruhi_no_omoi = MELODY_OF(haruhi_no_omoi_data); static const melody_item_t wpip_data[] = { - {659, 625}, - {0, 75}, - {659, 291}, - {0, 8}, - {830, 416}, - {0, 91}, - {987, 404}, - {0, 87}, - {1318, 483}, - {0, 12}, - {1244, 462}, - {0, 37}, - {1108, 475}, - {0, 12}, - {987, 370}, - {0, 141}, - {554, 275}, - {0, 12}, - {622, 225}, - {0, 245}, - {622, 754}, - {0, 508}, - {830, 241}, - {0, 8}, - {932, 441}, - {0, 58}, - {783, 720}, - {0, 33}, - {622, 441}, - {0, 50}, - {659, 516}, - {0, 220}, - {659, 216}, - {0, 33}, - {830, 500}, - {987, 479}, - {0, 29}, - {1479, 225}, - {0, 12}, - {1318, 483}, - {0, 4}, - {1244, 225}, - {0, 41}, - {1318, 475}, - {0, 33}, - {1108, 466}, - {0, 20}, - {1244, 1025}, - {0, 3041}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 625}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 75}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 291}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 416}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 91}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 404}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 87}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 483}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 462}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 475}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 370}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 141}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 275}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 225}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 245}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 754}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 508}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 241}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 58}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 720}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 50}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 516}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 216}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 500}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 479}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 225}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 483}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 225}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 41}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 475}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 466}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 1025}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 3041}, }; const melody_sequence_t wpip = MELODY_OF(wpip_data); static const melody_item_t hishoku_data[] = { - {1046, 214}, - {1108, 214}, - {1244, 428}, - {1244, 428}, - {1396, 214}, - {1244, 642}, - {0, 857}, - {1661, 428}, - {1567, 428}, - {1244, 428}, - {1046, 857}, - {0, 428}, - {932, 214}, - {1046, 642}, - {0, 428}, - {1046, 214}, - {1108, 214}, - {1244, 214}, - {1244, 428}, - {830, 214}, - {830, 428}, - {0, 428}, - {830, 214}, - {1244, 428}, - {830, 214}, - {830, 428}, - {0, 428}, - {830, 214}, - {1244, 214}, - {1567, 857}, - {0, 428}, - {1396, 214}, - {1661, 857}, - {0, 214}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 642}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 857}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 857}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 642}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 857}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 428}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 214}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 857}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 214}, }; const melody_sequence_t hishoku = MELODY_OF(hishoku_data); static const melody_item_t bouken_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {880, 392}, - {987, 196}, - {1046, 196}, - {1174, 196}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1318, 294}, - {0, 98}, - {880, 294}, - {0, 98}, - {1318, 392}, - {880, 196}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1318, 392}, - {1174, 196}, - {1318, 196}, - {1567, 392}, - {1174, 196}, - {1046, 196}, - {987, 196}, - {0, 392}, - {1174, 294}, - {0, 98}, - {987, 294}, - {0, 98}, - {783, 196}, - {1174, 392}, - {1108, 196}, - {1174, 196}, - {1318, 392}, - {987, 196}, - {1046, 196}, - {1174, 196}, - {1318, 294}, - {0, 98}, - {880, 294}, - {0, 98}, - {1318, 392}, - {880, 196}, - {1318, 392}, - {1174, 196}, - {1318, 196}, - {1567, 392}, - {1174, 196}, - {1046, 196}, - {987, 196}, - {0, 392}, - {1174, 294}, - {0, 98}, - {987, 294}, - {0, 98}, - {783, 196}, - {1174, 392}, - {1318, 196}, - {1174, 196}, - {1108, 392}, - {880, 588}, - {0, 1372}, + {DUTY_SET, 1, 3}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 392}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 87}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 87}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1567}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1046}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 82}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 55}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1108}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 110}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1046}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 110}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 87}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 87}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1567}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1046}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 82}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 98}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 110}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1318}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1174}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 1108}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 110}, + {DELAY, 0, 196}, + {FREQ_SET, 1, 82}, + {DELAY, 0, 196}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 1372}, }; const melody_sequence_t bouken = MELODY_OF(bouken_data); static const melody_item_t gentle_jena_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {932, 775}, - {0, 66}, - {1479, 845}, - {0, 58}, - {1396, 445}, - {0, 29}, - {1244, 400}, - {0, 25}, - {1108, 395}, - {0, 54}, - {1244, 433}, - {1396, 400}, - {0, 479}, - {830, 441}, - {987, 291}, - {0, 154}, - {987, 404}, - {0, 237}, - {932, 54}, - {0, 50}, - {830, 75}, - {0, 50}, - {932, 616}, - {0, 325}, - {932, 641}, - {0, 237}, - {1479, 741}, - {0, 150}, - {1661, 400}, - {0, 41}, - {1479, 387}, - {0, 54}, - {1396, 395}, - {0, 37}, - {1479, 275}, - {0, 175}, - {1396, 1020}, - {0, 2508}, - {932, 829}, - {0, 50}, - {1479, 829}, - {0, 58}, - {1396, 441}, - {0, 12}, - {1244, 400}, - {0, 25}, - {1108, 408}, - {0, 37}, - {1244, 387}, - {0, 37}, - {1396, 450}, - {0, 450}, - {830, 429}, - {0, 16}, - {987, 258}, - {0, 179}, - {987, 416}, - {0, 233}, - {932, 45}, - {0, 20}, - {830, 120}, - {0, 16}, - {932, 608}, - {0, 275}, - {932, 620}, - {0, 262}, - {1479, 758}, - {0, 158}, - {1661, 400}, - {0, 54}, - {1479, 358}, - {0, 66}, - {1396, 412}, - {0, 45}, - {1479, 279}, - {0, 170}, - {1661, 1762}, - {0, 16}, - {1396, 1925}, - {0, 125}, + {DUTY_SET, 0, 4}, + {DUTY_SET, 1, 6}, + + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 387}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 350}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 54}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 408}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 391}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 58}, + {FREQ_SET, 0, 1396}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 337}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 70}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 375}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 246}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 395}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 29}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 179}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 250}, + {FREQ_SET, 1, 138}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 391}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 45}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 429}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 16}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 404}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 287}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 108}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 45}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 12}, + {FREQ_SET, 1, 92}, + {DELAY, 0, 375}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 216}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 54}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 50}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 75}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 404}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 62}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 141}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 216}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 108}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 387}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 41}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 191}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 183}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 41}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 416}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 83}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 216}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 145}, + {FREQ_SET, 1, 123}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 383}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 41}, + {FREQ_SET, 0, 1479}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 387}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 0, 1396}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 391}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 183}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 91}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 175}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 16}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 375}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 62}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 425}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 108}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 287}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 320}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 104}, + /* Rise */ + {DUTY_SET, 1, 5}, + {FREQ_SET, 1, 349}, + {DELAY, 0, 416}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 379}, + {FREQ_SET, 1, 0}, + {DUTY_SET, 1, 4}, + {DELAY, 0, 58}, + {FREQ_SET, 1, 554}, + {DELAY, 0, 412}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 622}, + {DELAY, 0, 158}, + {FREQ_SET, 1, 0}, + + {DUTY_SET, 0, 4}, + {DUTY_SET, 1, 6}, + {DELAY, 0, 291}, + /* Cont. */ + {FREQ_SET, 0, 932}, + {DELAY, 0, 12}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 395}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 387}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 29}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 400}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 400}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 58}, + {FREQ_SET, 0, 1396}, + {FREQ_SET, 1, 123}, + {DELAY, 0, 391}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 387}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 408}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 145}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 241}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 1396}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 400}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 50}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 425}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 16}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 412}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 75}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 179}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 92}, + {DELAY, 0, 379}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 138}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 233}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 45}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 95}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 408}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 1, 138}, + {DELAY, 0, 70}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 95}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 275}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 25}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 395}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 29}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 170}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 216}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 45}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 429}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 116}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 195}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 154}, + {FREQ_SET, 1, 123}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 395}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 358}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 29}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 37}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 391}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 125}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 154}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 166}, + {FREQ_SET, 1, 138}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 391}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 58}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 379}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 66}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 420}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 408}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 8}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 429}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 441}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 1, 349}, + {DELAY, 0, 987}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 1866}, }; const melody_sequence_t gentle_jena = MELODY_OF(gentle_jena_data); static const melody_item_t gammapolisz_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {880, 1299}, - {0, 293}, - {1046, 779}, - {0, 19}, - {659, 799}, - {669, 10}, - {709, 10}, - {719, 10}, - {729, 10}, - {739, 1559}, - {0, 799}, - {739, 199}, - {783, 199}, - {880, 406}, - {783, 1506}, - {0, 93}, - {932, 773}, - {0, 19}, - {587, 799}, - {598, 10}, - {609, 10}, - {625, 10}, - {638, 10}, - {659, 1559}, - {0, 799}, - {659, 199}, - {698, 186}, - {783, 172}, - {0, 246}, - {698, 2059}, - {0, 333}, - {698, 186}, - {0, 13}, - {783, 199}, - {880, 46+333}, - {0, 26}, - {783, 2099}, - {0, 293}, - {783, 199}, - {880, 46+133}, - {0, 19}, - {987, 366}, - {0, 39}, - {1046, 1426}, - {0, 166}, - {1318, 399}, - {1174, 600}, - {0, 199}, - {1046, 399}, - {1046, 1599}, + {DUTY_SET, 0, 4}, + {DUTY_SET, 1, 6}, + + {DELAY, 0, 6}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 746}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 446}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 86}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 293}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 759}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 740}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 53}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 899}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 293}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 99}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 300}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 740}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 193}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 186}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 353}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 53}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 899}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 293}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 86}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 226}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 93}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 746}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 26}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 146}, + {DELAY, 0, 633}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 159}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 926}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 266}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 339}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 653}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 146}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 164}, + {DELAY, 0, 173}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 180}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 366}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 26}, + {FREQ_SET, 1, 146}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 826}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 360}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 379}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 466}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 313}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 174}, + {DELAY, 0, 180}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 166}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 19}, + {FREQ_SET, 0, 880}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 26}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 840}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 353}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 79}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 319}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 506}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 193}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 146}, + {DELAY, 0, 159}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 33}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 180}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 366}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 39}, + {FREQ_SET, 0, 1046}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 913}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 279}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 113}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 166}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 393}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 319}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 86}, + {FREQ_SET, 1, 195}, + {DELAY, 0, 193}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 1046}, + {FREQ_SET, 1, 130}, + {DELAY, 0, 339}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 261}, + {DELAY, 0, 866}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 326}, + {FREQ_SET, 1, 261}, + {DELAY, 0, 73}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 326}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 1, 261}, + {DELAY, 0, 779}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 13}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 639}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 159}, }; const melody_sequence_t gammapolisz = MELODY_OF(gammapolisz_data); static const melody_item_t like_the_wind_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {783, 199}, - {0, 30}, - {783, 199}, - {0, 30}, - {783, 315}, - {0, 146}, - {0x2FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {523, 199}, - {0, 30}, - {523, 199}, - {0, 30}, - {523, 315}, - {0, 146}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {391, 199}, - {0, 30}, - {523, 199}, - {0, 30}, - {698, 430}, - {0, 30}, - {622, 430}, - {0, 30}, - {587, 430}, - {0, 30}, - {622, 430}, - {0, 30}, - {587, 923}, - {622, 115}, - {587, 115}, - {523, 892}, - {0, 261}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {783, 199}, - {0, 30}, - {783, 199}, - {0, 30}, - {783, 315}, - {0, 146}, - {0x2FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {523, 199}, - {0, 30}, - {523, 199}, - {0, 30}, - {523, 315}, - {0, 146}, - {0x1FF, SEQ_LEN_FLAG_TIMBRE_SET}, - {391, 199}, - {0, 30}, - {523, 199}, - {0, 30}, - {698, 430}, - {0, 30}, - {622, 430}, - {0, 30}, - {587, 430}, - {0, 30}, - {622, 430}, - {0, 30}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {587, 1123}, - {0, 1184}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 315}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 146}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 315}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 146}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 923}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 115}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 115}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 892}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 261}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 315}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 146}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 315}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 146}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 430}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 30}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 1123}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 1184}, }; const melody_sequence_t like_the_wind = MELODY_OF(like_the_wind_data); static const melody_item_t waiting_freqs_data[] = { - {493, 1017}, - {0, 21}, - {466, 2051}, - {0, 299}, - {415, 269}, - {0, 25}, - {369, 307}, - {0, 17}, - {311, 294}, - {0, 4}, - {277, 260}, - {0, 34}, - {311, 2230}, - {0, 59}, - {207, 2303}, - {0, 34}, - {329, 1136}, - {0, 17}, - {311, 2871}, - {0, 12}, - {493, 277}, - {0, 42}, - {466, 269}, - {0, 55}, - {493, 2290}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 493}, + {DELAY, 0, 1017}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 21}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 2051}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 299}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 269}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 0, 369}, + {DELAY, 0, 307}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 17}, + {FREQ_SET, 0, 311}, + {DELAY, 0, 294}, + {FREQ_SET, 0, 277}, + {DELAY, 0, 260}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 34}, + {FREQ_SET, 0, 311}, + {DELAY, 0, 2230}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 59}, + {FREQ_SET, 0, 207}, + {DELAY, 0, 2303}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 34}, + {FREQ_SET, 0, 329}, + {DELAY, 0, 1136}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 17}, + {FREQ_SET, 0, 311}, + {DELAY, 0, 2871}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 493}, + {DELAY, 0, 277}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 269}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 55}, + {FREQ_SET, 0, 493}, + {DELAY, 0, 2290}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 1722}, }; const melody_sequence_t waiting_freqs = MELODY_OF(waiting_freqs_data); static const melody_item_t the_way_data[] = { - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - - {932, 100}, - {0, 20}, - {1244, 108}, - {0, 12}, - {1396, 100}, - {0, 20}, - {1479, 112}, - {0, 8}, - {1864, 2400}, - {0, 480}, - {2489, 480}, - {2793, 480}, - {2489, 24}, - {2217, 4}, - {0, 24}, - {2093, 28}, - {1864, 2304}, - {0, 16}, - {1661, 468}, - {0, 12}, - {1396, 2380}, - {0, 20}, - {932, 1908}, - {0, 12}, - {1864, 240}, - {1396, 480}, - {1864, 240}, - {1396, 480}, - {1864, 120}, - {1396, 120}, - {1864, 120}, - {1396, 120}, - {1661, 240}, - {1244, 480}, - {1661, 240}, - {1244, 480}, - {1661, 120}, - {1244, 120}, - {1661, 120}, - {1244, 120}, - {1479, 240}, - {1244, 480}, - {1479, 240}, - {1244, 480}, - {1479, 120}, - {1244, 120}, - {1479, 120}, - {1244, 120}, - {1479, 240}, - {1244, 480}, - {1479, 120}, - {1244, 120}, - {1479, 120}, - {1244, 120}, - {1479, 120}, - {0, 120}, - {1244, 240}, - {0, 240}, - {1396, 240}, - {932, 480}, - {1396, 120}, - {932, 120}, - {1396, 120}, - {0, 120}, - {1396, 240}, - {932, 480}, - {1396, 240}, - {932, 480}, - {1396, 120}, - {932, 120}, - {1396, 120}, - {0, 120}, - {1396, 240}, - {932, 480}, - {1396, 240}, - {932, 480}, - {1396, 120}, - {932, 120}, - {1396, 120}, - {0, 120}, - {1396, 240}, - {932, 480}, - {1396, 240}, - {932, 480}, - {1396, 120}, - {932, 120}, - {1396, 120}, - {932, 120}, - {1396, 240}, - {932, 480}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 100}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 108}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 100}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 112}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 8}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 2400}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 2489}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 2793}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 2489}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 2217}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 28}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 2304}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 16}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 468}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 2380}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 1908}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 120}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 480}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 2912}, }; const melody_sequence_t the_way = MELODY_OF(the_way_data); static const melody_item_t guitar_hero_data[] = { - {0x90, SEQ_LEN_FLAG_TIMBRE_SET}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1864, 86}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 86}, - // LOOP - {0x90, SEQ_LEN_FLAG_TIMBRE_SET}, - {0, SEQ_LEN_FLAG_THE_LOOPAH}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1864, 167}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {2093, 167}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {2217, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1108, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1864, 167}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {1567, 80}, - {0, 5}, - {1244, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {2093, 167}, - {0, 5}, - {1396, 80}, - {0, 5}, - {1661, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {2217, 80}, - {0, 5}, - {2093, 80}, - {0, 5}, - {1864, 80}, - {0, 5}, - {2093, 80}, - - // BRIDGE - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - {830, 341}, - {0, 179}, - {830, 167}, - {0, 5}, - {1396, 231}, - {0, 115}, - {554, 86}, - {0, 86}, - {1396, 80}, - {0, 92}, - {1244, 80}, - {0, 92}, - {1396, 80}, - {0, 92}, - {1244, 80}, - {0, 92}, - {1396, 341}, - {0, 179}, - {1244, 341}, - {0, 5}, - {932, 341}, - {0, 5}, - {622, 173}, - {932, 167}, - {0, 5}, - {1567, 341}, - {0, 5}, - {698, 173}, - {1567, 80}, - {0, 92}, - {1046, 80}, - {0, 92}, - {1567, 80}, - {0, 92}, - {1046, 80}, - {0, 92}, - {1661, 341}, - {0, 5}, - {1661, 167}, - {0, 5}, - {1567, 167}, - {0, 5}, - {1244, 86}, - {0, 86}, + {LOOP_POINT_SET, 0, 0}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2217}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2217}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + /* BRIDGE */ + {FREQ_SET, 0, 830}, + {DELAY, 0, 341}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 179}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 231}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 115}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 341}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 179}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 341}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 341}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 173}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 341}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 173}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 92}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 341}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 167}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 5}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 86}, }; const melody_sequence_t guitar_hero = MELODY_OF(guitar_hero_data); static const melody_item_t syabon_data[] = { - {739, 254}, - {1108, 127}, - {0, 127}, - {987, 127}, - {1108, 127}, - {0, 127}, - {1108, 127}, - {987, 127}, - {0, 127}, - {880, 127}, - {880, 381}, - {0, 254}, - {739, 254}, - {1108, 127}, - {0, 127}, - {987, 127}, - {1108, 127}, - {0, 127}, - {1108, 127}, - {987, 127}, - {0, 127}, - {880, 127}, - {1108, 127}, - {0, 381}, - {0, 127}, - {554, 254}, - {659, 127}, - {0, 127}, - {739, 127}, - {0, 254}, - {0, 127}, - {739, 254}, - {880, 127}, - {0, 127}, - {830, 127}, - {0, 127}, - {739, 127}, - {0, 127}, - {659, 127}, - {0, 127}, - {554, 127}, - {0, 127}, - {1108, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {987, 254}, - {880, 127}, - {0, 508}, - {0, 127}, - {739, 254}, - {1108, 127}, - {0, 127}, - {987, 127}, - {987, 127}, - {1108, 127}, - {1108, 127}, - {987, 127}, - {987, 127}, - {880, 127}, - {880, 381}, - {739, 127}, - {0, 127}, - {739, 254}, - {1108, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {1108, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {880, 127}, - {739, 127}, - {0, 381}, - {0, 127}, - {880, 254}, - {739, 127}, - {0, 127}, - {1108, 127}, - {0, 254}, - {880, 127}, - {0, 254}, - {739, 127}, - {659, 127}, - {739, 127}, - {880, 127}, - {1108, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {880, 127}, - {739, 127}, - {0, 381}, - {0, 889}, - {659, 254}, - {880, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {1108, 127}, - {0, 381}, - {880, 127}, - {0, 381}, - {1108, 127}, - {0, 381}, - {880, 127}, - {0, 254}, - {987, 127}, - {1108, 127}, - {0, 381}, - {987, 127}, - {987, 127}, - {880, 127}, - {739, 127}, - {0, 127}, - {0, 127}, - {739, 254}, - {880, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {1108, 127}, - {1174, 127}, - {0, 127}, - {1108, 254}, - {1174, 127}, - {0, 127}, - {1108, 127}, - {0, 254}, - {987, 127}, - {880, 127}, - {659, 127}, - {739, 127}, - {739, 254}, - {659, 127}, - {0, 127}, - {739, 127}, - {0, 127}, - {880, 127}, - {0, 127}, - {739, 127}, - {0, 127}, - {830, 127}, - {0, 127}, - {880, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {880, 127}, - {0, 127}, - {1108, 127}, - {0, 381}, - {880, 127}, - {0, 381}, - {1108, 127}, - {0, 381}, - {880, 127}, - {0, 254}, - {987, 127}, - {1108, 127}, - {0, 381}, - {987, 127}, - {987, 127}, - {880, 127}, - {739, 127}, - {0, 127}, - {0, 127}, - {739, 254}, - {880, 127}, - {0, 127}, - {987, 127}, - {0, 127}, - {1108, 127}, - {1108, 127}, - {880, 127}, - {880, 127}, - {739, 127}, - {739, 127}, - {830, 127}, - {739, 127}, - {659, 127}, - {0, 42}, - {739, 127}, - {0, 42}, - {880, 127}, - {0, 42}, - {830, 127}, - {0, 42}, - {739, 127}, - {0, 42}, - {659, 127}, - {0, 42}, - {739, 127}, - {2793, 127}, - {2959, 42}, - {0, 84}, - {2959, 127}, - {0, 127}, - {2217, 127}, - {1975, 127}, - {2093, 127}, - {0, 127}, - {1760, 127}, - {0, 127}, - {1479, 127}, - {0, 2033}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 508}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 889}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 381}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 254}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 2793}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 2959}, + {DELAY, 0, 42}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 84}, + {FREQ_SET, 0, 2959}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 2217}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 127}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 2033}, }; const melody_sequence_t syabon = MELODY_OF(syabon_data); static const melody_item_t steiner_data[] = { - {0x2AA, SEQ_LEN_FLAG_TIMBRE_SET}, - {1108, 576}, - {830, 961}, - {277, 576}, - {415, 384}, - {1108, 192}, - {830, 192}, - {1108, 192}, - {1244, 576}, - {830, 961}, - {415, 576}, - {622, 384}, - {1244, 192}, - {830, 192}, - {1244, 192}, - {1318, 576}, - {659, 384}, - {1318, 192}, - {1479, 192}, - {1318, 192}, - {1244, 576}, - {739, 384}, - {1244, 192}, - {1975, 192}, - {1661, 769}, - {622, 576}, - {739, 192}, - {830, 192}, - {207, 576}, - {622, 961}, - {622, 64}, - {0, 12}, - {830, 51}, - {1108, 544}, - {830, 865}, - {277, 576}, - {415, 384}, - {1108, 192}, - {830, 192}, - {1108, 192}, - {1244, 384}, - {1318, 192}, - {1244, 384}, - {830, 576}, - {415, 576}, - {622, 384}, - {830, 192}, - {1244, 192}, - {1318, 192}, - {1479, 576}, - {987, 384}, - {1661, 192}, - {1318, 192}, - {1244, 192}, - {246, 576}, - {987, 384}, - {1108, 192}, - {1244, 192}, - {1108, 769}, - {830, 576}, - {987, 384}, - {1108, 576}, - {1396, 576}, - {1479, 384}, - {1661, 576}, - {1479, 576}, - {1975, 384}, - {1661, 576}, - {1479, 576}, - {1244, 192}, - {1318, 192}, - {1479, 576}, - {1318, 576}, - {1975, 384}, - {1244, 576}, - {1318, 384}, - {622, 192}, - {659, 192}, - {622, 192}, - {1661, 576}, - {1479, 576}, - {1975, 384}, - {2217, 576}, - {1975, 384}, - {2637, 192}, - {2489, 192}, - {1661, 384}, - {5274, 192}, - {4978, 192}, - {3322, 576}, - {987, 358}, - {0, 25}, - {880, 576}, - {739, 384}, - {622, 192}, - {493, 384}, - {1661, 384}, - {1108, 192}, - {1479, 384}, - {880, 192}, - {1975, 192}, - {987, 192}, - {1661, 384}, - {880, 192}, - {1479, 576}, - {1244, 192}, - {1318, 192}, - {1479, 384}, - {830, 192}, - {1318, 384}, - {622, 192}, - {1975, 384}, - {1244, 576}, - {1318, 384}, - {622, 192}, - {659, 192}, - {622, 192}, - {1479, 384}, - {1661, 192}, - {1760, 384}, - {1975, 384}, - {2217, 384}, - {880, 192}, - {1318, 192}, - {880, 192}, - {2217, 192}, - {739, 192}, - {2959, 192}, - {1479, 192}, - {2959, 576}, - {830, 576}, - {622, 384}, - {2793, 1538}, - {0, 3076}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 384}, + {LOOP_POINT_SET, 0, 0}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 961}, + {FREQ_SET, 0, 277}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 961}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 769}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 207}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 961}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 64}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 12}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 51}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 544}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 865}, + {FREQ_SET, 0, 277}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 246}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 769}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 2217}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 2637}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 2489}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 5274}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 4978}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 3322}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 358}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 25}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 493}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1661}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 1975}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 2217}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 2217}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 2959}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 192}, + {FREQ_SET, 0, 2959}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 576}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 384}, + {FREQ_SET, 0, 2793}, + {DELAY, 0, 1538}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 3076}, }; const melody_sequence_t steiner = MELODY_OF(steiner_data); static const melody_item_t towa_data[] = { - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {349, 94}, - {391, 94}, - {415, 569}, - {391, 94}, - {415, 94}, - {466, 379}, - {311, 379}, - {523, 379}, - {622, 379}, - {587, 189}, - {622, 189}, - {587, 189}, - {466, 189}, - {698, 379}, - {830, 379}, - {783, 284}, - {698, 284}, - {622, 189}, - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - {523, 759}, - {0, 569}, - - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {349, 94}, - {391, 94}, - {415, 569}, - {391, 94}, - {415, 94}, - {466, 379}, - {311, 379}, - {523, 379}, - {622, 379}, - {587, 189}, - {622, 189}, - {587, 189}, - {466, 189}, - {698, 1518}, - {1396, 94}, - {0, 189}, - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - {932, 94}, - {0, 94}, - {0x55, SEQ_LEN_FLAG_TIMBRE_SET}, - {1244, 94}, - {0, 189}, - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - {830, 94}, - {0, 189}, - {0x55, SEQ_LEN_FLAG_TIMBRE_SET}, - {1108, 94}, - {0, 94}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1479, 94}, - {0, 189}, - {0, 1518}, - // LOOP - {0, SEQ_LEN_FLAG_THE_LOOPAH}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {698, 189}, - {783, 189}, - {830, 189}, - {783, 189}, - {698, 189}, - {523, 189}, - {466, 189}, - {523, 379}, - {622, 189}, - {523, 569}, - {0, 569}, - {698, 189}, - {783, 189}, - {830, 189}, - {783, 189}, - {698, 189}, - {830, 189}, - {932, 189}, - {1046, 759}, - {0, 949}, - {698, 189}, - {783, 189}, - {830, 189}, - {783, 189}, - {698, 189}, - {523, 189}, - {466, 189}, - {523, 189}, - {523, 189}, - {622, 189}, - {523, 569}, - {0, 569}, - {1046, 189}, - {932, 189}, - {1046, 189}, - {932, 189}, - {830, 189}, - {783, 189}, - {622, 189}, - {698, 759}, - {0, 113}, - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - {830, 94}, - {0, 75}, - {830, 94}, - {0, 3}, - {783, 205}, - {0, 550}, - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {830, 189}, - {783, 189}, - {698, 379}, - {783, 189}, - {830, 189}, - {783, 189}, - {783, 189}, - {830, 189}, - {783, 189}, - {0, 189}, - {830, 189}, - {783, 189}, - {783, 189}, - {830, 189}, - {0, 189}, - {783, 189}, - {830, 189}, - {0, 189}, - {783, 189}, - {0, 189}, - {830, 189}, - {0, 189}, - {783, 189}, - {830, 189}, - {783, 189}, - {830, 189}, - {830, 189}, - {932, 379}, - {0, 379}, - {830, 189}, - {783, 189}, - {698, 379}, - {783, 189}, - {830, 189}, - {783, 379}, - {830, 189}, - {783, 379}, - {698, 379}, - {622, 189}, - {698, 189}, - {1046, 189}, - {1046, 759}, - {0, 189}, - {622, 189}, - {698, 379}, - {1046, 189}, - {1046, 379}, - {932, 379}, - {830, 189}, - {783, 1518}, - {0, 142}, - {391, 47}, - {622, 189}, - {554, 189}, - {523, 189}, - {0, 569}, - {698, 94}, - {783, 94}, - {830, 569}, - {932, 189}, - {830, 189}, - {783, 189}, - {698, 189}, - {622, 189}, - {523, 379}, - {1046, 379}, - {932, 379}, - {0, 189}, - {622, 94}, - {698, 94}, - {783, 569}, - {830, 189}, - {783, 189}, - {698, 189}, - {622, 189}, - {554, 189}, - {523, 379}, - {932, 379}, - {830, 379}, - {783, 379}, - {698, 379}, - {0, 189}, - {523, 189}, - {830, 379}, - {0, 189}, - {523, 189}, - {783, 569}, - {783, 189}, - {783, 379}, - {0, 189}, - {698, 189}, - {698, 379}, - {659, 379}, - {698, 569}, - {783, 189}, - {783, 759}, - {0, 569}, - {698, 94}, - {783, 94}, - {830, 569}, - {932, 189}, - {830, 189}, - {783, 189}, - {698, 189}, - {622, 189}, - {523, 379}, - {1046, 379}, - {932, 379}, - {0, 189}, - {622, 94}, - {698, 94}, - {783, 379}, - {783, 189}, - {830, 189}, - {783, 189}, - {698, 189}, - {622, 189}, - {554, 189}, - {523, 379}, - {932, 379}, - {830, 379}, - {783, 379}, - {698, 189}, - {0, 189}, - {349, 47}, - {554, 332}, - {391, 47}, - {622, 332}, - {415, 47}, - {698, 332}, - {466, 47}, - {783, 332}, - {523, 47}, - {830, 332}, - {466, 47}, - {783, 332}, - {391, 47}, - {622, 332}, - {415, 47}, - {698, 522}, - {698, 47}, - {1046, 142}, - {698, 47}, - {1046, 712}, - {0, 569}, - {830, 189}, - {783, 189}, - {622, 94}, - {523, 284}, - {783, 94}, - {698, 94}, - {0, 1518}, + {FREQ_SET, 0, 349}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 311}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 759}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 349}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 311}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 1518}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 1244}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 1479}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 1708}, + /* LOOP */ + {LOOP_POINT_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 759}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 949}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 759}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 113}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 75}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 205}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 550}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 759}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 1518}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 142}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 759}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 379}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 349}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 466}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 332}, + {FREQ_SET, 0, 415}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 522}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 142}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 47}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 712}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 569}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 189}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 284}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 94}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 1518}, }; const melody_sequence_t towa = MELODY_OF(towa_data); static const melody_item_t mermgirl_data[] = { - {1174, 199}, - {0, 14}, - {1318, 199}, - {0, 14}, - {1396, 199}, - {0, 14}, - {932, 99}, - {0, 7}, - {1396, 199}, - {0, 14}, - {880, 99}, - {0, 7}, - {1174, 199}, - {0, 14}, - {1567, 199}, - {0, 14}, - {2093, 199}, - {0, 14}, - {1318, 35}, - {1567, 367}, - {0, 24}, - {880, 35}, - {1318, 164}, - {0, 14}, - {1318, 199}, - {0, 14}, - {1046, 199}, - {0, 14}, - {1318, 199}, - {0, 14}, - {1396, 199}, - {0, 14}, - {1567, 199}, - {0, 14}, - {1396, 403}, - {0, 24}, - {1396, 199}, - {0, 14}, - {1396, 99}, - {0, 7}, - {1396, 199}, - {0, 14}, - {880, 99}, - {0, 7}, - {1174, 199}, - {0, 14}, - {1567, 199}, - {0, 14}, - {2093, 199}, - {0, 14}, - {1567, 403}, - {0, 24}, - {1318, 35}, - {1567, 164}, - {0, 14}, - {1760, 199}, - {0, 14}, - {2093, 199}, - {0, 14}, - {1864, 199}, - {0, 14}, - {1760, 403}, - {0, 24}, - {1174, 199}, - {0, 14}, - {1318, 199}, - {0, 14}, - {1396, 199}, - {0, 14}, - {932, 99}, - {0, 7}, - {1396, 199}, - {0, 14}, - {880, 99}, - {0, 7}, - {1174, 199}, - {0, 14}, - {1046, 35}, - {1567, 164}, - {0, 14}, - {2093, 199}, - {0, 14}, - {1318, 35}, - {1567, 367}, - {0, 24}, - {1318, 199}, - {0, 14}, - {1318, 199}, - {0, 14}, - {1046, 199}, - {0, 14}, - {1318, 199}, - {0, 14}, - {1396, 199}, - {0, 14}, - {1567, 199}, - {0, 14}, - {1396, 403}, - {0, 24}, - {1396, 199}, - {0, 14}, - {1396, 99}, - {0, 7}, - {1396, 199}, - {0, 14}, - {880, 99}, - {0, 7}, - {1174, 199}, - {0, 14}, - {1567, 199}, - {0, 14}, - {2093, 199}, - {0, 14}, - {1567, 403}, - {0, 24}, - {1760, 199}, - {0, 14}, - {1760, 99}, - {0, 7}, - {1760, 199}, - {0, 14}, - {1567, 99}, - {0, 7}, - {1760, 199}, - {0, 14}, - {3520, 35}, - {1760, 164}, - {0, 14}, - {4186, 35}, - {2093, 164}, - {0, 14}, - {4698, 35}, - {2349, 164}, - {0, 228}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 367}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 164}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 403}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 403}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 164}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1864}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 403}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 164}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 367}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 403}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 403}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 24}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 99}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 7}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 199}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 3520}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 1760}, + {DELAY, 0, 164}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 4186}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 2093}, + {DELAY, 0, 164}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 14}, + {FREQ_SET, 0, 4698}, + {DELAY, 0, 35}, + {FREQ_SET, 0, 2349}, + {DELAY, 0, 164}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 228}, }; const melody_sequence_t mermgirl = MELODY_OF(mermgirl_data); static const melody_item_t eye_opener_data[] = { - // Open your eyes - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1046, 29}, - {523, 147}, - {1174, 29}, - {587, 147}, - {1318, 29}, - {659, 147}, - {1174, 29}, - {587, 323}, - {0x2AA, SEQ_LEN_FLAG_TIMBRE_SET}, - {220, 174}, - {0, 178}, - {220, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 523}, + /* Open your eyes */ + {DELAY, 0, 147}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 323}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 177}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1396}, + /* See all the love in me */ + {DELAY, 0, 29}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 499}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 323}, + {FREQ_SET, 0, 174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 177}, + /* I've got enough forever */ + {FREQ_SET, 0, 783}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 261}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 1046}, + /* Don't be afraid */ + {DELAY, 0, 29}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 323}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 220}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 1396}, + /* Take all you need from me */ + {DELAY, 0, 29}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 499}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 147}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 29}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 323}, + {FREQ_SET, 0, 174}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 176}, + /* And we'll be strong together */ + {FREQ_SET, 0, 440}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 352}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 176}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 529}, + {FREQ_SET, 0, 1318}, + /* RIFF */ + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1396}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 86}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 174}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 707}, +}; +const melody_sequence_t eye_opener = MELODY_OF(eye_opener_data); - // See all the love in me - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1396, 29}, - {698, 147}, - {1318, 29}, - {659, 147}, - {1174, 29}, - {587, 147}, - {1318, 29}, - {659, 499}, - {1046, 29}, - {523, 147}, - {1046, 29}, - {523, 323}, - {0x2AA, SEQ_LEN_FLAG_TIMBRE_SET}, - {174, 174}, - {0, 178}, +static const melody_item_t ark_data[] = { + {FREQ_SET, 0, 880}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 772}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 330}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 772}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 330}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 330}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 110}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 1567}, + {DELAY, 0, 404}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 1318}, + {DELAY, 0, 735}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 330}, + {FREQ_SET, 0, 440}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 493}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 523}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 1046}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 587}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 1174}, + {DELAY, 0, 735}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 330}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 440}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 493}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 440}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 735}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 551}, + {FREQ_SET, 0, 329}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 659}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 391}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 783}, + {DELAY, 0, 183}, + {FREQ_SET, 0, 440}, + {DELAY, 0, 36}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 1066}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 882}, + {FREQ_SET, 1, 987}, + {DELAY, 0, 882}, + {DUTY_SET, 0, 6}, + {DUTY_SET, 1, 6}, + {DUTY_SET, 2, 6}, + {DUTY_SET, 3, 6}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 523}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 391}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 493}, + {FREQ_SET, 1, 246}, + {FREQ_SET, 2, 391}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 415}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 391}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 329}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 493}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 329}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 391}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 329}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 369}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 329}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 415}, + {DELAY, 0, 882}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 523}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 523}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 391}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 493}, + {FREQ_SET, 1, 246}, + {FREQ_SET, 2, 391}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 415}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {FREQ_SET, 2, 440}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 391}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 329}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 493}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 246}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 329}, + {FREQ_SET, 3, 440}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 523}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 261}, + {FREQ_SET, 3, 329}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 783}, + {FREQ_SET, 1, 391}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 349}, + {FREQ_SET, 2, 587}, + {FREQ_SET, 3, 1396}, + {DELAY, 0, 441}, + {FREQ_SET, 3, 698}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 659}, + {FREQ_SET, 1, 329}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 1318}, + {DELAY, 0, 441}, + {FREQ_SET, 3, 659}, + {DELAY, 0, 110}, + {FREQ_SET, 3, 987}, + {DELAY, 0, 110}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 293}, + {FREQ_SET, 2, 493}, + {FREQ_SET, 3, 1174}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 415}, + {FREQ_SET, 1, 261}, + {FREQ_SET, 2, 523}, + {FREQ_SET, 3, 1046}, + {DELAY, 0, 294}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 36}, + {FREQ_SET, 3, 830}, + {DELAY, 0, 110}, + {FREQ_SET, 3, 523}, + {DELAY, 0, 220}, + {FREQ_SET, 0, 415}, + {FREQ_SET, 1, 246}, + {FREQ_SET, 2, 493}, + {FREQ_SET, 3, 987}, + {DELAY, 0, 661}, + {FREQ_SET, 0, 415}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 329}, + {FREQ_SET, 3, 830}, + {DELAY, 0, 441}, + {FREQ_SET, 0, 440}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 880}, + {DELAY, 0, 1764}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 0}, +}; +const melody_sequence_t ark = MELODY_OF(ark_data); - // I've got enough forever - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {783, 176}, - {698, 352}, - {659, 352}, - {587, 352}, - {523, 352}, - {587, 176}, - {659, 352}, - {0x2AA, SEQ_LEN_FLAG_TIMBRE_SET}, - {261, 176}, +static const melody_item_t skibidi_data[] = { + {DUTY_SET, 0, 5}, + {DUTY_SET, 1, 5}, + {DUTY_SET, 2, 5}, + {DUTY_SET, 3, 5}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 160}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 160}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 1108}, + {DELAY, 0, 240}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 140}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 0, 987}, + {DELAY, 0, 180}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 160}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 160}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 180}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 180}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 4, 1000}, + {DELAY, 0, 40}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 160}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 160}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 80}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 0, 880}, + {DELAY, 0, 200}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 4, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 120}, + /* LOOP */ + {LOOP_POINT_SET, 0, 0}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 200}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 200}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 100}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 293}, + {DELAY, 0, 300}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 200}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 293}, + {DELAY, 0, 300}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 200}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 293}, + {DELAY, 0, 300}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 200}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 246}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 277}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 220}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 240}, + {FREQ_SET, 1, 293}, + {DELAY, 0, 300}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 180}, + {FREQ_SET, 1, 277}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 100}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 240}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 587}, + {DELAY, 0, 120}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 200}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 120}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 200}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 100}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 240}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 587}, + {DELAY, 0, 120}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 4, 1000}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 4, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 240}, + {FREQ_SET, 2, 493}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 100}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 240}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 587}, + {DELAY, 0, 120}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 240}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 120}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 80}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, + {FREQ_SET, 2, 554}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 100}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 2, 554}, + {DELAY, 0, 240}, + {FREQ_SET, 2, 493}, + {DELAY, 0, 80}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 587}, + {DELAY, 0, 120}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 220}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 100}, + {FREQ_SET, 3, 97}, + {DELAY, 0, 120}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 160}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 80}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 20}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 3, 110}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 4, 1000}, + {DELAY, 0, 40}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 60}, + {FREQ_SET, 1, 184}, + {DELAY, 0, 60}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 140}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 4, 0}, + {DELAY, 0, 40}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 200}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 160}, +}; +const melody_sequence_t skibidi = MELODY_OF(skibidi_data); + + +static const uint8_t ohmy_rle_data[] = {1, 3, 2, 2, 2, 2, 2, 3, 1, 1, 3, 2, 2, 4, 3, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 5, 2, 2, 2, 2, 3, 2, 2, 1, 2, 3, 3, 4, 5, 4, 2, 3, 2, 2, 3, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 2, 4, 2, 3, 2, 3, 2, 2, 3, 2, 4, 4, 2, 4, 2, 3, 2, 2, 2, 3, 2, 4, 3, 3, 4, 2, 3, 3, 2, 3, 2, 3, 2, 4, 3, 2, 2, 3, 3, 2, 2, 3, 2, 2, 2, 3, 3, 2, 3, 2, 2, 7, 1, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 4, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, 1, 3, 2, 3, 4, 5, 1, 2, 2, 2, 4, 2, 3, 2, 3, +2, 2, 2, 6, 6, 2, 6, 2, 2, 2, 2, 10, 2, 2, 30, 7, 71, 4, 3, 5, 5, 3, 7, 2, 5, 2, 1, 4, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 1, 1, 2, 2, 2, 5, 2, 1, 4, 3, 2, 2, 3, 3, 2, 2, 1, 4, 1, 2, 1, 2, 2, 1, 2, 4, 2, 1, 1, 2, 1, 1, 1, 2, 4, 2, 2, 3, 1, 2, 1, 1, 2, 3, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 3, 2, 3, 4, 2, 3, 3, 2, 2, 3, 5, 3, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 7, 2, 2, 1, 1, 4, 1, 1, 1, 1, 6, 1, 1, 1, 12, 1, 7, 1, 3, 5, 7, 3, 3, 3, 6, 2, 6, 42, 114, 1, 4, 1, 1, 3, 5, 3, 1, 1, 2, 3, 5, 2, 2, 5, 6, 6, 6, 5, 5, 4, 4, 2, 3, 2, 1, 1, 5, 1, 3, 3, 1, 1, 1, 1, 1, 4, 4, 1, 1, 2, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 5, 1, 1, 1, 2, 4, 1, 2, 3, 2, 1, 1, 2, 2, 1, 3, 3, 2, 4, 1, 1, 1, 4, 2, 1, 1, 2, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 3, 1, 4, 1, 4, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 3, 1, 4, 1, 2, 3, 1, 1, 1, 2, 1, 1, 2, 4, 1, 2, 1, 4, 1, 1, 1, 1, 2, 2, 2, 3, 3, 2, 2, 2, 1, 3, 1, 3, 2, 1, 4, 1, 2, 2, 2, 3, 1, 3, 2, 2, 3, 2, 2, 1, 2, 3, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 4, 1, 2, 4, 1, 2, 2, 3, 2, 2, 1, 2, 1, 1, 3, 1, 1, 2, 3, 2, 1, 2, 2, 2, 3, 1, 2, 2, 4, 1, 2, 3, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, +4, 2, 2, 2, 2, 2, 2, 3, 2, 1, 2, 3, 7, 4, 4, 5, 4, 4, 2, 1, 1, 2, 2, 1, 2, 5, 3, 3, 1, 2, 3, 2, 2, 1, 4, 2, 1, 2, 2, 4, 1, 3, 2, 2, 1, 3, 2, 2, 2, 3, 3, 1, 2, 2, 1, 2, 1, 1, 2, 2, 4, 2, 2, 2, 2, 2, 2, 4, 1, 1, 2, 1, 2, 4, 1, 2, 4, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 2, 2, 2, 2, 3, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 1, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 3, 1, 2, 2, 3, 1, 2, 2, 1, 3, 2, 2, 1, 2, 3, 2, 2, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 4, 1, 2, 2, 2, 1, 4, 1, 2, 1, 2, 4, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 4, 1, 3, 1, 4, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 3, 2, 1, 1, 5, 1, 3, 2, 2, 3, 2, 3, 1, 2, 3, 1, 3, 4, 4, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 3, 1, 2, 1, 1, 1, 2, 3, 2, 3, 2, 2, 4, 2, 2, 4, 2, 3, 2, 3, 1, 1, 1, 2, 2, 1, 2, 4, 2, 2, 4, 2, 3, 3, 2, 3, 3, 3, 8, 2, 1, 4, 5, +5, 1, 3}; +static const rle_sample_t ohmy = { .sample_rate = 4000, .root_frequency = 524 /* C5 */, .rle_data = ohmy_rle_data, .length = 1008 }; - // Don't be afraid - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1046, 29}, - {523, 147}, - {1174, 29}, - {587, 147}, - {1318, 29}, - {659, 147}, - {1174, 29}, - {587, 323}, - {0x2AA, SEQ_LEN_FLAG_TIMBRE_SET}, - {220, 174}, - {0, 178}, - {220, 174}, +static const uint8_t gott_rle_data[] = {0, 2, 8, 4, 2, 2, 6, 1, 3, 2, 2, 14, 2, 6, 6, 9, 8, 1, 6, 14, 13, 1, 3, 1, 2, 1, 2, 2, 1, 2, 2, 1, 3, 1, 2, 1, 2, 2, 1, 2, 1, 3, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 3, 1, 2, 1, 2, 8, 2, 2, 5, 5, 5, 2, 4, 5, 1, 1, 3, 1, 5, 7, 3, 2, 5, 7, 2, 2, 4, 8, 2, 2, 4, 8, 2, 3, 4, 7, 2, 1, 6, 5, 4, 3, 4, 7, 2, 3, 4, 7, 2, 2, 4, 5, 1, 2, 2, 3, 4, 7, 2, 2, 4, 4, 2, 1, 3, 2, 5, 6, 3, 1, 5, 7, 3, 2, 5, 6, 8, 8, 8, 2, 1, 5, 8, 7, 9, 2, 2, 5, 7, 5, 8, 1, 1, 3, 2, 5, 6, 5, 8, 2, 1, 3, 2, 4, 6, 7, 7, 2, 1, 3, 2, 4, 7, 7, 6, 2, 1, 2, 3, 4, 6, 7, 7, 1, 1, 2, 3, 4, 5, 8, 10, 1, 3, 17, 9, 2, 2, 12, 12, 17, 9, 16, 15, 9, 2, 1, 15, 10, 17, 12, 17, 12, 3, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 2, 2, 1, 3, 3, 4, 4, 1, 3, 2, 2, 2, 1, 4, 2, 1, 3, 2, 3, 1, 4, 1, 3, 2, 2, 1, 1, 5, 1, 1, 7, 8, 1, 1, 2, 10, 4, 1, 2, 2, 1, 2, 1, 2, 5, 7, 7, 2, 2, 4, 2, 2, 1, 2, 2, 1, 1, 2, 11, 4, 1, 2, 2, 1, 1, 1, 1, 4, 2, 2, 8, 8, 2, 4, 3, 1, 2, 1, 8, 7, 2, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4, 1, 1, 2, 1, 2, 1, 3, 3, 1, 2, 1, 3, 1, 1, 1, 1, 1, 5, 6, 1, 3, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 1, 2, 3, 4, 6, 1, 2, 7, 6, 5, 4, 1, 4, 3, 1, 3, 6, 6, 3, 1, 3, 8, 1, 1, 2, 6, 4, 1, 4, 7, 5, 3, 1, 2, 3, 2, 3, 3, 1, 3, 5, 3, 1, 2, 3, 2, 3, 3, 2, 2, 2, 1, 2, 5, 4, 2, 3, 2, 2, 3, 2, 2, 2, 4, 9, 3, 1, 3, 2, 2, 2, 4, 2, 1, 3, 1, 2, 3, 1, 3, 3, 1, 3, 3, 10, 7, 6, 4, 5, 1, 3, 7, 6, 4, 6, 2, 2, 7, 6, 4, 6, 1, 2, 8, 6, 4, 9, 6, 8, 4, 8, 7, 8, 4, 6, 1, 1, 7, 8, 5, 4, 2, 1, 7, 8, 5, 7, 8, 7, 6, 5, 2, 1, 6, 7, 6, 5, 10, 5, 1, 2, 4, 6, 2, 1, 6, 7, 5, 5, 2, 3, 6, 3, 2, 2, 5, 6, 7, 1, 2, 2, 1, 2, 5, 5, 2, 3, 7, 8, 3, 3, 1, 3, 1, 2, 4, 2, 2, 3, 1, 2, 2, 3, 2, 4, 3, 1, 3, 1, 2, 5, 1, 1, 5, 2, 5, 2, 1, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 1, 9, 2, 1, 3, 2, 2, 1, 3, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 3, 2, 1, 1, 2, 2, 3, 4, 1, 2, 3, 2, 1, 1, 1, 1, 2, +1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 6, 4, 1, 1, 6, 1, 1, 1, 4, 2, 1, 1, 1, 1, 3, 2, 2, 1, 1, 1, 5, 1, 1, 2, 6, 2, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 4, 1, 1, 3, 1, 1, 2, 1, 1, 6, 2, 2, 1, 1, 3, 1, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 4, 2, 1, 4, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 7, 7, 6, 6, 8, 8, 6, 6, 8, 8, 6, 6, 8, 8, 6, 6, 8, 8, 7, 5, 9, 7, 7, 5, 8, 8, 7, 6, 7, 9, 6, 6, 8, 9, 6, 6, 9, 7, 8, 2, 3, 1, 1, 1, 4, 2, 3, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 4, 2, 2, 2, 1, 1, 2, 3, 3, 3, 3, 5, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 3, 2, 2, 1, 2, 4, 3, 1, 2, 2, 1, 2, 2, 2, 6, 5, 2, 2, 2, 8, 7, 2, 3, 4, 1, 2, 5, 2, 4, 1, 1, 3, 6, 5, 1, 1, 5, 2, 1, 1, 1, 11, 2, 2, 5, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 3, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 2, 4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 3, 2, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 4, 2, 3, 1, 1, 1, 2, 3, 2, 1, 3, 2, 2, 3, 2, 3, 4, 8, 3, 2, 5, 4, 1, 2, 1, 3, 6, 6, 3, 2, 3, 1, 2, 10, 4, 1, 2, 6, 2, 3, 3, 1, 3, 3, 1, 1, 1, 3, 5, 2, 1, 5, 2, 2, 4, 1, 2, 3, 1, 5, 5, 8, 2, 3, 3, 2, 2, 9, 6, 1, +1, 5, 2, 1, 5, 1, 1, 5, 1, 1, 1, 3, 4, 9, 1, 2, 5, 2, 1, 5, 1, 3, 1, 1, 3, 4, 1, 3, 1, 3, 1, 1, 6, 8, 2, 2, 2, 3, 2, 2, 3, 2, 5, 1, 2, 1, 1, 1, 1, 5, 2, 1, 2, 7, 3, 1, 4, 3, 3, 1, 2, 4, 2, 2, 1, 1, 2, 2, 3, 1, 4, 2, 3, 1, 2, 1, 4, 4, 3, 3, 4, 2, 1, 1, 3, 1, 1, 3, 1, 3, 8, 3, 3, 6, 1, 3, 3, 2, 6, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 2, 4, 5, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 3, 3, 1, 2, 1, 2, 3, 3, 2, 3, 1, 3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 1, 3, 3, 3, 2, 2, 4, 2, 2, 4, 7, 2, 2, 7, 5, 2, 1, 5, 7, 2, 2, 5, 1, 2, 4, 1, 2, 4, 1, 2, 5, 1, 2, 7, 1, 2, 3, 1, 3, 3, 7, 2, 3, 4, 2, 1, 5, 1, 2, 3, 2, 2, 4, 2, 2, 7, 6, 1, 1, 5, 8, 2, 1, 5, 2, 2, 4, 1, 2, 4, 8, 1, 2, 6, 2, 1, 4, 1, 2, 4, 7, 2, 2, 5, 2, 2, 4, 2, 1, 5, 6, 3, 1, 6, 7, 1, 2, 5, 7, 3, 1, 5, 7, 1, 2, 6, 6, 2, 1, 7, 9, 5, 7, 10, 7, 1, 1, 6, 7, 10, 8, 7, 6, 10, 9, 6, 6, 11, 8, 7, 5, 11, 8, 7, 5, 3, 1, 7, 9, 6, 6, 10, 8, 7, 6, 10, 9, 6, 7, 8, 2, 2, 7, 3, 2, 3, 3, 7, 6, 8, 6, 3, 3, 7, 6, 6, 6, 8, 8, 2, 1, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 5, 3, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 3, 1, 1, 2, 1, 2, 4, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 5, 1, 1, 5, 5, 3, 2, 3, 7, 4, 2, 3, 6, 2, 1, 2, 1, 3, 5, 5, 3, 1, 1, 1, 2, 2, 4, 7, 5, 1, 1, 5, 1, 1, 7, 3, 1, 4, 8, 4, 1, 1, 3, 1, 4, 4, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 4, 4, 1, 3, 1, 1, 1, 2, 1, 1, 2, 4, 1, 2, 1, 1, 1, 1, 3, 1, 2, 4, 1, 2, 1, 2, 2, 3, 2, 1, 1, 3, 2, 3, 3, 2, 1, 2, +1, 1, 2, 2, 3, 1, 3, 2, 1, 3, 3, 3, 1, 1, 4, 1, 3, 2, 1, 3, 1, 2, 3, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 3, 2, 3, 2, 2, 3, 4, 4, 3, 2, 3, 3, 5, 4, 2, 2, 2, 2, 5, 5, 1, 1, 1, 1, 3, 3, 6, 7, 2, 3, 3, 3, 2, 2, 3, 5, 6, 5, 2, 1, 3, 2, 4, 3, 1, 6, 2, 2, 7, 5, 1, 2, 2, 2, 4, 3, 3, 4, 2, 3, 7, 3, 2, 2, 2, 2, 5, 2, 1, 2, 1, 4, 2, 2, 5, 2, 1, 3, 2, 1, 2, 3, 4, 2, 2, 2, 1, 3, 2, 2, 7, 4, 2, 2, 2, 2, 4, 3, 1, 1, 1, 2, 1, 2, 2, 2, 5, 1, 2, 2, 2, 2, 2, 3, 3, 3, 2, 6, 2, 2, 8, 4, 1, 2, 2, 2, 4, 8, 1, 1, 2, 3, 5, 1, 1, 4, 1, 2, 2, 3, 3, 5, 4, 2, 1, 3, 6, 5, 2, 1, 2, 3, 3, 4, 1, 2, 2, 3}; +static const rle_sample_t gott = { .sample_rate = 4000, .root_frequency = 524 /* C5 */, .rle_data = gott_rle_data, .length = 1780 }; - // Take all you need from me - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {1396, 29}, - {698, 147}, - {1318, 29}, - {659, 147}, - {1174, 29}, - {587, 147}, - {1318, 29}, - {659, 499}, - {1046, 29}, - {523, 147}, - {1046, 29}, - {523, 323}, - {0x2AA, SEQ_LEN_FLAG_TIMBRE_SET}, - {174, 174}, - {0, 178}, - // And we'll be strong together - {0xFF, SEQ_LEN_FLAG_TIMBRE_SET}, - {440, 176}, - {523, 352}, - {587, 352}, - {698, 352}, - {659, 352}, - {587, 176}, - {523, 529}, +static const melody_item_t kamippoina_data[] = { + {DUTY_SET, 0, 5}, + {DUTY_SET, 1, 5}, + {DUTY_SET, 2, 5}, + {DUTY_SET, 3, 5}, - // RIFF - {0xAA, SEQ_LEN_FLAG_TIMBRE_SET}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {880, 87}, - {1318, 175}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1046, 87}, - {1396, 175}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1046, 87}, - {1567, 175}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1174, 175}, - {1046, 87}, - {1174, 175}, - {1046, 87}, - {1174, 174}, - {0, 707}, + {SAMPLE_LOAD, 5, (int) &ohmy}, + {FREQ_SET, 5, 524}, + {DELAY, 0, 597}, + {FREQ_SET, 5, 0}, + + {LOOP_POINT_SET, 0, 0}, + + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 310}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 51}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 51}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 311}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 415}, + {FREQ_SET, 1, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 466}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 415}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 466}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 466}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 415}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 155}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 51}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 310}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 310}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 310}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 184}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 103}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 415}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 103}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 2, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 174}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 1108}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 138}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 1864}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 827}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 824}, + + + /* GOTT IST TOTT */ + {SAMPLE_LOAD, 5, (int) &gott}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {FREQ_SET, 4, 0}, + {FREQ_SET, 5, 524}, + {DELAY, 0, 1287}, + + {FREQ_SET, 1, 110}, + {FREQ_SET, 2, 146}, + {FREQ_SET, 3, 73}, + {FREQ_SET, 5, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 138}, + {FREQ_SET, 2, 184}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 2, 246}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 277}, + {FREQ_SET, 3, 138}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 830}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 138}, + {FREQ_SET, 2, 184}, + {FREQ_SET, 3, 92}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 184}, + {FREQ_SET, 2, 246}, + {FREQ_SET, 3, 123}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 277}, + {FREQ_SET, 3, 138}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 310}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 310}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 413}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 622}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 739}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 932}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 1244}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 587}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 207}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 207}, + {FREQ_SET, 3, 103}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 174}, + {FREQ_SET, 2, 233}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 1244}, + {FREQ_SET, 1, 77}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 116}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 698}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 96}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 6}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 116}, + {FREQ_SET, 2, 155}, + {FREQ_SET, 3, 77}, + {DELAY, 0, 413}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 415}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 466}, + {FREQ_SET, 3, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 987}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 310}, + {FREQ_SET, 0, 932}, + {DELAY, 0, 413}, + {FREQ_SET, 0, 830}, + {DELAY, 0, 206}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 739}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 311}, + {FREQ_SET, 2, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 1, 155}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 415}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 207}, + {FREQ_SET, 2, 415}, + {FREQ_SET, 2, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 932}, + {FREQ_SET, 2, 369}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 206}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 466}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 277}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 466}, + {FREQ_SET, 3, 174}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 554}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 349}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 622}, + {FREQ_SET, 1, 233}, + {FREQ_SET, 2, 311}, + {FREQ_SET, 3, 155}, + {DELAY, 0, 155}, + {FREQ_SET, 0, 0}, + {DELAY, 0, 51}, + {FREQ_SET, 1, 0}, + {FREQ_SET, 2, 0}, + {FREQ_SET, 3, 0}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 698}, + {DELAY, 0, 310}, + {FREQ_SET, 0, 622}, + {DELAY, 0, 413}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 0, 0}, + {FREQ_SET, 1, 311}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 155}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 233}, + {DELAY, 0, 103}, + {FREQ_SET, 1, 0}, }; -const melody_sequence_t eye_opener = MELODY_OF(eye_opener_data); +const melody_sequence_t kamippoina = MELODY_OF(kamippoina_data); const melody_sequence_t all_chime_list[] = { just_beep, @@ -2082,10 +7775,13 @@ const melody_sequence_t all_chime_list[] = { towa, mermgirl, eye_opener, + ark, + skibidi, + kamippoina, }; const int all_chime_count = sizeof(all_chime_list)/sizeof(melody_sequence_t); -const char * all_chime_names_csv = "Just Beep,PC-98 Boot,Русь 28,Штрих-М,A.M. - Arise,Caramelldansen,BoA - Duvet,T-Square - Truth,Haruhi no Omoi,WAVE & DRAX - When Present Is Past,Hishoku no Sora,Bouken Desho Desho,Gentle Jena,Omega - Gammapolisz,Like The Wind (TMMS),NightRadio - Waiting Freqs,NightRadio - The Way,Dougal & Gammer - Guitar Hero,Hachiya Nanashi - Shabon,Gate Of Steiner,deadballP - Towa ni tsuzuku gosenfu,Cream puff - Mermaid girl,Brisk & Trixxy - Eye Opener,Random"; +const char * all_chime_names_csv = "Just Beep,PC-98 Boot,Русь 28,Штрих-М,A.M. - Arise,Caramelldansen,BoA - Duvet,T-Square - Truth,Haruhi no Omoi,WAVE & DRAX - When Present Is Past,Hishoku no Sora,Bouken Desho Desho,Gentle Jena,Omega - Gammapolisz,Like The Wind (TMMS),NightRadio - Waiting Freqs,NightRadio - The Way,Dougal & Gammer - Guitar Hero,Hachiya Nanashi - Shabon,Gate Of Steiner,deadballP - Towa ni tsuzuku gosenfu,Cream puff - Mermaid girl,Brisk & Trixxy - Eye Opener,Hiroyuki Oshima - The Ark Awakes From The Sea Of Chaos,Skibidi Toilet (Timbaland - Give It To Me),PinocchioP - Kamippoina (God-ish),Random"; const std::vector all_chime_names = { "Beep", "PC-98 Boot", @@ -2110,5 +7806,8 @@ const std::vector all_chime_names = { "Towa ni tsuzuku gosenfu", "Mermaid girl", "Eye Opener", + "The Ark Awakes From The Sea Of Chaos", + "Skibidi Toilet / Give It To Me", + "Kamippoina / God-ish", "(Randomize)" }; \ No newline at end of file diff --git a/src/sound/sequencer.cpp b/src/sound/sequencer.cpp index bf553cf..4c0c28c 100644 --- a/src/sound/sequencer.cpp +++ b/src/sound/sequencer.cpp @@ -1,110 +1,101 @@ #include +#include +#include static char LOG_TAG[] = "MELODY"; -#define EVT_BIT_ENDED_PLAYING (1 << 0) +#define BIT_END_PLAY 0b00000001 -extern "C" void MelodyTaskFunction( void * pvParameter ); - -void MelodyTaskFunction( void * pvParameter ) -{ - ESP_LOGV(LOG_TAG, "Running task"); - BeepSequencer * that = static_cast ( pvParameter ); - that->task(); +NewSequencer::NewSequencer() { + // Ch 0, 1, 2, 3: tone + for(int i = 0; i < TONE_CHANNELS; i++) voices[i] = new SquareGenerator(); + voices[4] = new NoiseGenerator(); // Ch4: Noise + voices[5] = new Sampler(); // Ch5: RLE PWM + wait_end_group = xEventGroupCreate(); } +NewSequencer::~NewSequencer() { + for(int i = 0; i < CHANNELS; i++) delete voices[i]; +} -BeepSequencer::BeepSequencer(Beeper * b) { - beeper = b; +void NewSequencer::stop_sequence() { is_running = false; - pointer = 0; - hTask = NULL; - waitEndGroup = xEventGroupCreate(); + for(int i = 0; i < CHANNELS; i++) voices[i]->set_parameter(ToneGenerator::Parameter::PARAMETER_ACTIVE, false); + xEventGroupSetBits(wait_end_group, BIT_END_PLAY); } -BeepSequencer::~BeepSequencer() { - end_task(); +void NewSequencer::wait_end_play() { + xEventGroupWaitBits(wait_end_group, BIT_END_PLAY, pdFALSE, pdTRUE, portMAX_DELAY); } -void BeepSequencer::play_sequence(const melody_sequence_t melody, beeper_channel_t ch, int repeat) { +void NewSequencer::play_sequence(const melody_sequence_t * s, int repeat) { + repetitions = repeat; + sequence = s; pointer = 0; loop_point = 0; - timbre = DUTY_SQUARE; - current_sequence = melody; - current_channel = ch; - repetitions = repeat; is_running = true; - - start_task(); + remaining_delay_samples = 0; + for(int i = 0; i < CHANNELS; i++) voices[i]->set_parameter(ToneGenerator::Parameter::PARAMETER_DUTY, 0); + xEventGroupClearBits(wait_end_group, BIT_END_PLAY); + process_steps_until_delay(); } -void BeepSequencer::start_task() { - if(hTask != NULL) return; - - if(xTaskCreate( - MelodyTaskFunction, - "MELODY", - 4096, - this, - configMAX_PRIORITIES - 1, - &hTask - ) != pdPASS) { - ESP_LOGE(LOG_TAG, "Task creation failed!"); +void NewSequencer::process_steps_until_delay() { + if(!is_running) return; + if(pointer >= sequence->count) { + // End of Song condition + if(repetitions == -1 || repetitions > 0) { + if(repetitions > 0) repetitions--; + pointer = loop_point; + process_steps_until_delay(); + return; + } else if(repetitions == 0) { + stop_sequence(); + return; + } } -} -void BeepSequencer::end_task() { - if(hTask != NULL) { - vTaskDelete(hTask); - hTask = NULL; + const melody_item_t * cur_line = &sequence->array[pointer]; + switch(cur_line->command) { + case FREQ_SET: + voices[cur_line->channel]->set_parameter(ToneGenerator::Parameter::PARAMETER_FREQUENCY, cur_line->argument1); + // if(cur_line->argument1 > 0) for(int i = 0; i < TONE_CHANNELS; i++) voices[i]->reset_phase(); // retrig for unison + break; + case DUTY_SET: + voices[cur_line->channel]->set_parameter(ToneGenerator::Parameter::PARAMETER_DUTY, cur_line->argument1); + break; + case LOOP_POINT_SET: + loop_point = pointer + 1; + break; + case DELAY: + remaining_delay_samples = cur_line->argument1 * WaveOut::BAUD_RATE / 1000; + break; + case SAMPLE_LOAD: + voices[cur_line->channel]->set_parameter(ToneGenerator::Parameter::PARAMETER_SAMPLE_ADDR, cur_line->argument1); + break; + default: + break; } - xEventGroupSetBits(waitEndGroup, EVT_BIT_ENDED_PLAYING); -} + pointer++; -void BeepSequencer::stop_sequence() { - if(!is_running) return; - is_running = false; - end_task(); - beeper->stop_tone(current_channel); + if(cur_line->command != DELAY) { + process_steps_until_delay(); + } } -void BeepSequencer::task() { - while(is_running) { - melody_item_t cur = current_sequence.array[pointer]; - if(cur.length == SEQ_LEN_FLAG_TIMBRE_SET) { - timbre = cur.frequency; - } else if(cur.length == SEQ_LEN_FLAG_THE_LOOPAH) { - loop_point = pointer + 1; - } else { - if(cur.frequency == 0) { - beeper->stop_tone(current_channel); - } else { - beeper->start_tone(current_channel, cur.frequency, timbre); - } - vTaskDelay(cur.length); - } - - pointer ++; +size_t NewSequencer::fill_buffer(void* buffer, size_t length) { + if(!is_running) return 0; + if(remaining_delay_samples == 0) process_steps_until_delay(); - if(pointer >= current_sequence.count) { - if(repetitions > 0) { - repetitions--; - pointer = loop_point; - } else if(repetitions < 0) { - pointer = loop_point; - } else { - beeper->stop_tone(current_channel); - is_running = false; - hTask = NULL; - xEventGroupSetBits(waitEndGroup, EVT_BIT_ENDED_PLAYING); - vTaskDelete(NULL); - } - } + size_t generated = 0; + uint32_t want_samples = std::min(length * 8, (size_t) remaining_delay_samples); + for(int i = 0; i < CHANNELS; i++) { + size_t cur = voices[i]->generate_samples(buffer, length, want_samples); + if(cur > generated) generated = cur; } -} -void BeepSequencer::wait_end_play() { - xEventGroupClearBits(waitEndGroup, EVT_BIT_ENDED_PLAYING); - xEventGroupWaitBits(waitEndGroup, EVT_BIT_ENDED_PLAYING, false, true, portMAX_DELAY); + remaining_delay_samples -= want_samples; + + return generated; } \ No newline at end of file diff --git a/src/sound/waveout.cpp b/src/sound/waveout.cpp new file mode 100644 index 0000000..261ab91 --- /dev/null +++ b/src/sound/waveout.cpp @@ -0,0 +1,75 @@ +#include +#include + +static char LOG_TAG[] = "WOUT"; + +bool WaveOut::i2sInited = false; +TaskHandle_t WaveOut::hTask = NULL; +WaveGeneratorCallback WaveOut::callback[] = {NULL_GENERATOR, NULL_GENERATOR}; + +void WaveOut::init_I2S(gpio_num_t pin) { + if(WaveOut::i2sInited) return; + + i2s_config_t i2s_config = { + .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX), + .sample_rate = SAMPLE_RATE, + .bits_per_sample = I2S_BITS_PER_SAMPLE_8BIT, + .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, + .communication_format = I2S_COMM_FORMAT_STAND_MSB, + .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2, + .dma_buf_count = DMA_NUM_BUF, + .dma_buf_len = DMA_BUF_LEN, + .use_apll = true, + .bits_per_chan = I2S_BITS_PER_CHAN_DEFAULT + }; + + i2s_pin_config_t pincfg = { + .mck_io_num = I2S_PIN_NO_CHANGE, + .bck_io_num = I2S_PIN_NO_CHANGE, + .ws_io_num = I2S_PIN_NO_CHANGE, + .data_out_num = pin, + .data_in_num = I2S_PIN_NO_CHANGE, + }; + + i2s_driver_install(I2S_NUM, &i2s_config, 0, NULL); + + i2s_set_pin(I2S_NUM, &pincfg); + + xTaskCreate( + task, + "WaveOut", + 4096, + nullptr, + pisosTASK_PRIORITY_WAVEOUT, + &hTask + ); + + WaveOut::i2sInited = true; +} + +void WaveOut::task(void*) { + static uint8_t chunk[RENDER_CHUNK_SIZE+1] = { 0x0 }; + static const uint8_t null[RENDER_CHUNK_SIZE+1] = { 0 }; + static uint32_t * fast_chunk = (uint32_t*) chunk; + const size_t fast_chunk_size = RENDER_CHUNK_SIZE / sizeof(uint32_t); + static size_t out_size = 0; + while(1) { + size_t total = 0; + for(int i = 0; i < CHANNEL_COUNT; i++) { + size_t generated_bytes = callback[i](chunk, RENDER_CHUNK_SIZE); + if(generated_bytes > total) total = generated_bytes; + } + if(total > 0) { + // for(size_t i = 0; i < fast_chunk_size; i++) fast_chunk[i] = ~fast_chunk[i]; + i2s_write(I2S_NUM, chunk, total, &out_size, portMAX_DELAY); + memset(chunk, 0, RENDER_CHUNK_SIZE+1); + } else { + i2s_write(I2S_NUM, null, RENDER_CHUNK_SIZE, &out_size, portMAX_DELAY); + } + taskYIELD(); + } +} + +void WaveOut::set_output_callback(int channel, WaveGeneratorCallback cb) { + callback[channel] = cb; +} \ No newline at end of file diff --git a/src/views/idle_screens/fb2k.cpp b/src/views/idle_screens/fb2k.cpp index 2a5ec17..0e8c52e 100644 --- a/src/views/idle_screens/fb2k.cpp +++ b/src/views/idle_screens/fb2k.cpp @@ -13,7 +13,7 @@ static const uint8_t icn_music_data[] = { }; static const sprite_t icn_music = { - .width = 16, .height = 16, .data = icn_music_data, .mask = nullptr + .width = 16, .height = 16, .data = icn_music_data, .mask = nullptr, .format = SPRFMT_HORIZONTAL }; Fb2kView::Fb2kView() { diff --git a/src/views/idle_screens/next_alarm.cpp b/src/views/idle_screens/next_alarm.cpp index b977f63..4e0e4c7 100644 --- a/src/views/idle_screens/next_alarm.cpp +++ b/src/views/idle_screens/next_alarm.cpp @@ -12,7 +12,8 @@ static const uint8_t sleep_icns_data[] = { static const sprite_t sleep_icns = { .width = 16, .height = 16, .data = sleep_icns_data, - .mask = nullptr + .mask = nullptr, + .format = SPRFMT_HORIZONTAL }; diff --git a/src/views/idle_screens/word_of_the_day.cpp b/src/views/idle_screens/word_of_the_day.cpp index 737f582..14ad19f 100644 --- a/src/views/idle_screens/word_of_the_day.cpp +++ b/src/views/idle_screens/word_of_the_day.cpp @@ -35,7 +35,8 @@ static const ani_sprite_t book_icon = { .frames = 8, .screen_frames_per_frame = 4, .holdoff_frames = 8, - .data = spr_book_data + .data = spr_book_data, + .format = SPRFMT_HORIZONTAL }; WordOfTheDayView::WordOfTheDayView() {