m-labs / pdq

Pretty darn quick interpolating arbitrary waveform generator
GNU General Public License v3.0
6 stars 3 forks source link

Handling of the "silence" parameter in program_segments #21

Open jonaskeller opened 6 years ago

jonaskeller commented 6 years ago

It seems like this line https://github.com/m-labs/pdq/blob/2880b59aeafa6478b2d7f16907c620100e1d8c00/pdq/host/protocol.py#L437 is looking for the silence parameter one level too high and should actually be called for target_data in the loop a few lines below (if at all). Besides always setting silence to False, it also causes a KeyError exception when silence gets passed to getattr(segment, target)() twice, once by itself and once within **kwargs.

jonaskeller commented 6 years ago

To add more context, the current version works with the waveform defined here: https://github.com/m-labs/pdq/blob/702c069c94add387a57bb67efec596ee9eddc713/pdq/test/test_dac.py#L53-L94

However, this definition contradicts the description and example at http://pdq.readthedocs.io/en/v3.0-rc2/manual.html#wavesynth-format , where silence is an entry of the spline_data dictionary rather than the spline dictionary.