Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit System #39

Open
shigma opened this issue Apr 11, 2018 · 2 comments
Open

Unit System #39

shigma opened this issue Apr 11, 2018 · 2 comments
Labels
proposal 语法提案
Projects

Comments

@shigma
Copy link
Contributor

shigma commented Apr 11, 2018

对于以时间作为参数的函数, 用户往往有着不同的表达需求. 有时用户希望以"秒"为单位, 另一些时候以"拍"为单位则是更好的选择. 为了迎合这两种选择, 同时增强函数的复用性, 我建议允许用户在数字的后面跟上单位来表示这个时间量. 在 tokenizer 也相应地增加一个Unit标签. 举下面的例子:

FadeOut(1s) // 1秒
Extend({...}, 1b) // 1拍

大家对此有什么看法呢?

@shigma shigma added the proposal 语法提案 label Apr 11, 2018
@shigma shigma added this to Stage 0 in Proposals via automation Apr 11, 2018
@NN708
Copy link
Member

NN708 commented Apr 11, 2018

我认为默认应该使用拍做单位,即 FadeOut(1) 表示淡出一拍。理由如下:

  1. 音乐作为一个节律系统,循环反复特征明显,“拍”即是它最小的循环周期。因此以“拍”作为默认单位较好;
  2. “拍”是通过速度定义好的,定义之后基本以“拍”作为单位,直接用“秒”的情况较少(比如我扒个谱子一般会数淡出的拍数,不会掐个秒表得出秒数);
  3. 人们一般不会使用 1b 这种写法,不太自然。

不过用 1s 这样的写法将秒数加入进来也是可以考虑的,毕竟达到了扩充功能的目的。

@shigma
Copy link
Contributor Author

shigma commented Apr 11, 2018

@NN708 我非常赞同你的观点, 即默认用拍作为单位. 但是你举的例子实在是令人觉得尴尬.
……因为目前FadeOut函数是以秒为单位的. 其实淡入淡出的系统应当是另做的 (这个以后再讨论).

好吧不说这个, 但我认为“默认拍数”的大环境下人们依旧可以愉快的使用1或者1b或者1bt来表示 1 拍, 仅仅是为了区分秒数的概念. 过去的 Parser 的数据存储是以秒数为主导的, 这必然导致了这类函数难以处理拍数. 但是好在我在这个版本已经对这种情况作出了一定的调整, 相信很快就会有以拍数为参数的函数问世.

至于默认是什么的问题嘛……很多时候我们也有无量纲的变量读入, 因此或许我们应该构建一套量纲体系了. 我会对新版本的参数规则调整再发一个 proposal 的.

谢谢你的建议.

@shigma shigma moved this from Stage 0 to Stage 1 in Proposals Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal 语法提案
Projects
Proposals
  
Stage 1
Development

No branches or pull requests

2 participants