Create function 'pause'
This commit is contained in:
@@ -7,6 +7,7 @@ from smnp.library.function.flat import flat
|
|||||||
from smnp.library.function.interval import interval
|
from smnp.library.function.interval import interval
|
||||||
from smnp.library.function.mic import wait
|
from smnp.library.function.mic import wait
|
||||||
from smnp.library.function.octave import withOctave
|
from smnp.library.function.octave import withOctave
|
||||||
|
from smnp.library.function.pause import pause
|
||||||
from smnp.library.function.rand import random
|
from smnp.library.function.rand import random
|
||||||
from smnp.library.function.semitones import semitones
|
from smnp.library.function.semitones import semitones
|
||||||
from smnp.library.function.sleep import sleep
|
from smnp.library.function.sleep import sleep
|
||||||
@@ -28,7 +29,8 @@ def createEnvironment():
|
|||||||
wait,
|
wait,
|
||||||
random,
|
random,
|
||||||
tuplet,
|
tuplet,
|
||||||
synth
|
synth,
|
||||||
|
pause
|
||||||
]
|
]
|
||||||
|
|
||||||
methods = [
|
methods = [
|
||||||
|
|||||||
15
smnp/library/function/pause.py
Normal file
15
smnp/library/function/pause.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
from smnp.library.model import Function
|
||||||
|
from smnp.library.signature import signature, ofTypes
|
||||||
|
from smnp.synth import player
|
||||||
|
from smnp.type.model import Type
|
||||||
|
|
||||||
|
|
||||||
|
def _pause(env, value):
|
||||||
|
bpm = env.findVariable('bpm')
|
||||||
|
player.pause(value.value, bpm)
|
||||||
|
|
||||||
|
|
||||||
|
_sign = signature(ofTypes(Type.INTEGER))
|
||||||
|
|
||||||
|
|
||||||
|
pause = Function(_sign, _pause, 'pause')
|
||||||
Reference in New Issue
Block a user