Commit e33c9bf6 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[scripts] fix for ISM rendering when input file has extra samples

- fix a missing comma in cicp13.txt ls layout file
- correctly set executable bit on some python files
parent 713054aa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
0, 30 -30, 60, -60, 90, -90, 135, -135, 180, 0,  45, -45, 90, -90, 0,  135, -135, 180,   0,  45, -45
0, 30, -30, 60, -60, 90, -90, 135, -135, 180, 0,  45, -45, 90, -90, 0,  135, -135, 180,   0,  45, -45
0,  0,   0,  0,   0,  0,   0,   0,    0,   0, 35, 35,  35, 35,  35, 90,  35,   35,  35, -15, -15, -15
3, 9
+0 −0

File mode changed from 100644 to 100755.

+8 −2
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ def limiter(x: np.ndarray, fs: int):
        fr_sig[idx_min] = -32768


def get_framewise(x: np.ndarray, chunk_size: int) -> np.ndarray:
def get_framewise(x: np.ndarray, chunk_size: int, zero_pad=False) -> np.ndarray:
    """Generator to yield a signal frame by frame
        If array size is not a multiple of chunk_size, last frame contains the remainder

@@ -420,6 +420,8 @@ def get_framewise(x: np.ndarray, chunk_size: int) -> np.ndarray:
        Input reference array
    chunk_size: int
        Size of frames to yield
    zero_pad: bool
        Whether to zero pad the last chunk if there are not enough samples

    Yields
    -------
@@ -430,7 +432,11 @@ def get_framewise(x: np.ndarray, chunk_size: int) -> np.ndarray:
    for i in range(n_frames):
        yield x[i * chunk_size : (i + 1) * chunk_size, :]
    if x.shape[0] % chunk_size:
        yield x[n_frames * chunk_size :, :]
        last_chunk = x[n_frames * chunk_size :, :]
        if zero_pad:
            yield np.pad(last_chunk, [[0, x.shape[0] % chunk_size], [0, 0]])
        else:
            yield last_chunk


def process_async(files: Iterable, func: Callable, **kwargs):
+0 −0

File mode changed from 100755 to 100644.

+7 −0
Original line number Diff line number Diff line
@@ -426,6 +426,13 @@ def convert_ism(
            audioarray.get_framewise(out_sig, frame_len),
        )
    ):
        # update the crossfade if we have a smaller last frame
        if out_frame.shape[0] != frame_len:
            frame_size = out_frame.shape[0]
            fade_in = np.arange(frame_size) / (frame_size - 1)
            fade_in = fade_in[:, np.newaxis]
            fade_out = 1.0 - fade_in

        pos = EFAP.wrap_angles(*pos_data[i_frame % pos_frames, :], clip_ele=True)

        # ISM -> MC
Loading