-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀️ Merge branch 'hugo/feature/Add-MusicColorPad' into develop
- Loading branch information
Showing
10 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
...tent/activities/standalones/color_music_pad-8439D1EE7DD846ACB048145089F34C33.activity.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Leka - iOS Monorepo | ||
# Copyright APF France handicap | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
version: 1.0.0 | ||
uuid: 8439D1EE7DD846ACB048145089F34C33 | ||
name: color_music_pad | ||
|
||
created_at: "2024-12-06T11:17:39.636246" | ||
last_edited_at: "2024-12-06T11:17:39.636246" | ||
status: published | ||
|
||
authors: | ||
- leka | ||
|
||
skills: | ||
- relationship_tablet_robot | ||
- sensory_integration/vision | ||
- sensory_integration/hearing | ||
- sensory_integration | ||
|
||
tags: | ||
- colors | ||
- music | ||
- standalone_activity | ||
- robot_colors | ||
- sensory_stimulation | ||
|
||
hmi: | ||
- tablet_robot | ||
|
||
types: | ||
- one_on_one | ||
|
||
locales: | ||
- en_US | ||
- fr_FR | ||
|
||
l10n: | ||
- locale: fr_FR | ||
details: | ||
icon: color_music_pad | ||
|
||
title: Pavé musical coloré | ||
subtitle: null | ||
|
||
short_description: | | ||
Jouer de la musique avec Leka sur des larges touches colorées. | ||
description: | | ||
Lorem Ipsum | ||
instructions: | | ||
Lorem Ipsum | ||
- locale: en_US | ||
details: | ||
icon: color_music_pad | ||
|
||
title: Color Music Pad | ||
subtitle: null | ||
|
||
short_description: | | ||
Play music with Leka on large colored keys. | ||
description: | | ||
Lorem Ipsum | ||
instructions: | | ||
Lorem Ipsum | ||
exercises_payload: | ||
options: | ||
shuffle_exercises: false | ||
shuffle_groups: false | ||
|
||
exercise_groups: | ||
- group: | ||
- interface: colorMusicPad |
3 changes: 3 additions & 0 deletions
3
...esources/Content/activities/standalones/icons/color_music_pad.activity.icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,6 @@ public extension Exercise { | |
case melody | ||
case pairing | ||
case memory | ||
case colorMusicPad | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
...s/GameEngineKit/Sources/OldSystem/Exercises/Specialized/ColorMusicPad/ColorMusicPad.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import AudioKit | ||
import DesignKit | ||
import RobotKit | ||
import SwiftUI | ||
|
||
struct ColorMusicPad: View { | ||
// MARK: Internal | ||
|
||
@StateObject var midiPlayer: MIDIPlayer = .init(instrument: MIDIInstrument.xylophone) | ||
|
||
var body: some View { | ||
LazyVGrid(columns: self.columns, spacing: self.kHorizontalSpacing) { | ||
ForEach(0..<10) { index in | ||
Rectangle() | ||
.fill(self.colors[index].screen) | ||
.onTapGesture { | ||
Robot.shared.shine(.all(in: self.colors[index])) | ||
self.midiPlayer.noteOn(number: self.scale.notes[index]) | ||
} | ||
.frame(width: self.kTileWidth, height: self.kTileHeight) | ||
} | ||
} | ||
} | ||
|
||
// MARK: Private | ||
|
||
private let scale: MIDIScale = .majorPentatonicDoubleOctave | ||
private let colors: [Robot.Color] = [.lightPink, .red, .orange, .yellow, .green, .mint, .lightBlue, .blue, .purple, .pink] | ||
private let columns = Array(repeating: GridItem(), count: 5) | ||
private let kHorizontalSpacing: CGFloat = 0 | ||
private let kTileWidth: CGFloat = 220 | ||
private let kTileHeight: CGFloat = 600 | ||
} | ||
|
||
#Preview { | ||
ColorMusicPad() | ||
} |
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
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
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
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