You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When changing the sweep period, we get the following error:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/sounddevice.py", line 733, in callback_ptr
return _wrap_callback(callback, data, frames, time, status)
File "/usr/lib/python3.6/site-packages/sounddevice.py", line 2508, in _wrap_callback
callback(*args)
File "./friture/generator.py", line 251, in audio_callback
floatdata = generator.signal(t)
File "./friture/generators/sweep.py", line 108, in signal
result[firstmaxpos:] = np.cos(self.K * (np.exp((t[firstmaxpos:] - self.timeoffset) % self.T / self.L) - 1.))
TypeError: only integer scalar arrays can be converted to a scalar index
It turns out that the firstmaxpos from np.argwhere needs to be indexed one more to find the right value:
Line 101 of sweep.py:
firstmaxpos = np.argwhere(maxdetection != 0.)[0][0] + 1
instead of
firstmaxpos = np.argwhere(maxdetection != 0.)[0] + 1
The text was updated successfully, but these errors were encountered:
When changing the sweep period, we get the following error:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/sounddevice.py", line 733, in callback_ptr
return _wrap_callback(callback, data, frames, time, status)
File "/usr/lib/python3.6/site-packages/sounddevice.py", line 2508, in _wrap_callback
callback(*args)
File "./friture/generator.py", line 251, in audio_callback
floatdata = generator.signal(t)
File "./friture/generators/sweep.py", line 108, in signal
result[firstmaxpos:] = np.cos(self.K * (np.exp((t[firstmaxpos:] - self.timeoffset) % self.T / self.L) - 1.))
TypeError: only integer scalar arrays can be converted to a scalar index
It turns out that the firstmaxpos from np.argwhere needs to be indexed one more to find the right value:
Line 101 of sweep.py:
firstmaxpos = np.argwhere(maxdetection != 0.)[0][0] + 1
instead of
firstmaxpos = np.argwhere(maxdetection != 0.)[0] + 1
The text was updated successfully, but these errors were encountered: