Skip to content

Instantly share code, notes, and snippets.

import os
import re
import matplotlib.pyplot as plt
from tqdm import tqdm
import pretty_midi
from basic_pitch.inference import predict_and_save, predict
from basic_pitch import ICASSP_2022_MODEL_PATH
from mido import MidiFile, MetaMessage, bpm2tempo
import subprocess
import librosa
@twobob
twobob / midi_signaller.py
Created September 21, 2024 09:01
spilts audio into stems - extracts the midi from the stems , saves them, merges them into one midi per song and saves that as well
import os
import re
import matplotlib.pyplot as plt
from tqdm import tqdm
import pretty_midi
from basic_pitch.inference import predict_and_save, predict
from basic_pitch import ICASSP_2022_MODEL_PATH
from mido import MidiFile, MetaMessage, bpm2tempo
import demucs.separate
import shlex
@twobob
twobob / midoed.py
Created September 20, 2024 19:48
basic_pitch mido and pretty midi attempt to figure out multiple layered midi
import os
import re
import matplotlib.pyplot as plt
from tqdm import tqdm
import pretty_midi
from basic_pitch.inference import predict_and_save
from basic_pitch import ICASSP_2022_MODEL_PATH
from mido import MidiFile, MetaMessage, bpm2tempo
# Set this flag to True if you want to reprocess all files, even if MIDI files already exist
@twobob
twobob / pitchIt.py
Last active September 20, 2024 15:16
vauge midi like preprocessing
import librosa
import numpy as np
from mido import Message, MidiFile, MidiTrack, MetaMessage, bpm2tempo
import pretty_midi
import matplotlib.pyplot as plt
import os
import re
# Set this flag to True if you want to reprocess all files, even if MIDI files already exist
REPROCESS_ALL = False
@twobob
twobob / fluxy.py
Last active August 8, 2024 04:47
nod to Vvan gemert
# First, in your terminal.
#
# $ python3 -m virtualenv env
# $ source env/bin/activate
# $ pip install torch torchvision transformers sentencepiece protobuf accelerate
# $ pip install git+https://github.com/huggingface/diffusers.git
# $ pip install [email protected]
# $ pip install gradio
@twobob
twobob / pinball.zig
Created July 12, 2024 13:56
pinball.zig a not at all tested wasmmodule
const std = @import("std");
const physics = @import("physics");
const Ball = physics.Ball;
const Surface = physics.Surface;
const Allocator = std.mem.Allocator;
const Pos2 = physics.Pos2;
const Vec2 = physics.Vec2;
const num_flippers = 2;
const num_bumpers = 3;
@twobob
twobob / controller.py
Created June 17, 2024 13:06
pygame xbox360 controller minimum test
import pygame
import sys
# Initialize pygame
pygame.init()
# Set up the display
width, height = 800, 600
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Xbox 360 Controller Test")
@twobob
twobob / 860s.py
Last active April 27, 2024 13:58
860s
import os
import torchaudio
import string
import time
from audiocraft.models import MusicGen
from audiocraft.data.audio import audio_write
from datetime import datetime
import demucs.separate
import shlex
# Start timing the operation
@twobob
twobob / merger.py
Created April 16, 2024 21:42
merge gif and wav into mp4 with a ui via python and ffmpeg
import tkinter as tk
from tkinter import filedialog, messagebox
import subprocess
import os
def browse_file(entry, file_type):
if file_type == 'audio':
filename = filedialog.askopenfilename(filetypes=[("Audio files", "*.wav")])
elif file_type == 'gif':
filename = filedialog.askopenfilename(filetypes=[("GIF files", "*.gif")])

The MAMBA (Multi-Array Memory-Based Architecture) architecture is an innovative approach in the field of large language models (LLMs). It introduces a new model block inspired by structured state space models (SSMs) and Transformer models, focusing on efficient hardware acceleration and fast inference speeds. Here's a detailed technical overview of how MAMBA works:

  • Selective State Space Models (SSMs): MAMBA utilizes selective SSMs to compress and selectively remember information in long sequences. This approach contrasts with attention mechanisms in traditional models, which do not compress context and can be computationally expensive.

Selective State Space Models (SSMs) enhance traditional state space approaches by integrating a unique selective mechanism that dynamically filters and retains information throughout a sequence. This mechanism works by evaluating each element of the sequence (like words in a text) and deciding whether to incorporate it into the model's current state based on its relevance t