AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01

这篇具有很好参考价值的文章主要介绍了AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01

前言

  • 本系列系列目录放在文尾;
  • 本系列是AI作曲的基础,暂时和AI关系不大,但尤为重要;
  • 借助FoxDot,从文档分析开始,然后进入源码分析环节;
  • 暂未发现官方中文版,实践顺带翻译,会根据需要不定期校对及更新,欢迎催更~

正文

教程来源

FoxDot官方主页在此:https://foxdot.org/
FoxDot官方教程在此:https://foxdot.org/tutorials/
注:上面网址内的教程,在FoxDot软件内有~
AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01

Tutorial 0: Introduction

# Tutorial 0: Introduction

################
# Executing code

# To execute code in FoxDot, make sure your text cursor is in the 'block' of code
# (sections of text not separated by blank lines) and press Ctrl+Return

# To execute just a single line, even in a block, press Alt+Return

# Try it now, move the cursor to the line of code below and press Ctrl+Return

print("Hello World")

##############
# Help

# If you're ever stuck, or want to know more about a function or class
# just type help followed by the name of that Python object in brackets:

help(object)

AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01

Tutorial 1: Playing Notes

# Tutorial 1: Playing Notes

# In FoxDot, all two-character variable names are reserved for player objects, such as 'p1'
# Creating a Player Object with no arguments will play a single note on middle C, by default, repeatedly until stopped.
# Use >> to give one of these to a player object like so:

p1 >> pluck()

# To stop an individual player object, simply execute

p1.stop()

# Besides the 2-character variables that are pre-reserved, you can create your
# own with your own names

foo = Player()
foo >> pluck()

# The >> in Python is usually reserved for a type of operation, like + or -, but it is not the case in FoxDot.
# If a user re-executes the code, FoxDot will update p1 instead of creating a PlayerObject,
# which means you can make changes to your music using just one line of code.

# If you now give your player object some arguments, you can change the notes being played back.
# The first argument should be the degree of the note to be played
# (default is the lowest note of octave 5 of the major scale) and does not need to be specified by name.

# Python, like most programming languages, using zero-indexing when accessing values in an array,
# which means that 0 refers to the first note of the scale.
# Give your player object instructions to make music with their Synth.
# The first argument is the note of the scale to play. The following code
# plays the first three notes of the default scale (major) on repeat.

# For a single note
p1 >> pluck(0)

# Or a list of notes
p1 >> pluck([0,1,2])

# But you’ll need to specify whatever else you want to change...

# Such as note durations, or the length of each note
p1 >> pluck([0,0,0], dur=[1,2,3])

# Or amplitude, the "volume" of each note
p1 >> pluck([0,0,0], amp=[1,2,3])

# If the second list, the amp in this example, is too long, then the first list (the degree) just loops, and are matched with the remaining elements from the second list (the amplitude).
p1 >> pluck([0,2,4], amp=[1,2,3,1,5])

# More generally, all the lists are traversed regardless of their length.
p1 >> pluck([0,2,4], dur=[1,2], amp=[1,2,3,1,5])

# Arguments can be integers, floating points, fractions, lists,
# tuples, or a mix

p1 >> pluck([0,0,0], dur=2)

p1 >> pluck([0,0,0], dur=1.743)

p1 >> pluck([0,0,0], dur=[0.25,0.5,0.75])

p1 >> pluck([0,0,0], dur=[1/4,1/2,3/4])

p1 >> pluck([0,0,0], dur=[1/4,0.25,3])

# Lists of values are iterated over as the Player plays notes
# The following duration equates to:  1,2,3,1,4,3
# If you don't understand this yet, don't worry, more about patterns in the pattern tutorial
p1 >> pluck([0,0,0], dur=[1,[2,4],3])

# Values in tuples are used simultaneously i.e. p1 will play 3 individual notes, then a chord of 3 together at the same time.
p1 >> pluck([0,2,4,(0,2,4)])

# You can also assign values to the attributes of player objects directly
p1.oct = 5

# To see all the names of player attributes, just execute
print(Player.get_attributes())

# More about those later in the player attributes tutorial

# You could store several player instances and assign them at different times
proxy_1 = pads([0,1,2,3], dur=1/2)
proxy_2 = pads([4,5,6,7], dur=1)

p1 >> proxy_1 # Assign the first to p1

p1 >> proxy_2 # This replaces the instructions being followed by p1

# To play multiple sequences at once, just do the same things with another
# Player object:

p1 >> pluck([0, 2, 3, 4], dur=1/2)

p2 >> pads([(0, 2, 4), (3, 5, 7)], dur=8)

# Play only this player, muting others
p1.solo() # default value is 1 (solo on)

# And turn the solo off
p1.solo(0)

# Stop (not just mute) the other players
p1.only()

# Use Ctrl+. to clear everything for the scheduling clock or run
Clock.clear()

AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01

系列目录

AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01【本文】
以下【建设中】
AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程02文章来源地址https://www.toymoban.com/news/detail-500035.html

到了这里,关于AI作曲基础-Python编程作曲软件篇-FoxDot文档及源码分析-官方教程01的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • AI+软件工程:10倍提效!用ChatGPT编写系统功能文档

    系统功能文档是一种描述软件系统功能和操作方式的文档。它让开发团队、测试人员、项目管理者、客户和最终用户对系统行为有清晰、全面的了解。 通过ChatGPT,我们能让编写系统功能文档的效率提升10倍以上。 我们以线上商城系统为例,介绍如何使用ChatGPT帮我们完成系统

    2024年03月25日
    浏览(50)
  • 全面掌握软件开发与设计:从文档编写到AI绘画与图标设计(大纲)

    引言 介绍软件开发与设计的多面性 强调文档编写、AI绘画、Markdown、GitHub和图标设计的重要性 在当今快速发展的技术时代,软件开发与设计不仅是技术实现的过程,更是艺术与科学的结合。从项目文档的编写到AI绘画的创新应用,再到UI界面中图标设计的精妙,每一个环节都

    2024年04月15日
    浏览(27)
  • AI创作系统ChatGPT网站源码+搭建部署教程文档,AI绘画,支持TSS GPT语音对话功能

    SparkAi创作系统是基于ChatGPT进行开发的Ai智能问答系统和Midjourney绘画系统,支持OpenAI-GPT全模型+国内AI全模型。本期针对源码系统整体测试下来非常完美,可以说SparkAi是目前国内一款的ChatGPT对接OpenAI软件系统。那么如何搭建部署AI创作ChatGPT?小编这里写一个详细图文教程吧!

    2024年02月04日
    浏览(48)
  • AiDD AI+软件研发数字峰会开启编程新纪元

    随着OpenAI 推出全新的对话式通用人工智能工具——ChatGPT火爆出圈后,人工智能再次受到了工业界、学术界的广泛关注,并被认为向通用人工智能迈出了坚实的一步,在众多行业、领域有着广泛的应用潜力,甚至会颠覆很多领域和行业,特别是软件研发领域,因此它必然会引

    2023年04月14日
    浏览(36)
  • python手机编程软件 苹果,用手机编程python的软件

    这篇文章主要介绍了python手机编程软件下载官方,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获,下面让小编带着大家一起了解一下。 Source code download: 本文相关源码 安装完成后,打开这个软件,就可以直接编写C/C++代码了,如下,代码高

    2024年03月11日
    浏览(33)
  • 手机版python编程软件下载,手机python编程软件

    软件介绍: python是一款面向对象、解释型、动态数据类型的高级编程设计语言。它拥有语言上的简洁性、可读性和易维护性,在图形处理、数学处理、文本处理、系统编程、数据库编程等领域都被广泛应用。 所需工具: 安装教程 1、下载好安装包,双击运行“python-3.6.2-amd

    2024年02月09日
    浏览(35)
  • 手机python编程软件怎么用,手机python编程软件下载

    大家好,小编来为大家解答以下问题,手机python编程软件保存的代码在哪里,手机python编程软件怎么运行,现在让我们一起来看看吧!   原标题:盘点几个在手机上可以用来学习编程的软件 前天在悟空问答的时候,很荣幸被邀请参加回答“在手机上可以用来学习编程的软件

    2024年02月14日
    浏览(35)
  • 手机python编程软件哪个好,手机python编程软件app

    大家好,小编来为大家解答以下问题,手机python编程软件哪个好,手机版python编程软件下载,现在让我们一起来看看吧!   软件介绍: python是一款面向对象、解释型、动态数据类型的高级编程设计语言。它拥有语言上的简洁性、可读性和易维护性,在图形处理、数学处理、

    2024年01月25日
    浏览(37)
  • python编程手机软件哪个好,用手机编程python的软件

    大家好,本文将围绕python编程手机软件哪个好展开说明,用手机编程python的软件是一个很多人都想弄明白的事情,想搞清楚python手机编程软件下载需要先了解以下几个事情。 常用的python库有哪些 10个顶级且实用的python库1、DashDash是比较新的软件包,它是用纯python构建数据可视

    2024年01月25日
    浏览(32)
  • [bat]0基础实现自动化办公-基于start实现一键打开常用软件/文档

    每次开机时,都要一个个打开常用软件,比如微信、QQ或是word文档、excel表格等程序,比较费时。 使用bat脚本中的start方法,通过将需要打开的程序或文件写入到bat脚本中,运行bat脚本从而实现一键批量打开常用软件。 通过前文已实现了新建一个可运行的bat脚本,现在我们只

    2024年01月19日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包