Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# MIT License
# Copyright (C) 2024 by Akira TAMAMORI
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
;; 起動時間をメッセージバッファに表示
(add-hook 'after-init-hook
(lambda ()
(message "init time: %.3f sec"
(float-time (time-subtract after-init-time before-init-time)))))
;; ロードパスの設定
(add-to-list 'load-path "~/.emacs.d/lisp/")
;; C-zを無効化
;; C-zを無効化
(global-unset-key "\C-z")
;; ロードパスを追加
(add-to-list 'load-path "~/.emacs.d/lisp/")
;; theme
(if (display-graphic-p)
(load-theme 'solarized-light t))
;; (load-theme 'solarized-light t)
@tam17aki
tam17aki / gla.py
Last active December 27, 2023 07:15
Estimation of phase spectrum based on the Griffin-Lim algorithm.
"""Griffin-Lim algorithm.
Copyright (C) 2023 by Akira Tamamori
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@tam17aki
tam17aki / YaGLU.py
Last active December 25, 2023 07:17
# -*- coding: utf-8 -*-
"""A wrapper for PyTorch GLU (Gate Linear Unit).
Copyright (C) 2023 by Akira Tamamori
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
# -*- coding: utf-8 -*-
"""音声パワーと基本周波数をリアルタイムモニタリングする.
Copyright (C) 2023 by Akira TAMAMORI
Copyright (C) 2022 by Koji INOUE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# メロディ推定のデモンストレーション
# brew install timidity
# brew install libsndfile
# pip install tensorflow
# pip install tensorflow_hub
# pip install music21
# pip install pydub
import math
# Copyright (c) 2023 Blake Mallory
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
from pathlib import Path
from voicevox_core import AccelerationMode, VoicevoxCore
import sounddevice as sd
import soundfile as sf
SPEAKER_ID = 2 # 話者IDを指定
open_jtalk_dict_dir = './open_jtalk_dic_utf_8-1.11'
text = 'これは音声合成のデモンストレーションです。'
OUTPUT_WAV = 'output.wav'
#!/bin/bash
brew install wget
wget https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-arm64-1.13.1.tgz
tar xvzf onnxruntime-osx-arm64-1.13.1.tgz
mv onnxruntime-osx-arm64-1.13.1/lib/libonnxruntime.* ./
wget http://downloads.sourceforge.net/open-jtalk/open_jtalk_dic_utf_8-1.11.tar.gz
tar xvzf open_jtalk_dic_utf_8-1.11.tar.gz