{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/music/.conda/envs/music_demo/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "(256, 320) (514, 1880, 3)\n" ] } ], "source": [ "import numpy as np\n", "from app import * \n", "\n", "test_chd_roll = np.concatenate([np.tile(CHORD_DICTIONARY[\"C:major\"], (16, 1)), \n", " np.tile(CHORD_DICTIONARY[\"C:major\"], (16, 1)), \n", " np.tile(CHORD_DICTIONARY[\"C:major\"], (16, 1)), \n", " np.tile(CHORD_DICTIONARY[\"C:major\"], (16, 1))])\n", "\n", "rhythms = [m1_rhythm, m2_rhythm, m3_rhythm, m4_rhythm]\n", "\n", "chd_roll = np.concatenate([test_chd_roll[np.newaxis,:,:], test_chd_roll[np.newaxis,:,:]], axis=0)\n", "\n", "chd_roll = circular_extend(chd_roll)\n", "chd_roll = -chd_roll-1\n" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "example3 = np.load(\"samples/diy_examples/example3.npy\")" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "example3[:2,:,:] = example3[2:4,:,:]" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "np.save(\"samples/diy_examples/example3.npy\", example3)" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "test_chd_roll.min(axis=-1)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "example0 = np.load(\"samples/diy_examples/example3.npy\")" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "example0[2,:,:] = np.min(example0[2:4,:,:], axis=0)\n", "example0[3,:,:] = np.min(example0[2:4,:,:], axis=0)" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([-2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2.,\n", " -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2.,\n", " -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2.,\n", " -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2.,\n", " -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2., -2.])" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "example0[2,:,:].min(axis=-1)" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "np.save(\"samples/diy_examples/example3.npy\", example0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "music_demo", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.19" } }, "nbformat": 4, "nbformat_minor": 2 }