Skip to content

Instantly share code, notes, and snippets.

View gocha's full-sized avatar

gocha gocha

View GitHub Profile
@gocha
gocha / to_integer.hpp
Last active December 18, 2023 20:52
Generic and safe strtol wrapper for Modern C++
/// @file
/// Generic and safe strtol wrapper for Modern C++.
#ifndef TO_INTEGER_HPP_
#define TO_INTEGER_HPP_
#include <cinttypes>
#include <cwchar>
#include <cctype>
#include <string>
@gocha
gocha / to_floating_point.hpp
Created June 10, 2016 05:57
Generic and safe strtod wrapper for Modern C++
/// @file
/// Generic and safe strtod wrapper for Modern C++.
#ifndef TO_FLOATING_POINT_HPP_
#define TO_FLOATING_POINT_HPP_
#include <cwchar>
#include <cctype>
#include <string>
#include <type_traits>
@gocha
gocha / numeric_cast.hpp
Created June 10, 2016 05:59
Numeric cast with a simple range check
/// @file
/// Numeric cast with a simple range check.
#ifndef NUMERIC_CAST_HPP_
#define NUMERIC_CAST_HPP_
#include <limits>
/// Cast a numeric value with a simple range check.
/// @param arg the numeric value to cast.
@gocha
gocha / bash_expand_env.c
Last active June 30, 2016 04:59
Expand path string with bash-style environment variable. (C11)
/**
* @file
* Expand path string with bash-style environment variable. (C11)
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
@gocha
gocha / vc_expand_env.c
Created June 30, 2016 04:59
Expand path string with VC-style environment variable. (C11)
/**
* @file
* Expand path string with VC-style environment variable. (C11)
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
@gocha
gocha / strnlen_utf8.c
Last active July 6, 2016 01:16
strnlen for UTF-8. Considers the character boundary and an invalid sequence.
/**
* @file
* strnlen for UTF-8. Considers the character boundary and an invalid sequence.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@gocha
gocha / Product.wxs
Last active May 29, 2017 04:35
WiX: 単純な wxs ファイルによるインストーラーのサンプル
<?xml version="1.0" encoding="UTF-8"?>
<!--
Visual Studio で WiX プロジェクトを扱う際は、
構成プロパティの Build にある Cultures to build に ja-JP を指定する。
-->
<?if $(var.Platform) = x64 ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
@gocha
gocha / A Word About EQ - iZotope Pro Audio Essentials.md
Created August 29, 2016 12:30
[Transcription] A Word About EQ | iZotope Pro Audio Essentials

Welcome to the section on EQ.

If you want to get better at using equalizers, there are some things you need to understand about them, and that we were going to spend a few minutes getting down to basics.

The pros all know these basics so you should too. It will pay off for you later when we look at how to do things.

EQ you've probably used it all your life. There and many of the music players you use everyday. Your car stereo which has tone controls to boost or cut the lower high-end. Your phone or music player which has different presets for different types of music. You'll find them everywhere.

@gocha
gocha / Understanding Frequency - iZotope Pro Audio Essentials.md
Created August 29, 2016 13:20
[Transcription] Understanding Frequency | iZotope Pro Audio Essentials

Hi everybody.

In this video, we're going to spend just a few minutes talking about frequency, looking at the spectrum, and listening.

First, here's a definition of frequency. Frequency is the speed of a sound's oscillation. It's what we hear as pitch.

A slower vibrating sound wave will sound lower in pitch, and a rapidly vibrating sound wave will sound higher in pitch. The unit we use to describe this vibration is hertz (Hz), that means the number of cycles per second.

@gocha
gocha / Connecting EQ to Musical Sound - iZotope Pro Audio Essentials.md
Created August 29, 2016 14:01
[Transcription] Connecting EQ to Musical Sound | iZotope Pro Audio Essentials

A music usually think in terms of the musical scale. When we mapped the frequency of musical notes, we noticed something interesting. As we go further and further up the scale the distance between each note is greater in terms of frequency. If we compare the distance between octaves, we have a very simple relationship: the frequency doubles with each ascending active. So we mention that the note A, commonly used as a tuning reference by classical musicians, vibrates at 440 Hz. The next octave higher is 880 Hz. The next is 1760 Hz or 1.7 kHz. So you see the distance in terms of numbers of frequencies increases as the notes get higher. Between 20 Hz and 20,000 Hz, we get about 10 octaves. You see this range in modern EQs, because it relates to the range of human hearing.

Fundamental and Harmonic Frequencies (1:02)

The note or the pitch being played by an instrument, is determined by the fundament