code: def create_sine_wave(freq, samplerate, nframes, nchannels):
      """create a pure tone (without numpy)"""
      _x = [
          0.7 * math.sin(2.0 * math.pi * freq * t / float(samplerate))
          for t in range(nframes)
      ]
      _x = [int(a * 32767) for a in _x]
      _x = b"".join(
          [
              b"".join([struct.pack("h", v) for _ in range(nchannels)])
              for v in _x
          ]
      )
      return _x
  
imports: import wave
  import math
  import struct
label_desc: Use image node_id 1 for calling a global function with example usage: create_sine_wave(freq, samplerate, nframes, nchannels) and returns: _x