Skip to content

Instantly share code, notes, and snippets.

View J3698's full-sized avatar
๐Ÿ›
Inch Worm

Anti J3698

๐Ÿ›
Inch Worm
  • Working
  • Working
View GitHub Profile
@J3698
J3698 / process_lights.c
Last active April 30, 2019 03:54
Addings Lights to Process
int process(jack_nframes_t nframes, void *arg) {
sample_t *outBufferLeft = (sample_t *) jack_port_get_buffer(output_port_l, nframes);
sample_t *outBufferRight = (sample_t *) jack_port_get_buffer(output_port_r, nframes);
sample_t *inBufferLeft = (sample_t *) jack_port_get_buffer(input_port_l, nframes);
sample_t *inBufferRight = (sample_t *) jack_port_get_buffer(input_port_r, nframes);
// copy input audio to output
memcpy(outBufferLeft, inBufferLeft, sizeof(sample_t) * nframes);
memcpy(outBufferRight, inBufferRight, sizeof(sample_t) * nframes);
@J3698
J3698 / simple_visualizer.c
Last active May 7, 2019 22:10
Lights Simple Visualizer
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include "moving_average.h"
// for audio
@J3698
J3698 / desktop-mobile.html
Last active March 12, 2019 17:39
A mobile-friendly website
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Site</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"</meta>
<style>
#header {
position: absolute;
top: 0; left: 0;
@J3698
J3698 / desktop.html
Last active March 12, 2019 17:39
A simple desktop website
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Site</title>
<meta charset="UTF-8">
<style>
#header {
position: absolute;
top: 0; left: 0;
width: 100%;
@J3698
J3698 / process.c
Last active April 29, 2019 01:03
The process method for the audio visualizer
int process(jack_nframes_t nframes, void *arg) {
sample_t *outBufferLeft = (sample_t *) jack_port_get_buffer(output_port_l, nframes);
sample_t *outBufferRight = (sample_t *) jack_port_get_buffer(output_port_r, nframes);
sample_t *inBufferLeft = (sample_t *) jack_port_get_buffer(input_port_l, nframes);
sample_t *inBufferRight = (sample_t *) jack_port_get_buffer(input_port_r, nframes);
// copy input audio to output
memcpy(outBufferLeft, inBufferLeft, sizeof(sample_t) * nframes);
memcpy(outBufferRight, inBufferRight, sizeof(sample_t) * nframes);
@J3698
J3698 / simple_visualizer.c
Last active April 29, 2019 01:03
A very simple visualizer
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <math.h>
#include <getopt.h>
#include <string.h>
#include <wchar.h>
#include <locale.h>
@J3698
J3698 / auto-bt-top-new.sh
Last active April 29, 2019 00:44
Version 2 of Top of auto-bt.sh
#!/usr/bin/env bash
amixer -c 0 cset numid=3
coproc stdbuf -oL bluetoothctl
sleep 5
sudo -u pi /usr/local/bin/jackd -dalsa -r44100 -p1024 -n2 &
sleep 10
sudo -u pi pulseaudio --start
@J3698
J3698 / auto-bt.sh
Last active April 29, 2019 00:57
New version of auto-bt.sh
#!/usr/bin/env bash
coproc stdbuf -oL bluetoothctl
sleep 5
sudo -u pi /usr/local/bin/jackd -dalsa -r44100 -p1024 -n2 &
sleep 10
sudo -u pi pulseaudio --start
echo "Started Jackd"
@J3698
J3698 / auto-bt-top-old.sh
Last active April 29, 2019 00:43
Old Version of Top of auto-bt.sh
#!/usr/bin/env bash
amixer -c 0 cset numid=3
coproc stdbuf -oL bluetoothctl
sleep 5
sudo -u pi pulseaudio --start
@J3698
J3698 / first_test.c
Last active March 2, 2019 01:19
First Program in Jack
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <jack/jack.h>
#include <jack/transport.h>