pythonloop循环结构,beatloop-Python模块,用于编程简单的节拍循环。-Joao Faria Notes

作者:Joao Faria

### 作者邮箱:slimedev@gmail.com

### 首页:https://github.com/searchnomore/beatloop

### 文档:None

### 下载链接 UNKNOWN

========

Beatloop

Beatloop is a python module for programming simple beat loops.

Usage

This is an example usage of beatloop. You can find a more detailed example in the "examples" folder::

import beatloop

loop = beatloop.Loop(300, 4, 4, 3)

#300 BPM, 4 beats with 4 steps each, 3 audio channels

loop.load_sound("kick.ogg", 0) #load kick sound into channel #0

loop.load_sound("hat.ogg", 1) #hat into ch. #1

loop.load_sound("snare.ogg", 2)#snare into ch. #2

loop.set_sound(0, 0, 0) #set kick in beat 0, step 0

loop.set_sound(1, 1, 0) #snare in beat 1, step 0

loop.set_repeat(2, 2) #hats each 2 steps

loop.print_pattern() #display a scheme of the pattern

loop.play_once() #finally, play the loop once

Notes

Beatloop uses pygame. The pygame sound (and, inherently, beatloop) only reads .wav and .ogg sound files.

Copy from pypi.org

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值