iOS 0.6.0: milestone 5 (recording, MIDI, input bindings, themes, bundles, backups)
- Master recording (MasterSink ring + writer thread) and the sample recorder - CoreMIDI in/out: sound module, clock send/follow, virtual "Sizzle" ports; platform-free parser/module/clock in core (midi_test) - Hardware keyboard and gamepads via GameController; rebindable keyboard, gamepad and MIDI CC actions; per-parameter MIDI learn - Colour themes (.szt), project bundles (.szgz), backup & restore; ZIP in core with zlib (zip_test against jar and unzip) - Persistent app settings; audio pauses in the background unless sound module Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
435305e42a
commit
64e21e0bcc
@@ -63,9 +63,11 @@ final class TrackerState: ObservableObject {
|
||||
|
||||
// MARK: edits (Android: punchNote / noteOffFocused / deleteAndAdvance / …)
|
||||
|
||||
func punchNote(_ app: AppModel, _ midi: Int) {
|
||||
let cell = SizzleCell(note: Int32(min(max(midi, 0), 127)), velocity: Int32(min(max(app.kbdVelocity, 0), 127)),
|
||||
channel: Int32(app.kbdChannel))
|
||||
/// Velocity and channel default to the on-screen keyboard's; MIDI punch-in
|
||||
/// passes the incoming note's own, so the cell plays back as it was played.
|
||||
func punchNote(_ app: AppModel, _ midi: Int, velocity: Int? = nil, channel: Int? = nil) {
|
||||
let cell = SizzleCell(note: Int32(min(max(midi, 0), 127)), velocity: Int32(min(max(velocity ?? app.kbdVelocity, 0), 127)),
|
||||
channel: Int32(channel ?? app.kbdChannel))
|
||||
session.setCell(cell, inPattern: session.activePattern, track: app.cursorTrack, line: app.cursorLine)
|
||||
moveCursorWrap(app, skipStep)
|
||||
}
|
||||
@@ -254,6 +256,14 @@ final class TrackerHeldNotes: ObservableObject {
|
||||
SizzleSession.shared.noteOff(midi, midiChannel: channels[midi] ?? app.kbdChannel)
|
||||
}
|
||||
|
||||
/// Light or unlight a key without sounding it (hardware keys, MIDI in: the
|
||||
/// input layer plays those itself).
|
||||
func mark(_ midi: Int, on: Bool) {
|
||||
if on { counts[midi, default: 0] += 1; return }
|
||||
let n = (counts[midi] ?? 0) - 1
|
||||
if n <= 0 { counts[midi] = nil } else { counts[midi] = n }
|
||||
}
|
||||
|
||||
/// Release everything (the keyboard went away mid-press).
|
||||
func releaseAll() {
|
||||
for (midi, ch) in channels where (counts[midi] ?? 0) > 0 { SizzleSession.shared.noteOff(midi, midiChannel: ch) }
|
||||
|
||||
@@ -6,16 +6,16 @@ import SwiftUI
|
||||
/// The Android "Amber CRT" palette slots the shared Theme doesn't have (beat/bar
|
||||
/// row tints, the playhead green, the danger red), plus Theme's own for brevity.
|
||||
enum TK {
|
||||
static let background = Theme.background
|
||||
static let surface = Theme.surface
|
||||
static let grid = Theme.grid
|
||||
static let text = Theme.text
|
||||
static let dim = Theme.dim
|
||||
static let accent = Theme.accent
|
||||
static let beat = Color(red: 0x14 / 255, green: 0x1C / 255, blue: 0x1A / 255)
|
||||
static let bar = Color(red: 0x1E / 255, green: 0x2A / 255, blue: 0x20 / 255)
|
||||
static let playhead = Color(red: 0x7C / 255, green: 0xFC / 255, blue: 0x9A / 255)
|
||||
static let danger = Color(red: 0xE0 / 255, green: 0x5A / 255, blue: 0x4B / 255)
|
||||
static var background: Color { Theme.background }
|
||||
static var surface: Color { Theme.surface }
|
||||
static var grid: Color { Theme.grid }
|
||||
static var text: Color { Theme.text }
|
||||
static var dim: Color { Theme.dim }
|
||||
static var accent: Color { Theme.accent }
|
||||
static var beat: Color { Theme.beat }
|
||||
static var bar: Color { Theme.bar }
|
||||
static var playhead: Color { Theme.playhead }
|
||||
static var danger: Color { Theme.danger }
|
||||
|
||||
/// Pitch.name: 60 → "C-4", 61 → "C#4" (MIDI 12 == C0).
|
||||
static let noteNames: [String] = (0..<128).map { m in
|
||||
|
||||
Reference in New Issue
Block a user