pyroomacoustics
pyroomacoustics copied to clipboard
How to retrieve the wall sequece
Dear Fakufaku,
https://github.com/LCAV/pyroomacoustics/blob/faafedf45c9792586d1a4a46c796e044fbccbda3/pyroomacoustics/soundsource.py#L269
I was trying to retrieve the wall sequence generating a give image source and I found that you already coded it. amazing! However, it seems that the function is looping forever. Maybe because you changed the direct path 'wall' code from NaN to -1 ?
This seems working
def wall_sequence(self,i):
'''
Print the wall sequence for the image source indexed by i
'''
p = self.generators[i]
if p == -1: # before: np.isnan(p)
return [-1] # before: []. The generator of the dp is the dp itself
w = [self.walls[i]]
while not p == -1: # before: np.isnan(p)
w.append(self.walls[p])
p = self.generators[p]
return w
Thanks for pointing this out! I have not been using this code for a while! In which branch is the bug happening ? It would be great if you want to do a PR with this bug fix!
Also, I don't think that works for shoebox rooms anymore because one source may have more than one parent due to overlapping image sources. So it might be best to have a check in this function that the room is not a shoebox.
Thank you @fakufaku .
It was in the :master
branch. I going to do a PR for this.
You are right actually about the behavior of the shoebox.