# LoopWithMe
## Table of Contents
1. [Overview](#Overview)
1. [Product Spec](#Product-Spec)
1. [Wireframes](#Wireframes)
2. [Schema](#Schema)
## Overview
### Description
A social looping app for music artists. Artists can collaborate with other artists on making beats/loops. Gives anyone in possession of a smartphone a musical voice and the ability to collaborate with great musicians.
### App Evaluation
- **Category:** Social Media / Music
- **Mobile:** Website supports uploading of local audio files, recording through device microphone, audio playback through connected audio device.
- **Story:** Allows an artist to post an audio loop, which can be viewed by anybody on the app. Anyone can record an additional layer on top of the original loop and post it; this automatically tags the author(s) of the original loop.
- **Market:** Appeals to people who spontaneously came up with a cool musical idea and want to share it with other people. Additionally, people just looking to hear other people's music can browse the loop feed and potentially contribute to it.
- **Habit:** Artists can post whenever they want throughout the day by singing or recording something into their microphones. Artists can also browse the feed looking to contribute to something or simply listen what the most popular artists have recorded.
- **Scope:** Includes audio mixing, instant messaging, potentially integration of local files.
## Product Spec
### 1. User Stories (Required and Optional)
**Required Must-have Stories**
<!-- *Create new loop, specify loop settings*
* Artist can set looping collaboration mode to public (anybody can add to it), friends-only (only friends can loop on top of it), or private (only artist can loop on top).
* When recording a new loop, the artist can name the loop. The artist can set the recording mode to either tempo-assist mode or free view. For tempo-assist mode, the artist is able to select the tempo of the loop (between 60 and 240bpm), time signature (either 3/4 or 4/4), and set the loop length with a bar count (between 2-8 bars). The artist can also toggle a metronome to visual-only (to avoid bleed-in when recording without headphones), audio-visual mode (for recording with headphones), or off.
* Additionally, the artist can opt out of using tempo-assist mode and instead record in free-mode.
* The artist can tap a recording button to segue into the recording screen.
*Recording using device microphone*
* If the recording mode is tempo assist, then the onscreen metronome would assist the artist in the recording process. In addition to the metronome, a current-bar indicator would tell the artist how much looping time has elapsed and how much time do they have left. Recording will stop automatically.
* If the recording mode is free:
* If this is a the first loop, then the artist will be shown a waveform transcription of what they are recording into the microphone. Recording will stop when the artist taps record button again. Note that the first layer of the loop sets the loop length for all layers added on top of it.
* If this is a reloop, then the artist will be shown a time indicator (similar to a youtube playback slider). Recording will stop auiomatically once the loop length elapses.
* Once the recording is done, the artist can either tap a 'redo recording' button or a 'Done' button. If the artist presses the redo recording, then they are segued back into the New Loop Screen. If the artist presses the 'Done' button, then the view segues into the loop stack screen of the loop.
*Loop Stack View*
* A loop with *n* layers is called 'loopname' mix *n*. For every such loop, there are "different" loops with less layers that you can access from the loop stack scene. For example, from the loop stack view of a loop of 5 layers ('name of loop mix 5'), you can access the same loop but with 4 layers ('name of loop mix 4)', with 3 layers, with 2, with 1.
* In this view, the artist is presented with a inverted vertical stack consisting of all the layers of a loop. Each layer displays the artist who recorded it. The player can listen to the loop as a whole or play individual layers. The artist can press an 'Add layer' button to record another layer to the loop, which would segue into the recording screen.
* The artist can tap anywhere other than the play button on a loop layer to go a different loop that consists of the loop mix until that layer. For example, on a loop stack view of 'funkybeat mix 5', the artist can tap on layer 3 to go to the loop stack view of 'funkybeat mix 3'.
*Home feed*
* The artist is presented with a table view consisting of loops of friends. Each loop displays the loop name, mix number, and the list of all loop artsist. The artist can play any loop, and they can also tap on anyone of a loop's authors to go to their profile page. Moreover, the artist can tap anywhere else on the table view cell to go to the loop's stack screen.
* Artists can reshare other people's loops, which will show up on their friends' home feed.
*Artist profiles*
* Contains information of a artist: username, number of loops included in, friends. Includes a "favorite loops" table view —the contents of which are selected by the artist— and an "all loops" table view. All loop can be tapped on to go to their respective stack screen.
*Messaging*
* Artists can message friends; they can also share loops and request contributions from friends.
-->
* Users can create create an account with username, password, and given name.
* Users can login with their username.
* Users can record a short audio track (limit: 25s) using the device microphone and share it with friends.
* (Ambiguous) Users can record with a tempo asist mode that will ensure that all tracks in a loop are rhythmically aligned
* In tempo assist mode, users can specify time signature (3/4 or 4/4), bar count (2-8 bars) and tempo (80bpm-200bpm)
* Users can record without a any tempo guidance in free mode.
* Users can see a waveform transcription of what they are recording in free mode.
* Users can make a loop consisting of up to 5 audio tracks of the same length that play simultaneously.
* Users can add a name and caption to their loop.
* (Ambiguous) Users can share loops with their friends, and listen to their friend's loop through a loop feed.
* Users can add their own audio tracks to friends' loops and post this new mix with additional tracks, which automatically tags the OP.*
* Users can listen to individual audio tracks of each loop and go to the profile page of the author of each audio track.
* Users can look at friends'/their own profiles, which features all of their loops.
**Optional Nice-to-have Stories**
* Users can search for loops by their names
* Users can dm their friends and request them to be collaborators on a loop.
* Users are able to save their favorite loops to a 'saved loops' screen
* Users are able to import short audio files and use them as audio tracks for loops, with the functionality to trim the audio to conform to the loop length included in the app.
* Users are able to record using a virtual midi controller.
### 2. Screen Archetypes
* Login Screen and Sign up Screen
* Users can create create an account with username, password, and given name.
* Users can login with their username.
* New loop screen
* Users can record a short audio track (limit: 25s) using the device microphone and share it with friends.
* In tempo assist mode, users can specify time signature (3/4 or 4/4), bar count (2-8 bars) and tempo (80bpm-200bpm)
* Users can record without a any tempo guidance in free mode.
* Recording screen
* Users can see a waveform transcription of what they are recording in free mode.
* Users can record with a tempo asist mode that, while recording, displays an metronome and a 'current-bar' indicator.
* (Optional) Users are able to record using a virtual midi controller.
* (Optional) Users are able to import short audio files and use them as audio tracks for loops, with the functionality to trim the audio to conform to the loop length included in the app
* Share screen
* Users can share loops
* Users can add their own audio tracks to friends' loops and post this new mix with additional tracks, which automatically tags the OP.
* Loop Stack screen
* Users can make a loop consisting of up to 5 audio tracks of the same length that play simultaneously.
* Users can add their own audio tracks to friends' loops and post this new mix with additional tracks, which automatically tags the OP.
* Loop Feed
* Users can listen to friends' loops through a loop feed.
* Profile Screen
* Users can look at friends'/their own profiles, which features all of their loops.
* (Optional) All Conversations screen
* Users can dm their friends and request them to be collaborators on a loop.
* (Optional) Search Loops screen
* Users can search for loops by their names
* (Optional) Saved Loops screen
* Users are able to save their favorite loops to a 'saved loops' screen
### 3. Navigation
**Tab Navigation** (Tab to Screen)
* Home Feed
* New Loop
* Profile
**Flow Navigation** (Screen to Screen)
* Login Screen
* Sign up Screen
* Loop Feed
* Sign Up Screen
* Login Screen
* Loop Food
* New Loop
* Recording
* Recording
* Share screen
* Share screen
* Loop Stack
* Loop Feed
* Profile
* Loop Stack (loops featured on profile page)
* Profile (other users)
* Loop Feed
* Profile
* Loop Stack
* Loop Stack
* Recording (adding layer to loop)
* Profile (authors of individual layers)
## Wireframes

<!-- ### [BONUS] Digital Wireframes & Mockups -->
<!-- ### [BONUS] Interactive Prototype -->
## Schema
### Models
**Loop**
| Property | Type | Description |
|---|---|---|
|name | NSString | Name of Loop|
|trackList | NSArray of Tracks| Contains all audio tracks that comprise the full loop|
|caption | NSString | Caption of loop|
|parentLoop | Pointer to Loop | If loop is the first posted mix, this attribute is nil. Otherwise, points to the loop that was added to to create this Loop instance; AKA the previous posted mix|
| mixAuthor | Pointer to User | Author of this posted mix|
| tempoSettings | TempoAssistSttings | Nil if recorded in free mode, non_nil if recorded on tempo assist|
**Track**
| Property | Type | Description |
|---|---|---|
|author| Pointer to User | Who recorded this track|
|audioFile | AVAudioFile | For single track playback |
**TempoAssistSettings**
| Property | Type | Description |
|---|---|---|
|tempo|int|Beats per minute|
|barCount|int|Number of bars long|
|ts|TimeSignature| time signture|
|audioMode|BOOL|False if metronome is set to silent|
**TimeSignature**
| Property | Type | Description |
|---|---|---|
|numerator|int|"Numerator" of time signature|
|denominator|int|"Denominator" of time signature|
**PFUser**
Include additional properties:
| Property | Type | Description|
|---|---|---|
|profileImage | PFFileObject | Profile Picture Image |
|friends | NSArray of Users | List of friends |
### Networking
**Network requests by screen**
* Loop Feed Screen
* (READ) Query latest posts where author is in current user's friends list
* Share screen
* (CREATE) Create a new loop object
* Profile screen
* (READ) Query either logged in user object or other user who's profile has been tapped on
* (READ) Query posts by profile's user
* (UPDATE) Update user profile image
## Ambiguous Problems
### Rhythm when looping
* When adding layers to a loop, it's hard to lock in those muscial layers to the rhythm. Without some sort of time-keeping tool, mantaining a rhythmic feel in loops across tracks can be impractical.
* The proposed solution to this is to have a tempo-assist mode, where you can toggle a metronome and record with it. You can specify tempo, number of measures (which designates the loop length), and time signature (either 3/4 or 4/4) to allow for rhythmic variety.
### Friending flow
* The loops displayed on the home feed are loops posted by friends. A friending flow built in to the app requires managing a graph of user objects and searching for potential friends.
* The proposed solution to this is use the Facebook SDK's friending flow.
### Collaboration
* The primary purpose of the app is to allow for collaboration between musicians on short projects. Of course, we need some system to manage access to the same loop objects.
* The proposed solution to this is to give users the ability to reloop; that is, to edit someone else's posted loop and posting as their own while at the same time tagging the original author.