Lv.1
签名:666,上初中了,暂停更新
在 starry sky网盘1.0 中回复
本作品是基于大佬:耗子的《清风网盘》apk下载链接:https://creation.codemao.cn/434/24414F1A1ECC4B6AB9E7DB95喵C80A50/starrysky网盘.apk 更新日志:2022/9/152.0:更新浏览文件功能2022/9/152.1:修复5个已知bug2022/9/163.0:修复已知bug;加入网址缩短功能(由于使用的是http开头的第三方api接口,所以只能在手机上使用);加入网址缩短与加密功能
2022-09-16T10:14:52 点赞:0
在 【coco】易托管——html托管神奇(A12项目) 中回复
我的(虽然是网盘,但一样可以用来托管网页)喵o.cn/wiki/forum/487352(不喜可删)
2022-09-16T18:39:30 点赞:0
在 在Coco中的Coco里编Python 中回复
链接:https://static.codemao.cn/coco/player/unstable/H1vFB4t7j.application/json?hash=FjqmAQ3ztWajzkGLbJc_efE7GCYL
2022-10-16T15:42:58 点赞:0
在 MIDI文件处理工具,给一些人在编程猫上制作midi音乐提供方便(原创,纯Python) 中回复
import mido
import os
from tkinter import Tk, Button, Label, filedialog, messagebox, ttk, StringVar
from collections import defaultdict
import threading
class MidiConverterApp:
def __init__(self, root):
self.root = root
self.root.title("MIDI 转换器 by 看东方旭日升")
self.root.geometry("500x300")
self.root.configure(bg="#f0f0f0")
self.label = Label(root, text="选择一个MIDI文件进行转换", pady=20, font=("Arial", 14), bg="#f0f0f0")
self.label.pack()
self.convert_button = Button(root, text="选择并转换MIDI文件", command=self.start_conversion, font=("Arial", 12), bg="#4CAF50", fg="white", padx=10, pady=5)
self.convert_button.pack(pady=20)
self.progress_label = Label(root, text="", pady=10, font=("Arial", 10), bg="#f0f0f0")
self.progress_label.pack()
self.progress_var = StringVar()
self.progress = ttk.Progres喵ar(root, orient="horizontal", length=400, mode="determinate", variable=self.progress_var)
self.progress.pack(pady=10)
def start_conversion(self):
# 使用线程来执行转换,以免阻塞主线程
conversion_thread = threading.Thread(target=self.convert_midi_to_txt)
conversion_thread.start()
def convert_midi_to_txt(self):
midi_file_path = filedialog.askopenfilename(filetypes=[("MIDI files", "*.mid *.midi")])
if not midi_file_path:
messagebox.showwarning("未选择文件", "请选择一个MIDI文件进行转换")
return
midi = mido.MidiFile(midi_file_path)
output_file_path = os.path.splitext(midi_file_path)[0] + "_output.txt"
note_dict = defaultdict(list)
current_time = 0
total_msgs = sum(len(track) for track in midi.tracks)
processed_msgs = 0
self.progress_label.config(text="转换中,请稍候...")
self.progress["maximum"] = total_msgs
for track in midi.tracks:
for msg in track:
current_time += msg.time
processed_msgs += 1
self.progress_var.set(processed_msgs)
self.progress.update()
if not msg.is_meta:
if msg.type in ['note_on', 'note_off']:
time_in_seconds = round(current_time, 3)
if msg.type == 'note_on' and msg.velocity > 0:
note_dict[time_in_seconds].append(f"{msg.note}")
elif msg.type == 'note_off' or (msg.type == 'note_on' and msg.velocity == 0):
note_dict[time_in_seconds].append(f"{msg.note}")
output = []
for time, notes in sorted(note_dict.items()):
if len(notes) > 1:
output.append(f"({','.join(notes)})/{time:.3f}s")
else:
output.append(f"{','.join(notes)}/{time:.3f}s")
with open(output_file_path, 'w') as f:
f.write('/'.join(output))
self.progress_label.config(text="")
messagebox.showinfo("转换完成", f"转换完成!输出保存至: {output_file_path}")
if __name__ == "__main__":
root = Tk()
app = MidiConverterApp(root)
root.mainloop()
2024-08-21T22:06:22 点赞:0
在 MIDI文件处理工具,给一些人在编程猫上制作midi音乐提供方便(原创,纯Python) 中回复
输出如下:6/96430.000s/46/96474.000s/53/96479.000s/53/96522.000s/61/96527.000s/61/96571.000s/53/96576.000s/53/96619.000s/60/96624.000s/60/96799.000s/54/96818.000s/54/96862.000s/61/96867.000s/61/96911.000s/65/96915.000s/65/97003.000s/56/97013.000s/56/97056.000s/63/97061.000s/63/97105.000s/65/97110.000s/65/97197.000s/58/97207.000s/58/97250.000s/61/97255.000s/61/97299.000s/65/97304.000s/65/97391.000s/58/97401.000s/58/97575.000s/42/97595.000s/42/97639.000s/49/97643.000s/49/97687.000s/61/97692.000s/61/97779.000s/44/97789.000s/44/97833.000s/51/97838.000s/51/97881.000s/60/97886.000s/60/97973.000s/46/97983.000s/46/98027.000s/53/98032.000s/53/98075.000s/60/98080.000s/60/98124.000s/61/98129.000s/61/98172.000s/65/98177.000s/65/98352.000s/42/98371.000s/42/98415.000s/49/98420.000s/49/98464.000s/56/98468.000s/56/98556.000s/44/98565.000s/44/98609.000s/51/98614.000s/51/98658.000s/58/98662.000s/58/98750.000s/46/98760.000s/46/98803.000s/53/98808.000s/53/98852.000s/60/98857.000s/60/98900.000s/61/98905.000s/61/98949.000s/65/98954.000s/51/99118.000s/54/99125.000s/65/99128.000s/58/99133.000s/61/99140.000s/51/99292.000s/54/99300.000s/58/99307.000s/53/99312.000s/61/99315.000s/56/99322.000s/60/99332.000s/53/99486.000s/56/99496.000s/60/99506.000s/46/99536.000s/46/99573.000s/53/99577.000s/53/99614.000s/58/99619.000s/58/99656.000s/61/99660.000s/61/99697.000s/60/99701.000s/60/99738.000s/63/99742.000s/63/99779.000s/65/99784.000s/65/99821.000s/70/99825.000s/70/99862.000s
2024-08-21T22:08:23 点赞:0