Skip to content

Instantly share code, notes, and snippets.

Avatar

Manohar Vanga mvanga

View GitHub Profile
View scale_finger_optimization.py
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# 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
@mvanga
mvanga / guitar_theory.py
Last active Sep 14, 2021
Applied guitar theory in ~400 lines of Python.
View guitar_theory.py
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# 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
@mvanga
mvanga / music_theory.py
Last active Sep 10, 2021
Basic Music Theory in ~200 Lines of Python
View music_theory.py
# The code for my article with the same name. You can find it at the URL below:
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# 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
@mvanga
mvanga / ecs-annotated.py
Last active Aug 25, 2021
A Python3 implementation of an entity-component-system in under 50 lines code.
View ecs-annotated.py
import uuid
import json
# Returns a python dictionary given a file containing a JSON-based
# component definition. Every definition *must* contain a 'type'
# and 'schema' field inside a top-level dictionary. Here is an
# example of a simple schema file that defines a 'meta' component
# containing a 'name' field.
#
View quadtree.pde
import processing.pdf.*;
int MARGIN = 0;
class Circle {
float x;
float y;
float r;
Circle(float x, float y, float r) {
this.x = x;
@mvanga
mvanga / highres.pde
Last active Apr 29, 2021
A skeleton Processing sketch that allows for exporting high-resolution versions of whatever is on screen.
View highres.pde
import processing.pdf.*;
/*
* A complete tutorial can be found over at:
* http://sighack.com/post/exporting-high-resolution-images-in-processing
*/
int seed;
int CONFIG_SCALE_FACTOR = 5;