diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-11-01 12:10:14 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-11-01 12:10:14 (GMT) |
commit | c6ff2686b955bab8f67e24fbe238f1bbd38a778f (patch) | |
tree | 7a7fb107f15da0b048407a665f03bbd18215bee3 /plugins/turtle_blocks_extras | |
parent | d0b3ef4fe54c58efae577f96fc3c799a649fec2b (diff) |
convert sine block to new prim style
Diffstat (limited to 'plugins/turtle_blocks_extras')
-rw-r--r-- | plugins/turtle_blocks_extras/turtle_blocks_extras.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index c900a3c..97d04fc 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -309,7 +309,6 @@ complete')) Primitive(self.prim_speak, arg_descs=[ArgSlot(TYPE_STRING)])) - primitive_dictionary['sinewave'] = self._prim_sinewave palette.add_block('sinewave', style='basic-style-3arg', # TRANS: pitch, duration, amplitude @@ -320,8 +319,10 @@ complete')) help_string=_('plays a sinewave at frequency, \ amplitude, and duration (in seconds)')) self.tw.lc.def_prim('sinewave', 3, - lambda self, x, y, z: - primitive_dictionary['sinewave'](x, y, z)) + Primitive(self.prim_sinewave, + arg_descs=[ArgSlot(TYPE_NUMBER), + ArgSlot(TYPE_NUMBER), + ArgSlot(TYPE_NUMBER)])) def _sensor_palette(self): debug_output('creating %s palette' % _('sensor'), @@ -1176,7 +1177,7 @@ Journal objects')) language_option, text])) self.tw.send_event(event) - def _prim_sinewave(self, pitch, amplitude, duration): + def prim_sinewave(self, pitch, amplitude, duration): """ Create a Csound score to play a sine wave. """ self.orchlines = [] self.scorelines = [] |