Inspiration
- The iPhone Duo's hinge is a physical input no phone has had before. We wanted closing the phone to mean something: two songs on two panels, and folding them shut mashes them together.
What it does
- SLAM puts one song on each panel of an iPhone Duo. As you fold, the two songs "brew": their colors bleed together, rings ripple from the crease, the records spin faster, a glass pane sweeps across, and each deck's cover reflects onto the other panel. Slam it shut and a bloom of their blended color fuses on the front screen, where the finished mashup appears and starts playing. A side control rail adds playful extras (shake, swap, save, freeze, scratch), and SLAM Pro unlocks chaining mashups.
How we built it
- App: SwiftUI with the iOS 27.1 iPhone Duo APIs:
onHingeChangefor the live angle,ArrangementViewand reserved regions for the two panels, and the vertical toolbar for the controls. Core Motion adds tilt, and every brewing visual is driven directly by the hinge angle. - Look: Liquid Glass materials, one Metal shader, and SwiftUI Canvas for the rings and effects.
- The slam, end to end: closing the phone calls the
direct-mashupSupabase Edge Function with both songs' metadata, their analyzed sections and the slam physics.- OpenAI as mashup director (
gpt-4.1-mini) replies with structured JSON: title, DJ notes, mix settings and a full DJ plan (sections, stem levels, vocal patterns, filters, drops and risers). The server still does the tempo and pitch math, and local fallback rules take over if OpenAI fails or takes longer than 8 seconds. - Render: Supabase hands the plan to a Python render worker, which builds the audio and uploads the MP3 back to Supabase Storage.
- Cover art: in parallel,
generate-artturns the mashup's art prompt into a 1024×1024 cover withgpt-image-1. - Realtime: the app watches the new mashup fill in (
render_status, thenaudio_urlandart_url) and plays it the moment it's ready.
- OpenAI as mashup director (
- Backend (Supabase): a Postgres database of
tracks(songs, previews, stems and analysis),pairsandmashups(settings, plan, audio and cover), plusget_lineagefor mashup family trees. Acatalogfunction serves songs with iTunes previews, and Storage holds public covers and mashup MP3s alongside private separated stems. Anyone can read; only the backend can write, and API keys and model names live only in secrets, never in code. - Sound and payments: AVAudioEngine for mashup playback, and RevenueCat for the Pro subscription.
- Tooling: built in Bitrig, testing on its iPhone Duo simulator. Challenges we ran into
- Restraint: our first collision effects (sparks, lightning, shaders) were chaotic, and we rebuilt them several times into something calm and premium.
- Following the hinge: the brewing visuals didn't truly track the angle at first because animations were smoothing over it; we made them a pure function of the angle.
- Simulator folds: the simulator jumps between fold positions instead of streaming angles, so we had to fill in the in-between states.
- The slam hand-off: keeping the moment of contact in sync as it moves from the inner panels to the front screen, without glitches.
- Invisible reflection: the cross-panel reflection existed but couldn't be seen, until we debugged it.
Accomplishments that we're proud of
- One design language: color blooms, the seam, rings and glass carry through every state, from open to brewing to slammed.
- The payoff: the slam lands as one continuous moment that ends in real music playing.
- Including a paywall with RevenueCat that looks like part of the app
What we learned
- Hinge as input: it's a new interaction model. It works best when visuals are tied directly to the fold, not triggered by states.
- Restraint over spectacle: fewer, well-integrated effects felt far more premium.
- Test the real signal: checking what the hardware or simulator actually sends saved us from guessing.
What's next for SLAM
- Deeper chaining: slamming mashups back into new tracks to grow whole mashup family trees.
- Streaming libraries: connecting to streaming services so any song in your library can go on a deck.
- Social slams: sharing mashups and their lineage, and slamming two friends' phones together to mash their picks.
- More Pro power: high-res export, private mashups and hold-to-cook deep synthesis for richer blends.
Built With
- ai
- mashup
- music
Log in or sign up for Devpost to join the conversation.