Skip to content

Instantly share code, notes, and snippets.

@omardelarosa
omardelarosa / project1.md
Last active June 19, 2021 23:36
This is the Project #1 description, requirements, etc. for WDI-May2013

FIRST PROJECT DESCRIPTION

For the first project you will use your knowledge of front and back-end web development to produce an awesome web application that can be used by friends, family or any of the other billions of people who use the Internet. The type of web application you create is your choice.

The objective of this project is to:

  • To apply knowledge by building a web application from the ground up.
  • To demonstrate mastery of topics covered during this course.
  • Showcase your abilities to potential employers, friends, family, and community members.

CORE REQUIREMENTS

@omardelarosa
omardelarosa / project2.md
Last active December 19, 2015 06:19
WDI5: This is the Project #2 description.

SECOND PROJECT DESCRIPTION

For the second project you will use your knowledge of front and back-end web development to produce an awesome web application that can be used by friends, family or any of the other billions of people who use the Internet. The type of web application you create is your choice.

The objective of this project is to:

  • To apply knowledge by building a web application from the ground up.
  • To demonstrate mastery of topics covered during this course.
  • Showcase your abilities to potential employers, friends, family, and community members.

NEW REQUIREMENTS

@omardelarosa
omardelarosa / basic.js
Last active August 29, 2015 14:19
Using Pitchfork Node API
//search
var p4k = require('pitchfork')
// start the search
var search = new p4k.Search('wilco');
// listen for 'ready' event on the search
search.on('ready', function(results){
// 'results' is an array of "Review" objects. (see ./review.js for methods, etc)
@omardelarosa
omardelarosa / markov-piano.rb
Last active December 29, 2020 08:19
Markov-chain based generative Piano Music for SonicPi
set :root, 60
T = 4.0
# This hash simulates a markov chain.
# Each key is the state and the array
# value represents the next state.
H = {
60 => [58, 58, 58, 55, 60, 60, 60],
58 => [60, 56, 56, 58, 60, 60],
@omardelarosa
omardelarosa / README.md
Last active November 6, 2021 03:45
Generative Hip Hop using Markov Chaining

Generative Hip Hop using Markov Chaining

This represents one way of creating generative music by doing a randomized walk on a graph where each node represents a note state in a scale and each edge represents a transition. Edges are chosen randomly, but repetition of edges allows the simulation of weighted choices at each transition.

For example, given the following ruby hash representation:

H = {
  8 => [0],
  7 => [8],
@omardelarosa
omardelarosa / keithy-piano.rb
Last active June 11, 2018 19:00
A Study in "A Study in Keith"
# Welcome to Sonic Pi v3.1
use_bpm 70
T = 4.0
# State machine utility functions
define :markov do |a, h| h[a].sample; end # Chooses the next state at random from hash
define :g do |k| get[k]; end # simplified root note in scale getter
define :s do |k, n| set k, n; end # simplified root note setter
define :mnote do |key,chain| s key, (markov (g key), chain); g key; end
set :k, 1 # Init state
@omardelarosa
omardelarosa / chill-lofi-hiphop.rb
Last active June 13, 2018 02:31
"Jellyfish #1" (or Markov Chain-based chill lofi hiphop for SonicPi)
###
### This is a generative/randomized piece of music "composed" by Omar Delarosa
###
### To see it in context, run this file in SonicPi.
###
### Or visit on YouTube at: https://youtu.be/MBrVGzMIpRM
###
use_bpm 70
T = 4.0
@omardelarosa
omardelarosa / README.md
Last active June 16, 2018 16:50
Tiny Responsive Grid System with Stylus

How To Build A Tiny Responsive Grid System

(link to post)

Since I moved my site/blog/etc over to this static, micro-site a while back, I haven't given it much ❤️ codewise. There are a lot of little visual issues, etc. I haven't had time to fix in my personal site that I spend all day fixing during my day job. Part of the issue is that I didn't design the stylesheets very well for this site and they can take time to reason about and edit. In an attempt to change that, I've built a micro, responsive grid system here to hopefully make visual updates to this site less painful based on a pretty decent tutorial I found.

How To Build Your Grid System

Variables

So for starters, you need to define a few variables. Think of these as the parameters for your grid system. These parameters are as follows:

@omardelarosa
omardelarosa / README.md
Last active February 3, 2021 01:40
Drum Pattern Duration Randomization

Example Drum Pattern Duration Randomization

This uses some slightly more interesting drum pattern randomization than I had previously been using. It kind of uses a 2-dimensional approach:

Initial hit Position

snares = [
  ringify('0000 1000 0000 1000'),
  ringify('0000 1000 0000 1010'),
  ringify('0100 1000 0000 1000')