This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Fractions; | |
using Melanchall.DryWetMidi.Composing; | |
using Melanchall.DryWetMidi.Core; | |
using Melanchall.DryWetMidi.Interaction; | |
using Melanchall.DryWetMidi.Multimedia; | |
using Melanchall.DryWetMidi.MusicTheory; | |
using Melanchall.DryWetMidi.Standards; | |
using Note = Melanchall.DryWetMidi.MusicTheory.Note; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
fn comptimeBytes(comptime name: []const u8, comptime instructions: []const u8) []const u8 {\ | |
// won't compile with ".section .bss\n" | |
asm volatile (".global " ++ name ++ ", " ++ name ++ "_end\njmp " ++ name ++ "_end\n" ++ name ++ ":\n" ++ instructions ++ "\n" ++ name ++ "_end:"); | |
const start = @extern(*const u8, .{ .name = name }); | |
const end = @extern(*const u8, .{ .name = name ++ "_end" }); | |
const size = @ptrToInt(end) - @ptrToInt(start); | |
var result: []const u8 = undefined; | |
result.ptr = @ptrCast([*]const u8, start); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
fn VisitorSet(comptime Argument: type, comptime Return: type, comptime types: anytype) type { | |
return struct { | |
const VisitorType = Visitor(Argument, Return, types); | |
const VisiteeType = Visitee(Argument, Return, types); | |
const VtableType = VisitorType.VtableType; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from struct import unpack | |
from argparse import ArgumentParser, FileType | |
# Info taken from https://fontforge.org/docs/techref/pcf-format.html | |
PCF_PROPERTIES = (1<<0) | |
PCF_ACCELERATORS = (1<<1) | |
PCF_METRICS = (1<<2) |