0

次のコードを実行しようとしていますが、

しかし、私は取得していNone-Type errorます:

from pyo import *
import random

s = Server().boot()
s.start()


fr = SigTo(value=200, time=0.5, init=200)
a = SineLoop(freq=fr, feedback=0.08, mul=.3).out()

def new_freq():
    fr.value = random.randrange(100, 600, 10)

pat = Pattern(function=new_freq, time=1).play()

そしてエラー

AttributeError: 'NoneType' オブジェクトには属性 'randrange' がありません

を使用しpython interpreterてコマンドを次々と入力すると、機能します。

よろしくお願いします。

4

1 に答える 1