# AIComposer
## How to compile and run the preexisting data file:
1. Press the Build and Run button in the upper left-hand corner to start the application up.
2. Under 'File' select 'Open...'.
3. Open "ResultsDataSet.aicomp" located in the projects folder.
4. To listen to the playback of a preexisting composition, select it in the table and click 'Play'.
5. To compose a new piece, enter a number of Genes (20-60 work best) and generations (300-500 work best, BUT take a really long time)
* Click "COMPOSE".
* The field will display information as it runs the algorithm.
Note:
'Compose' will not work in a new file because it requires MIDI files formatted in a specific way as input for both Melodic and Chord Progressions.
## Controller Classes
* `CompositionController.swift`: this contains all of the functions involved with creating music.
* Two genetic algorithms are implemented:
* Main theme creation genetic algorithm
* Composition creation genetic algorithm
* Also contains methods to generate instrument presets and random names.
* Has `struct` definitions for `DesiredResults` and `CompositionWeights`
## The Music object structure
* `MusicComposition`: an complete piece of music with 4 instruments.
* `[MusicPart]`: an array consisting of the four instrument melodies
* `[MusicMeasure]`: an array of all of the measures in that instrument's part.
* `[MusicNote]`: an array of all of the individual notes in each measure.
* `MusicTimeStamp`: a `Double` representing where in the music sequence the note starts. (1.0 is the length of a quarter note)
* `MIDINoteMessage`: the actual MIDI message for the note.
* `channel: UInt8`: the MIDI channel number. (0-16)
* `note: UInt8`: the MIDI note number. (0-127)
* `velocity: UInt8`: the velocity (loudness) of the note. (0-127)
* `releaseVelocity: UInt8`: The velocity after the note is released. Always set to 0.
* `duration: Float32`: The length of the note in a MIDI sequence.
没有合适的资源?快使用搜索试试~ 我知道了~
AIComposer使用遗传算法和 MIDI 文件输入来 创作音乐_Swift_代码_下载
共34个文件
swift:18个
plist:3个
xib:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 82 浏览量
2022-06-16
21:20:47
上传
评论
收藏 30.83MB ZIP 举报
温馨提示
如何编译和运行预先存在的数据文件: 按左上角的 Build and Run 按钮启动应用程序。 在“文件”下选择“打开...”。 打开位于项目文件夹中的“ResultsDataSet.aicomp”。 要收听预先存在的乐曲的播放,请在表中选择它并单击“播放”。 要创作一部新作品,请输入多个基因(20-60 最好)和世代(300-500 最好,但需要很长时间) 单击“撰写”。 该字段将在运行算法时显示信息。 笔记: “Compose”在新文件中不起作用,因为它需要以特定方式格式化的 MIDI 文件作为旋律和和弦进行的输入。 控制器类 CompositionController.swift:这包含与创建音乐有关的所有功能。 实现了两种遗传算法: 主旋律创作遗传算法 作曲创作遗传算法 还包含生成仪器预设和随机名称的方法。 具有和struct的定义DesiredResultsCompositionWeights 音乐对象结构 MusicComposition:一首完整的音乐,有 4 种乐器。 [MusicPart]:由四个乐器旋律组成的数组 [MusicMeasure]:该乐器部分中所有度
资源推荐
资源详情
资源评论
收起资源包目录
AIComposer-master.zip (34个子文件)
AIComposer-master
32MbGMStereo.sf2 30.96MB
README.md 2KB
AIComposer.xcodeproj
project.xcworkspace
contents.xcworkspacedata 155B
project.pbxproj 28KB
xcuserdata
jesshendricks.xcuserdatad
xcschemes
AIComposer.xcscheme 4KB
xcschememanagement.plist 572B
xcdebugger
Breakpoints_v2.xcbkptlist 3KB
AIComposerTests
AIComposerTests.swift 30KB
Info.plist 733B
Melody-Bach.mid 2KB
AIComposer
MusicSnippet.swift 31KB
AppDelegate.swift 512B
README.md 2KB
ChordController.swift 20KB
Document.swift 14KB
MusicPart.swift 6KB
MusicSnippetCellView.swift 519B
MusicComposition.swift 10KB
Base.lproj
MainMenu.xib 13KB
Document.xib 70KB
Assets.xcassets
AppIcon.appiconset
Contents.json 903B
MusicNote.swift 9KB
ChordProgressionCellView.swift 481B
MusicMeasure.swift 5KB
Info.plist 2KB
MusicChordProgression.swift 3KB
MusicDataSet.swift 13KB
ComposerController.swift 49KB
CompositionFileCellView.swift 520B
MIDIManager.swift 9KB
MIDIDrawView.swift 3KB
ClassExtensions.swift 863B
words 2.38MB
ResultsDataSet.aicomp 4.9MB
共 34 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功