From 7c4f12dec9e2e5049a6f6ade4e3d51356e2ffeca Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 13 Nov 2013 12:45:28 -0500 Subject: audio: noise command --- pokemontools/audio.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pokemontools/audio.py b/pokemontools/audio.py index e427ec8..1ace4b1 100644 --- a/pokemontools/audio.py +++ b/pokemontools/audio.py @@ -98,6 +98,20 @@ class Note(Command): return True +class Noise(Note): + macro_name = "noise" + size = 0 + end = False + param_types = { + 0: {"name": "duration", "class": LoNybbleParam}, + 1: {"name": "intensity", "class": SingleByteParam}, + 2: {"name": "frequency", "class": MultiByteParam}, + } + allowed_lengths = [2,3] + override_byte_check = True + is_rgbasm_macro = False + + class Channel: """A sound channel data parser.""" @@ -195,6 +209,7 @@ class Channel: for class_ in sound_classes: if class_.id == i: return class_ + if self.channel in [4. 8]: return Noise return Note -- cgit v1.2.3