Skip to content

Instantly share code, notes, and snippets.

@benfarahmand
benfarahmand / Audio Clip Extractor
Last active July 5, 2021 21:11
This Gist will automatically find the start and end of words within an audio file (containing only words) and then will allow you to play just those words by clicking on the segment of the audio file containing the word
import ddf.minim.*; //
import ddf.minim.ugens.*;
// we must import this package to create an AudioFormat object
import javax.sound.sampled.*;
import java.io.*;
import java.util.*;
Minim minim;
AudioSample sound;
AudioFormat format;
@benfarahmand
benfarahmand / gist:e5b895446879c71661e267c68067c636
Created May 17, 2016 23:42
Binaural Beat Generation, Creating an Illusory Sound with Processing
//this code will generate two different frequencies in each ear
//which is then experienced as a third frequency that exists due to
//the brain listening to both
//need to be wearing headphones for this to work correctly
import processing.sound.*;
SinOsc[] sines;
float f = 7.0;//freqeuncy of illusory sound
@benfarahmand
benfarahmand / gist:11335079
Created April 27, 2014 00:57
Giving Human Form to Audio Visualizers
import ddf.minim.analysis.*;
import ddf.minim.*;
import gab.opencv.*;
import processing.video.*;
OpenCV opencv;
Capture video;
Minim minim;
AudioPlayer jingle;
FFT fft;
@benfarahmand
benfarahmand / gist:9627347
Created March 18, 2014 19:18
User Activity, Question Number and Question Text Layout
<h4 style="padding-bottom: 30px;">
<table>
<tbody>
<tr>
<td style="width:25px;text-align:center;">
<span style="font-size:50px;">1</span>
</td>
<td style="padding-left:15px;"><span>Study the difference in life expectancy among countries using the histogram tool on Tuva Labs. Save your charts. What do you see? What do you wonder?</span>
</td>
</tr>
@benfarahmand
benfarahmand / saving frames
Created January 14, 2014 15:50
How to make a movie in processing
boolean recording = false;
int counter = 0;
String[] myText = {"one"," ","two"," ","three"," ","four"," ","five"};
PFont monospaced;
void setup(){
monospaced = loadFont("Monospaced.plain-48.vlw");
size(640,480);
frameRate(30);
textFont(monospaced,24);
textAlign(CENTER);
@benfarahmand
benfarahmand / tuva default style sheet
Last active January 2, 2016 00:19
default style sheet
/* if we don't set the line-height, the browser will automatically determine the best line height,
i think we should do that. Each of these em values are based on the body tag, which is currently 13px.
So the body tag should only contain what's below*/
body {
font-family: 'Source Sans Pro',sans-serif;
}
h1 {
font-size: 2.3em;
@benfarahmand
benfarahmand / about us page
Created December 19, 2013 21:02
about us page
{% extends user.is_authenticated|yesno:"base_other.html,base_home.html" %}
{% load endless %}
{% load thumbnail %}
{% block meta %}
<title>About Us | TuvaLabs</title>
<meta name="description" content="About TuvaLabs and our mission for data literacy to prepare students for the STEM jobs of tomorrow." />
{% endblock %}
@benfarahmand
benfarahmand / Bottom Button Section
Last active December 28, 2015 21:39
landing page for tuivalabs
<div class="span12" style="padding-top: 60px;">
<!-- <hr> -->
<div style="padding-top:20px;"></div>
<div class="span5 offset3">
<a href="/accounts/register/teacher/">
<div class="login-form-label signup-as-teacher">I am a <b>Teacher</b>.</div>
</a>
<a href="/accounts/register/student">
<div class="login-form-label signup-as-student">I am a <b>Student</b>.</div>
</a>
@benfarahmand
benfarahmand / css for dataset page
Created November 18, 2013 21:38
css for tuvalabs dataset page
strong {
font-weight: bold;
font-size: 18px;
}
.asked-by {
padding-top: 10px;
padding-bottom: 10px;
}