duangsuse::Echo
718 subscribers
4.26K photos
130 videos
583 files
6.48K links
import this:
美而不丑、明而不暗、短而不凡、长而不乱,扁平不宽,读而后码,行之天下,勿托地上天国。
异常勿吞,难过勿过,叹一真理。效率是很重要,盲目最是低效。
简明是可靠的先验,不是可靠的祭品。
知其变,守其恒,为天下式;穷其变,知不穷,得地上势。知变守恒却穷变知新,我认真理,我不认真。

技术相干订阅~
另外有 throws 闲杂频道 @dsuset
转载频道 @dsusep
极小可能会有批评zf的消息 如有不适可退出
suse小站(面向运气编程): https://WOJS.org/#/
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
[DuangSUSE@duangsuse]~/Projects/smf-to-lrc% kotlin build/libs/SMFtoLRC-1.0-SNAPSHOT.jar -v ~/文档/野习_pin.mid
This is a MIDI file
Header length: 6
This is a status-1 file with 2 tracks
One tick is 1/192-th of a quarter note
This is a MIDI track
Track length: 11
At 0 Tempo: 075300 480000 (125 bpm)
This is a MIDI track
Track length: 7472
At 13184 Lyrics: 7a68656e zhen

还算是可以用也能识别出 tempo (bpm) ,只是换行需要后期编辑,总体看还好。
duangsuse::Echo
https://github.com/Enaium/LrcToSrt/tree/master/LrcToSrt #CSharp 的转换工具 https://github.com/caroltc/lrc2srt python 后端网页处理 https://github.com/URenko/lrc2srt https://github.com/SIDmao/lrc2srt 这个是 shellscript (awk/sed) 的 https://github.com/alicesister1/lrc2srt C++…
他们怎么就不能向 pandoc 学习一下…… 弄那么多 bcc2srt bcc2ass ass2lrc 限定了输入输出,还在子程序里限制输入必须是 file 什么的而不是抽象出一个 readline iterator…… 闹了半天不仅兼容性垃圾,写那么多代码连互化都做不到,草死了
This media is not supported in your browser
VIEW IN TELEGRAM
这不公平!为什么我的也能用,却没有 48 颗星星?
我给了别人辣么多星星,却没哪怕两个人肯给我的东西打颗星……
https://github.com/notepad-plus-plus/notepad-plus-plus/commit/bf2cd8e05abf5ca6c93cdc8011e0023292aeedb8#commitcomment-38574535 #GitHub #China
I see your point. However, since the author and main maintainer of taiwaneseMandarin.xml is a Taiwanese but not a Chinese nor a Hongkongners, I think it's fair to call it Taiwan Mandarin. OTOH, language/culture/region naming is just a conventional way, while people understand what it does mean, non-conventional way can be used.
This media is not supported in your browser
VIEW IN TELEGRAM
活着的时候多扒点谱,少想些修音库和换合成器
LrcToSrtGtk.zip
36.7 KB
看到某个 .NET WPF 4.0 XAML UI 写的项目想移植下到 GTK# ,发现不行,弃了。 Gtk# 也是牛逼,居然没发现有 SelectionChangedEvent ,而且有 TreeView 无 ListView ,GUI designer 也是不知道怎么 access 已经命好名的 widget ,唉
🤔 SMVU(state message view update), signal/slot, MVC, MVVM, ...
少被枪毙一次也好,只是 UTAU 不能用带 tempo 的谱子感觉损失也挺大的。
SRT 格式:
time int:int:int,int

(int
timespan --> time
!nl*
nl nl)*

LRC 格式:

CommonPart
'[' int ':' int '.' int ']' white? anyChar* nl?
'<' int ':' int '.' int '>' white? ![<\[\]]*
Tag
'[' ![0-9]+ ':' anyChar* ']'

File (Tag|CommonPart)* CommonPart*

🤔应该怎么样呢……
item, elementIn, not
Seq, Repeat, JoinBy, SurroundBy

数字应该还好读吧... 我写个

class NumberUnit:
def __init__(self, unit):
self.unit = unit
def _digits(self, n):
if n < self.unit: yield n; return
accum = n
while accum > self.unit:
(accum, k) = divmod(accum, self.unit)
yield k
if int(accum) != 0: yield accum
def convFrom(self, n): return reversed(list(self._digits(n)))
def convBack(self, ks):
accum = 0
for k in ks: accum = accum*self.unit + k
return accum

好了…… 还是咸鱼点吧,懒得再用 Python 重写现如今的 parserkt 了……

其实我就是想把
[mm:ss.xx] a <mm:ss.xx> b
给弄成
[Part("norm", mm:ss.xx, "a"), Part("word", mm:ss.xx, "b")] ,然后 zipWithNext() 处理啊…… 结果没有能直接完成两种工作的库
duangsuse::Echo
SRT 格式: time int:int:int,int (int timespan --> time !nl* nl nl)* LRC 格式: CommonPart '[' int ':' int '.' int ']' white? anyChar* nl? '<' int ':' int '.' int '>' white? ![<\[\]]* Tag '[' ![0-9]+ ':' anyChar* ']' File (Tag|CommonPart)* CommonPart* 🤔应该怎么样呢………
import operator
from functools import partial
吐嘈:functools 里面居然没有 compose 也不支持 partial(print, ..., 1),虽然后来我发现即便 lambda 这个很长但也可以用,emmm

def require(value, p, msg):
if not p(value): raise ValueError(f"{msg}: {value}")

def zipWithNext(xs):
require(xs, lambda it: len(it) > 2, "must >2")
for i in range(1, len(xs)):
yield (xs[i-1], xs[i])
def zipTakeWhile(xs, predicate):
for (a, b) in zipWithNext(xs):
if not predicate(a, b): break
yield a; yield b


嗯…… 我们想要合并的歌词其实就是
(note join by distance < cfg.d) join by distance >= cfg.d
所以只需要
while True:
print(next(linez))
except StopIteration: pass

就可以啦…… 到底还是有点麻烦
This media is not supported in your browser
VIEW IN TELEGRAM