音钟可视化

pitchclock的Python项目详细描述


PitchClock Logo

PitchClock徽标

俯仰时钟

pitchclock是一个python库,用于生成tone clock可视化效果。音调 时钟最初是作为无调性作曲的工具而开发的,但是 也可以是非常有用的视觉色调结构在古典 和Just Intonation 理论也是。

许可证

俯仰时钟分布在允许的MIT license下。

安装

最新稳定的俯仰时钟分布可以安装pip:

pip install pitchclock

或者,如果您喜欢当前的开发版本:

pip install git+https://github.com/hosford42/pitchclock.git

示例用法

作为一个例子,让我们比较一下平均气质主量表 它的近似语调音阶,称为syntonic diatonic scale。音调 时钟用于可视化关系,即间隔, 在投球之间,而不是绝对投球本身。因此 典型的方法是用 产生它们的补药,并在12点放置补药 位置。等音程表示为 在音程中用方括号括起来的半色调。正义 间隔用整数频率比表示。为了这个 图表,我们将用填充圆标记相等的气质区间, 有轮廓圆圈的音程和有角度的主音 作记号。下面是生成图形的代码:

fromfractionsimportFractionfrompitchclockimportETInterval,ToneClock# The equal temperament scale, expressed as equal temperament# intervals from the tonic.et_major_scale=[ETInterval(s)forsin[0,2,4,5,7,9,11]]# The just intonation scale, expressed as frequency ratios from# the tonic.ji_major_scale=[Fraction(*pair)forpairin[(1,1),(9,8),(5,4),(4,3),(3,2),(5,3),(15,8)]]# Here we create the clock, indicating which pitches to represent# with each type of marking in the graph.clock=ToneClock(filled_dots=et_major_scale,empty_dots=ji_major_scale,angles=[et_major_scale[0],ji_major_scale[0]],labels={p:pforpinet_major_scale+ji_major_scale})# We make the radius a little bigger because there's a lot going# on in this graph. A bigger radius means more space for details.clock.style.radius*=1.5# Everything is quantized to quarter tones by default, but we are# building this graph specifically to compare slight differences# in pitch, so we turn it off. However, we leave it on for labels,# because otherwise they will overlap for pitches that are very# close neighbors. With quantization of labels left on, labels# falling within the same quantum will be grouped together with# commas to separate them.clock.style.quantize_non_labels=False# Save the clock as a PNG file. Currently, this is the only# supported format.clock.save('images/major_comparison.png')

这是它产生的图像:

Major Scale Comparison

主要比例尺比较

从这个图中,可以立即看出 等差近似最差的交响度标度 气质主音阶是5/45/315/8,每个音阶都是 比以前的音高略平 近似它。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java测试SpringAOP方面   java在使用groovy访问JSON字段时遇到问题   java需要但没有被调用:<Capturing argument>实际上,与这个mock没有任何交互   java在O(n)时间内遍历LinkedList并删除k个元素   java在Hibernate中执行条件查询后,是否需要提交/关闭会话?   java提供apacheshiro作为JBoss7、WildFly8的模块   使用标头读取CSV,同时忽略JAVA中的某些行   java如何验证kotlin中的数据类是否为null   java墙纸未缩放到设备的显示   java以独立于实现的方式列出所有注册的JAXRS 2提供程序   java Apache ANT Exec Handle Exec/CakePHP控制台提示   java无法从dropwizard项目中排除logbackclassic依赖项   java如何通过对象向构造函数发送日期值,以及如何返回该日期值?   java为什么使用静态记录器比不使用它花费更多的时间   JavaAndroid:解析webview的内容而不重新加载和发布   java如何仅捕获异常类型   eclipse无法从Java独立项目中的ATL EMFTVM转换中读取模块   另一个路由中的java Apache camel blueprint web服务响应