Skip to content

Instantly share code, notes, and snippets.

@pedropolidoro
pedropolidoro / windowslogo.css
Last active May 12, 2022 19:12
Logo do Windows
:root {--square-spacer: 57px;}
#logo-windows {
position: absolute;
left: 60px;
transform: skewX(-18deg) scale(0.8);}
.logo-square {
width: 50px;
height: 50px;
from math import log2, modf, copysign
from collections import namedtuple
notenames = 'C,,D,,E,F,,G,,A,,B'.split(',')
musicalnote = namedtuple('MusicalNoteInfo',
'name region cents numerical_representation edo tunning_A4'.split())
tunninginfo = namedtuple('TunningInfo',
'name region cents numerical_representation edo hertz'.split())
def get_notename(num, /, *, accidental='#'):
from functions import *
# PRINT A TABLE OF THE HARMONICS OF THE VARIABLE HZ
hz = 110
last_harmonic = 200
print(' Nº NOTA CENTS HERTZ')
for x, y in [(n, hz2note(n * hz)) for n in range(1, last_harmonic + 1)]:
print(f'{f"{x:3d}":<6}{f"{y.name}{y.region}":<5}{y.cents:+010.6f} {hz * x:.4f}')
from math import log2, modf, copysign
from collections import namedtuple
notenames = 'C,,D,,E,F,,G,,A,,B'.split(',')
musicalnote = namedtuple('MusicalNoteInfo',
'name region cents numerical_representation edo tunning_A4'.split())
tunninginfo = namedtuple('TunningInfo',
'name region cents numerical_representation edo hertz'.split())
@pedropolidoro
pedropolidoro / chord regex single line (not strict).txt
Last active November 11, 2021 01:57
Regular expression for separate and recognize musical chords symbos when mixed with lyrics.
\b((?:[A-G]|vii|VII|vi|VI|v|V|iv|IV|iii|III|ii|II|i|I)[#b♯♭]?(?:m(?:i(?:n(?:or)?)?)?|\+|½?dim|º|°|⁰|◦|⸰|○|⚬|∆|Δ|△|Ø|ø|⌀|⊘|∅|au[gm]|alt|sus|dom|-|add|no|omit|[Mm]aj?|M|[#b♯♭+-]|\d+|\(|\)|\/)*(?:[A-G][#b♯♭]?)?(?:\(?drop\d\)?)?(?=\n|\s|$))
@pedropolidoro
pedropolidoro / regex_chord.txt
Last active May 27, 2022 17:32
Regular expression for separate and recognize musical chords symbols when mixed with lyrics.
(?# This regular expression is for separate and recognize musical chords
when mixed with lyrics.
)
\b(
(?#fundamental) (?:[A-G]|
vii|VII|vi|VI|v|V|iv|IV|iii|III|ii|II|i|I)
[#b♯♭]?
(?: