文档库 最新最全的文档下载
当前位置:文档库 › A wizard’s aid efficient music constraint programming with Oz

A wizard’s aid efficient music constraint programming with Oz

A wizard’s aid:

e?cient music constraint programming with Oz

Torsten Anders

Music,Mind and Machine,University of Nijmegen,The Netherlands

t.anders@nici.kun.nl

This article proposes an e?cient search strategy for con-straint based computer assisted composition.The strat-egy uses the propagate and distribute technique and al-ways proceeds in score-time,even if the rhythmic struc-ture of the score is not known before search.

1Introduction

Constraint programming has become increasingly popu-lar for computer assisted composition,because it allows the composer to generate a musical score by describing a desired result.However,he does not need to spec-ify,how to achieve this https://www.wendangku.net/doc/619416065.html,ing the constraint paradigm the composer can de?ne arbitrary relations between score parameters.The system then searches for one or more solutions.

Score parameters may be interrelated by constraints on di?erent aspects such as rhythmic rules,harmonic rules, voice leading rules etc.To?nd a solution ful?lling all constraints in an e?cient way,the search should pro-ceed in score-time,i.e.by completion of parallel score entities in parallel and not sequentially.However,if the search computes the rhythmic structure too,the search order cannot be determined before the search itself:the program can not guess in advance which score objects can be processed in parallel.

This article proposes a complete search strategy which uses the propagate and distribute technique and always proceeds in score-time,even if the rhythmic structure of the score is not known before search.The strategy is implemented in the Oz programming language[10,13, 6].

Plan of the paper:The section2presents some ex-amples of constraint programming packages for music composition and their respective search strategies.Con-straint programming capabilities of Oz are introduced in section3.Section4proposes an approach how to specialize this means for music composition.

2Music constraint programming Several working systems and theoretical studies apply constraint programming to various musical applications.The following section introduces a few systems for com-puter assisted composition.Special attention is paid to their respective search strategies.

Each program is integrated in a composition environ-ment.Environment editors can be used for inspecting and manipulating input and output.

2.1PWConstraints

PWConstraints[5]allows the user to freely declare constraints on the MIDI pitches of a given rhythmical score.Constraints are de?ned very concisely using a pattern matching language.PWConstraints exists as a library integrated in PatchWork[2].

The search engine of PWConstraints uses a back-tracking search over?nite domains of integers.Because of the prede?ned rhythmic structure,a search order pro-ceeding in score-time is established by the program be-fore search.Forward checking and heuristics(applied to the order of domains)can be used,while weighted constraints help to handle over-constraint problems.

In newer extended versions other note parameters can also be set,rhythmic values for instance.However,this program still requires a rhythmical input.1

2.2Arno

The environment Arno[1]extends Common Music [11]by the means of constraint programming.In Arno arbitrary parameters of Common Music elements can be declared nondeterministically using?nite domains of arbitrary values.Constraints–expressed as unary func-tions on a Common Music object–restrict the actual slot values of that object.To de?ne n-ary relations the score API of Common Music and its extensions sup-plied by Arno can be used.

Arno applies the search engine from Screamer[9],i.e. it uses backtracking search.Back jumping and heuristics can be applied.However,the performance of Arno de-grades for longer,non-monophonic examples.The pro-gram is developed to generate the rhythmic structure of polyphonic music too.It can therefore not guess in ad-vance,which events will be simultaneous in time.Hence 1Internally,search variables are still encoded as pitches.These may be converted to change the rhythmic structure.

the search does not proceed in

score-time but container-wise and performs redundant work.22.3

Adaptive search

A constraint extension for OpenMusic [2]based on an adaptive search is currently in development [12,3].The system performs a local improvement strategy which quickly computes approximate solutions.The user can observe the re?nement of the search and stop the process when the current solution is adequate.

Constraints,expressed in logical form,are automatically translated into cost functions to guide the search pro-gression.

Because adaptive search does not execute a complete search,constraints such as,e.g.,allDifferent ,3are hard to ful?l strictly by this strategy.However,all-Different is a very important constraint for composers.Therefore the system uses a forward checking technique instead of an adaptive search to solve this constraint.

3Constraint programming in Oz

The Oz programming language o?ers a rich set of pro-gramming paradigms combined in one simple model with a sound theoretical foundation [10,13].Supported paradigms include functional programming,logic and constraint programming,stateful programming,object-oriented programming,concurrency and distributed programming.4

The logic and constraint programming capabilities of Oz subsumes both search-based logic programming (don’t know nondeterminism)and concurrent logic program-ming (don’t care nondeterminism).The de?nition of a search problem and the de?nition of a search strategy are independent of each other in Oz (unlike as,e.g.,in Prolog ).The language o?ers high level means to program search strategies.

Oz has already been applied to music composition.The projects COMPOzE [4]and COPPELIA [14]realize automated composition.Both projects are restricted to four-voiced music.3.1

Propagate and distribute

The following subsection introduces how search-based constraint programming is done in Oz.It concentrates on ?nite domain constraints [8].5

2For

polyphonic music that can be reduced to monophonic music (e.g.canons)the performance is much better.3All elements are pairwise distinct.

4The Mozart system –an implementation and interactive de-velopment environment of the Oz programming language –is cross-platform compatible;implementations exists for UNIX (including.Linux and MacOS X)and MS Windows [6].Mozart is open and free software,it is published under a X11style license.

5A ?nite domain consists of non-negative integers in Oz,which can be mapped to arbitrary discrete data.

The constraint solver of Oz uses a technique called prop-agate and distribute .This name is based on the two in-ference rules of the method:constraint propagation and constraint distribution .

Computation with constraints takes place in a computa-tion space .The computation space contains a constraint store which stores a conjunction of basic constraints on logic variables.6A basic constraint of a ?nite domain problem takes either the form x =n (n being an integer or another variable)or x ∈D (D is a ?nite domain).Non-basic constraints (as “x

A distributor is a concurrent agent which waits until its hosting computation space S becomes stable (i.e.no further propagation is possible).It then creates two new computation spaces by executing a binary choice state-ment.The new spaces inherit all basic constraints and propagators of S .Additionally an arbitrary constraint C is added to one and its complement,?C ,to the other space.Adding these constraints does not change the so-lution.It may however restart propagation.The combi-nation of constraint propagation and distribution yields a complete solution method for ?nite domain constraint problems.

Distribution techniques di?er in what constraint is added to which variable.In Oz ,a few standard dis-tribution strategies exist.The user can also de?ne new strategies.The best (e.g.fastest)strategy depends on the problem.A typical distribution technique is ?rst fail :this strategy selects resprespectively removes the leftmost domain value of a variable with the smallest domain.

Distribution de?nes the shape of the search tree.This tree can be explored by di?erent search strategies to ?nd a single,several,all or the best solution,7according to some criterion.The search can also be interactively guided by tools as,e.g.,the Oz Explorer [7].

Propagation,complemented by distribution,has a bet-ter performance than a simple backtracking search.De-pending on task,this strategy also performs better than

6Logic

variables are single-assignment variables and bound by uni?cation as,e.g.,in Prolog.

7Best solution search uses a binary procedure.After ?nding a solution it constrains the next solution to be better than the previous according to that relation.

adaptive-search (see section

2.3).A constraint like allDifferent is hard to solve by means of a local search only.Constraint propagation is optimally suited to this task.

3.2All-interval series

The following subsection illustrates constraint propaga-tion and distribution by computing an all-interval se-ries.8The ?gure 1shows the full search tree for all solutions of length 4.Each tree node represents a new computation space,introduced by distribution.Solved spaces are drawn as diamonds 3,failed spaces as boxes 2and distributable spaces as circles ?.

Space Xs

Dxs

1[{0#3}...{0#3}][{1#3}{1#3}{1#3}]2[{0#3}...{0#3}][1{2,3}{2,3}]

3[{0#3}...{0#3}]

[{2,3}{1#3}{1#3}]4[{1,2}{1,2}{0,3}{0,3}][123]5[1203][123]6[2130][123]

Figure 1:all-interval series:search tree for all solutions

of length 4Only 17nodes are necessary to ?nd all 4solutions.The table below the tree shows the basic constraints on the elements of the solution series Xs and the intervals Dxs before their respective spaces get distributed.9

The constraints added by the ?rst fail distribution strat-egy are shown next to the tree arcs.The strategy always a?ects the leftmost variable with minimal domain size.In the ?rst space it creates a choice point by either bin-ding the ?rst element of Dxs to its ?rst domain value or removing this value.

After each distribution step propagators adjust the do-main of the other variables accordingly.In space 2the propagator constraining all intervals to be distinct remo-ves the determined interval 1from the other two interval domains.In space 4the propagator determines the third interval to be 3,which awakes the distance propagator to reduce the domain of last two series elements to {0,3}.This again reduces the domain of the ?rst two series ele-ments as well,because all elements are constrained to be di?erent.

8An

all-interval series consists of distinctive pitch classes and distinctive intervals between the pitches.For simplicity,the example avoids equal pitch distances instead of equal or com-plementary pitch intervals.

9The notation m #n is used for the ?nite domain m,...,n .

4A distribution strategy for a score

The following section proposes how a search for an ar-bitrary nested score can proceed in score time,even if

the rhythmic structure of the score is not known before-hand.The approach uses the ?nite domain constraint programming facilities of Oz.It de?nes a distribution strategy which always distributes the domain of an un-determined score element parameter with the smallest start time.

The search tree thus results in a dynamic search order.The most serious performance draw back of Arno is its na ¨?ve static search order (see section 2.2).The static search order is also the reason why PWConstraints invariably uses precomputed rhythmic scores (see sec-tion 2.1).4.1

The score distribution strategy

To ease the de?nition of new distribution techniques Oz o?ers special procedures to specify which constraint shall be added to which variable for distribution.Such procedure expects a speci?cation of a distribution strat-egy and an Oz vector containing all data to be dis-tributed.The distribution can be speci?ed by functional arguments.

For our purpose the variables to be distributed are the parameter values of score elements (durations,pitches etc.).We therefore use a parameter data structure con-taining both its value and a link to the element the pa-rameter belongs to.10That way we can estimate which undetermined parameter belongs to a score element with smallest start-time.

The distribution strategy is now described in terms of the functions given to the arguments ?lter ,order etc.of the Oz procedure FD.distribute .

Filter:Keep only parameters with an undetermined pa-rameter value (once ?ltered out parameters will never be considered for distribution again).Order:Find a parameter of which the start-time of the

related element can be or is determined (e.g.the duration of the predecessor element is known)and whose start-time is minimal.Prefer durations over all other element parameters.Select:Access the value variable of the parameter.Value:Select a domain value (e.g.the minimum value

of the domain).4.2

Discussion

The proposed approach constrains only the parameters of score elements (duration,pitch etc.).The formal structure of the score needs fully be determined,e.g.,

10Of

course the element (e.g.note)data structure also needs ac-cess to their parameters,i.e.bidirectional links are used.

the number of notes in a voice needs to be known before search.11

Naturally,constraints can only be propagated between parameter values which are already know to be related. If,e.g.,a harmonic relation constrains pitches of notes simultaneous in score-time,propagation can not be per-formed before these notes are known to be simultane-ous.12Therefore durations need to be determined?rst. Constraints relating duration parameters with other pa-rameters can thus not always be propagated but may be satis?ed by distribution.Constraints between parame-ters whose element relations are known(e.g.elements of a voice,or elements already known to be simultaneous) can freely propagate.

A constraint may be expressed in an unary procedure on a score element.Arbitrary relations can be de?ned using accessors for element parameters and accessors to other score elements.Such constraints can be mapped to all elements of a score or subsets of these(e.g.,all elements of a voice).13

The choice of the distribution technique is independent of other search issues in Oz.Therefore,the proposed distribution does not limit the expressiveness of an Oz constraint script.Particularly a best solution search can still be performed and over-constraint problems can be handled using rei?ed constraints14.

5Conclusion

Constraint programming is attractive for computer as-sisted composition,because the composer can de?ne arbitrary relations between score parameters,without specifying how to achieve them.

The Propagate and distribute technique is an e?cient and complete search strategy whose search order can be tailored.This article proposed a distribution strategy for a musical score which always proceeds in score-time, even if the rhythmic structure of the score is not known before the search.

In various situations a full search is preferable over non-complete strategies,e.g.when constraints as allDif-ferent shall be strictly ful?lled,when all solutions or the best solution with regard to a certain criterion are desired.

11A more free approach may express the elements of a container by a list with an unbound tail.By and by the search process adds elements to the list.But this way constraint propagation between the list elements is at least considerably reduced.

12Such a constraint needs to run in a separate thread.The thread will block until the simultaneous notes are known.It will then add its constraint to the parameters of the elements.

13The mapping should only de?ne redundant constraints if nec-essary,e.g.,to reduce the search space by eliminating symme-tries.Otherwise redundant propagators impair e?ciency.

14Rei?ed constraints constrain the truth value of other constraints and thus make e.g.disjunction,implication,and negation pos-sible.A truth value is expressed as a variable of the?nite do-main{0,1},which allows to,e.g.,maximize the number of ful?lled constraints.

6Acknowledgments

I would like to thank Peter Desain for his helpful com-ments on draft versions of this article.I am grateful to the Oz mailing list community for valuable advice.I also wish to thank Robin Minard and Anja Ischebeck who helped me to put the ideas into English words.

References

[1]Tosten Anders.Arno:Constraints Programming in Common

Music.In Proceedings of the2000International Computer Music Conference.

[2]Gerard Assayag,Camilo Rueda,Mikael Laurson,Carlos

Agon,and Olivier https://www.wendangku.net/doc/619416065.html,puter Assisted Composi-tion at IRCAM:From PatchWork to Open https://www.wendangku.net/doc/619416065.html,puter Music Journal,23:3,Fall1999.

[3]Philippe Codognet and Daniel Diaz.Yet Another Local

Search Method for Constraint Solving.In T.Walsh and

C.Gomes,editors,Proceedings of the AAAI Symposium”Us-

ing Uncertainty in Computation”.AAAI Press,2001.

[4]Martin Henz,Stefan Lauer,and Detlev https://www.wendangku.net/doc/619416065.html,-

POzE—intention-based music composition through con-straint programming.In Proceedings of the8th IEEE In-ternational Conference on Tools with Arti?cial Intelligence, pages118–121,Toulouse,France,November16–191996.

IEEE Computer Society Press.

[5]Mikael Laurson.PatchWork,PWConstraints.IRCAM,

Paris,?rst english edition,Oktober1996.Reference man-ual.

[6]The Mozart Programming System.http://www.mozart-oz.

org/.

[7]Christian Schulte.Oz Explorer–Visual Constraint Program-

ming Support.Technical report.available at www.mozart-oz.

org.

[8]Christian Schulte and Gert Smolka.Finite Domain Con-

straint Programming in Oz.A Tutorial.Technical report.

available at https://www.wendangku.net/doc/619416065.html,.

[9]Je?rey Mark Siskind and David Allen McAllester.Screamer:

A Portable E?cient Implementation of Nondeterministic

Common Lisp.Technical report,University of Pennsylvania Insitute for Research in Cognitive Science,1993.

[10]Gerd Smolka.The Oz Programming Model.In Jan van

Leeuwen,editor,Computer Science Today,volume1000.

Springer-Verlag,Berlin,1995.

[11]Heinrich Taube.An Introduction to Common https://www.wendangku.net/doc/619416065.html,-

puter Music Journal,21:1:29–34,1997.

[12]Charlotte Truchet,Carlos Agon,and Philippe Codognet.

A Constraint Programming System for Music Composition,

Preliminary Results.In Seventh International Conference on Principles and Practice of Constraint Programming,Musical Constraints Workshop,Paphos,Cyprus,2001.

[13]Peter van Roy and Seif Haridi.Concepts,Techniques,and

Models of Computer Programming.To appear,http://www.

info.ucl.ac.be/~pvr/book.pdf.

[14]Detlev Zimmermann.Modelling Musical Structures.Aims,

Limitations,and the Artist’s Involvement.In ECAI98Work-shop on Constraints for Artistic Applications,Brighton, 1998.

在ppt课件中实现多张幻灯片和背景音乐同时播放

在ppt课件中实现多张幻灯片和背景音乐同时播放 使用PowerPoint做幻灯片,有时我们需要给所有幻灯片加上背景音乐,来渲染气氛,增强演示效果。但直接使用“插入”菜单栏中的“影片和声音”→ “文件中声音”所插入的背景音乐只对所选择的那张幻灯片起 作用,等到播放下一张时,背景音乐就停止播放了。怎么解决这个问题? 其实我们只要再在“自定义动画”中简单设置一下,就可以轻松控制背景音乐在指定的部分或全部幻灯片播放了,具体做法如下: 1、把全部幻灯片做好,在需要插入声音的幻灯片中,单击“插入”菜单下的“影片和声音” →“文件中的声音”,选择所需的声音文件,在出现“是否需要在幻灯片放映时自动播放声音?”的对话框时选择“是”(如图1)。 2、如果是在PowerPoint 2000中操作,右键单击新出现的声音图标“小喇叭”,选择“编辑声音对像”,勾选“循环播放,直到停止”选项(如图2),最后单击“确定”按钮。(为了不影响幻灯片的视觉效果,此时可以顺便把“小喇叭”拖到这张幻灯片的右下角。) 3、右键单击声音图标“小喇叭”,选择“自定义动画”,打开“自定义动画”窗口(如图3),单击“继续幻灯片放映”,这时其下面的“停止播放” 项会由不可操作的灰色变成实色。接下来再单击“在哪张幻灯片后”项,然后在方框内填入需要停止播放的幻灯片的序号,最后单击“确定”。(这里还可以把“不播放时隐藏”勾选上,这样在播放幻灯片过程中就不会显示声音图标了。)

这样指定的背景音乐就可以在几张幻灯片中连续播放了。 如果是在Office PowerPoint 2003中操作,第2步的画面如图4,这里有一个“显示选项”可供选择,我们可以勾选“幻灯片放映时隐藏声音图标”项,这样在播放幻灯片过程中就不会显示声音图标了。 而第3步的右键单击声音图标“小喇叭”,选择“自定义动画”,打开的“自定义动画”窗口也有所变化,如图5:这时我们可以左键双击“自定义动画”窗口中的“一剪梅.wma”或右键单击“一剪梅.wma”,再选择“效果选项”,会出现如下图的播放声音窗口(如图6)。单击“在哪张幻灯片后”项,然后在方框内填入需要停止播放的幻灯片的序号,最后单击“确定”就完成设置了。

游戏音效制作合同模版

XX游戏音效制作合同 本合同就甲方(X Korea)委托乙方(X)制作‘XX’游戏音效,签订以下条款。 第一条[目的] 本合同双方应本着诚实守信原则,乙方做好甲方的音效制作,双方互相保护对方利益为己任。 第二条[用语定义] "著作财产权":是指作词作曲家,对自己所创作的音乐作品,所拥有的权利。 包括复制权,演出权,网络传播权,传送权,展览权,发行权,唱片出租权。 “著作人格权:是指作者对自己的作品,在精神层面和人格上受法律保护的个人利益部分,具体分为公开发表权,姓名表示权,同一性保持权。 第三条[合同期限] 本合同期限为:自2016年04月01日“起到甲方确定最终完成品为止。 除此之外,甲方也可以书面形式通知乙方终止本合同。 - 第一次音效提交日期: 05月20日 - 第二次音效提交日期: 05月30日(第一次版本修改后的成品提交日) - 第三次音效提交日期: (修改日程-可根据甲方的验收日程,相应调整) * 如果音效成品需要修改,合同期限将顺延到修改完为止。 第四条[代理业务范围] 乙方代理甲方音效制作的业务如下: -甲方的游戏音乐和声效制作 ※以上的日程和音效修改工作,将与甲方业务负责人协商后确定 第五条[作品的所有权] ①乙方的音乐制作和结构应保证纯属原创, 如果侵犯其他制作权,乙方应承担全部责任。 ②乙方拥有音乐作品相关的著作人格权,甲方拥有音乐作品的著作财产权。 ③乙方制作的音效作品,双方均不得使用或销售于本合同游戏以外的其他产品及用途上。(但著作财产权上,关于本合 同项目,在国内外业务及二次利用时,可通过双方协商后进行。如:用于本合同项目的宣传视频和网页论坛等) ④如果有第三方侵犯我方的著作权及连带作品时,双方应共同进行维权。

PPT中怎么让背景音乐一直播放

PPT中怎么让背景音乐一直播放 OFFICE中的POWERPOINT幻灯片制作软件广泛应用于我们的工作与教学工作中。 我们为了让幻灯片做的更加生动的话,有时要在里面插入背景音乐,可是很多用户在操作过程中,不知怎么让插入进去的声音文件一直播放,这里我们以OFFICE 2003为例,来讲一下操作过程。 工具/原料 office 2003 方法/步骤 1. 1 我们首先用POWERPOINT 2003打开一个含有多个幻灯片页面的文件。

2. 2 我们从上面菜单选择,插入-影片和声音-文件中的声音。当然我们也可以选“剪辑管理器中的声音”和“录制声音”。 “文件中的声音”是我们电脑上已有的声音文件,一般所有音频格式都支持。“剪辑管理器中的声音”是OFFICE安装文件中自带的一些小的声音片段,“录制声音”是用外部设备向里录制自己的声音文件。

3.弹出对话窗口,我们如果看不到我们需要的音频文件的话,可以选所有文件, 如图。我们点开“文件类型”下拉箭头,可以看到一般所有音频文件都支持。 我们选好背景音乐文件,点确定打开。 4.弹出对话框,让我们选是播放幻灯片时自动播放背景音乐还是播放幻灯片时 单击一下鼠标播放。 我们按自己的意愿选择,我选择自动。

5.我们看到幻灯片中多出一个小喇叭图标,我们可以拉到右下角。 6.我们开始设置让背景音乐一直播放到结束,我们右击该喇叭图标,选“自定 义动画”。

7.这时右侧出现“自定义动画”选项窗口,我们点开“配乐1”的下拉箭头, 选“效果选项”。

8.在弹出的窗口中,我们在效果-停止播放处,可以选择在哪一张幻灯片播放 结束时声音停止,如果要一直播放背景音乐的话,就选择到最后一张幻灯片就行了。 9.另外,如果我们不想让播放幻灯片时这个小喇叭图标出现,我们可以右击小 喇叭,选“编辑声音对象”。

游戏音乐与音效的播放

游戏音乐与音效的播放 发表日期:2006-08-23 作者:[转贴] 出处:目录: 文档内容: 在Win32环境下,播放音乐音效的方法太多了,而且有一个共同点就 是:你不需要花很大的心力就可以得到你需要的东西。延续主题式的 探讨,这一期我们着重在音乐与音效的播放。 □游戏的配乐 我相信很多人一定同意音乐在游戏里面所占的地位,回想一下国内RPG的 经典「仙剑奇侠传」,剥掉音乐这一个层面,整个游戏将会逊色不少,尤其 适当的场景搭配适当的音乐,更能让玩家融入剧情当中。该哭的时候哭,该 笑的时候笑,大概就很切中要领了。RPG剩下的音效部份,并不特别突出, 大抵上知道砍人的时候有挥剑的声音就可以了,所以在音效的表现方面,通 常比较不那麽注重。而即时战斗的游戏着重在厮杀的音效表现上,一大片人 马,一片混杂的声音,这其中牵涉到混音的部份,我们底下也会探讨到。读 完这篇文章,你会学习到什麽时候该用什麽样的程式作法来表现游戏的另一 个生命:音乐与音效。 □从MIDI开始 早期DOS下的音乐部份,大多数采用声霸卡的规格,副档名为CMF者便是 这种格式,当然游戏通常不会让你看到真正的作法,但是内部采用这种格式 居多是无庸置疑的。而WINDOW下的游戏以光碟发行者居多,为了充分达 到空间利用的阶段,游戏中会大量使用WAV格式的档案,或是直接将音乐 烧成音轨的格式。尤其很多游戏喜欢采用第一片资料片,第二片音乐片的作 法,平常不玩游戏还可以当成音乐CD来听,算是满有质感的一件事。当然, 我的意思是这些音乐必须要声声入耳,如果音乐本身庸庸碌碌的,即使烧成

音轨,一样是庸庸碌碌,改变不了这个事实。 在WINDOW下,考量到空间的大小,MIDI格式的音乐档绝对是最佳的选择,一首五分钟的MIDI了不起十万字元的大小,这跟WAV格式一分钟占用量以MB计,简直是小巫见大巫,所以网站上的音乐,游戏的音乐,都很适合用MIDI来表现,而音乐部份我个人注重旋律,至於一首音乐本身使用到的乐器数量,我倒是很少去注意,人的耳朵听东西有一定的极限,只要不产生杂音,配合优美的旋律,大致上都可以接受。 □播放MIDI的程式作法 游戏中播放音乐的要点就是循环播放,也就是播放完毕以後,要让他从头开始播放,直到场景更换,或是游戏结束为止。所以当MIDI档案播放完毕以後,必须要能通知程式,让程式做出适当的处理。播放MIDI的作法只要藉由WINDOW的多媒体的支援,马上就搞定了,甚至直接从HELP的作法剪过来,稍微修改一下,也能符合需要,因为这种东西相当公式化,A君和B 君写出来的程式码也大致上会长得差不多,废话不多说,看看程式多麽简单便是: class CMidi { public: DWORD Play(HWND,char* FileName); void Replay(); void Stop(); private: UINT wDeviceID; wDeviceID = ; MIDI = MCI_SEQ_STATUS_PORT; if (dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)(LPVOID) &mciStatusParms)) { mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);

使PPT中的背景音乐和图片一起循环播放

使PPT中的背景音乐和图片一起循环播放 在“自定义动画”中简单设置一下,就可以轻松控制背景音乐在指定的部分或全部幻灯片播放了,具体做法如下: 1、把全部幻灯片做好,在需要插入声音的幻灯片中,单击“插入”菜单下的“影片和声音” →“文件中的声音”,选择所需的声音文件,在出现“是否需要在幻灯片放映时自动播放声音?”的对话框时选择“是”。 2、如果是在PowerPoint 2000中操作,右键单击新出现的声音图标“小喇叭”,选择“编辑声音对像”,勾选“循环播放,直到停止”选项,最后单击“确定”按钮。(为了不影响幻灯片的视觉效果,此时可以顺便把“小喇叭”拖到这张幻灯片的右下角。) 3、右键单击声音图标“小喇叭”,选择“自定义动画”,打开“自定义动画”窗口,单击“继续幻灯片放映”,这时其下面的“停止播放” 项会由不可操作的灰色变成实色。接下来再单击“在哪张幻灯片后”项,然后在方框内填入需要停止播放的幻灯片的序号,最后单击“确定”。(这里还可以把“不播放时隐藏”勾选上,这样在播放幻灯片过程中就不会显示声音图标了。) 这样指定的背景音乐就可以在几张幻灯片中连续播放了。 如果是在Office PowerPoint 2003中操作,第2步有一个“显示选项”可供选择,我们可以勾选“幻灯片放映时隐藏声音图标”项,这样在播放幻灯片过程中就不会显示声音图标了。 而第3步的右键单击声音图标“小喇叭”,选择“自定义动画”,打开的“自定义动画”窗口也有所变化:这时我们可以左键双击“自定义动画”窗口中的“一剪梅.wma”或右键单击“一剪 梅.wma”,再选择“效果选项”,会出现如下图的播放声音窗口。单击“在哪张幻灯片后”项,然后在方框内填入需要停止播放的幻灯片的序号,最后单击“确定”就完成设置了。 补充回答: 我明白你的意思了。你是说音乐在图片的1—3张是持续的,但是图片重新从第一张展示的时候音乐没放完就又从头播放了,对么? 这个在PPT里面没有专门的解决办法,毕竟一次幻灯展示的结尾就是最后一张PPT放完。但还是有办法解决的,你可以这样:增加图片的数量,比如音乐放完需要20张图片,那你再增加17张一样顺序的图片,并且格式设置一样。这样在播放的时候看不出来有20张,以为还是3张在循环

游戏音乐设计

《探索听觉艺术发展新空间——浅谈游戏音乐设计》 今天,随着游戏产业的蓬勃发展,游戏音乐设计逐渐成为听觉艺术中的一个新领域。无论从艺术风格还是技术发展上,游戏音乐在短短20多年的历史中都经历了许多变化与革新。因而与其他的多媒体听觉艺术相比,游戏音乐更加自由、鲜活、充满新时代年轻人的气息。当今世界各地的游戏音乐设计者们依靠新的技术和硬件设备不断创造出新的音乐风格,大大丰富了虚拟世界里的听觉感受,同时也形成了各民族文化的交融与碰撞。在未来,本土游戏音乐也将迎来新的发展和挑战,让我们拭目以待,进入这个崭新的艺术殿堂吧。 一.游戏音乐的发展历程 (一)游戏音乐早期的地位及状况 游戏音乐的历史可以简单的从游戏的发展史上推断一个确切的数字出来:最早的家用游戏机是1983年日本任天堂公司开发的游戏机种FC,也就是可以推断,游戏音乐真正意义上从技术员的手中走到生活中也就只有短短不足24年的历史。为什么会说不足24年呢?因为最早期的游戏是没有音乐或者在真正意义上不能把它称作游戏音乐。那时最早的街机游戏,比如“PONG!”,“棒球”,“BREAKOUT”等,都只有效果音而已,甚至有些像矢量线公司设计的矢量作品连效果音也不存在,完全是无声的游戏。 任天堂进入街机业,虽然仍旧没有出现真正意义上的背景音乐,但在游戏开始时会有一段短暂的旋律,游戏过程中也会反复奏出同一个旋律,比如“大金刚”,“大力水手”等。此后的几年里,游戏开始普及背景音乐。1983年FC发售!任天堂的超大作超级玛莉奥兄弟一举成功,游戏中的曲目诙谐配合游戏节奏,给人一种非常美好的趣味感,直接改造了人们的思维,以至于玛莉奥的音乐就此成为家喻户晓的经典之作。 但在早期的游戏中,音乐是处于一个极其尴尬的地位。因为早期FC模拟器最大容量不足250KB,而一个包含有立体声的数字音频文件约需要十兆字节的储存空间。使用这种音质的音频文件在当时根本就是任何一款家用机都不可能带的起来它。没有音乐,游戏必然要以失去娱乐性为代价,而使用音乐却为当时的硬件条件所不允许。最终越来越多的开发人员终于找到了解决的办法——MIDI音乐,号称是为了游戏而专门开发的一个新的传输协议。 (二)游戏音乐现阶段的发展状况

超市中背景音乐和播放时间对顾客消费行为的影响研究

超市中背景音乐和播放时间对顾客消费行 为的影响研究 一. 序言 在商业领域里,利用背景音乐刺激消费者的购买欲望越来越普遍。英国兰斯特大学心理学家诺斯博士通过一项“超市音乐”新研究发现,不同的音乐对不同的顾客的购物欲可能会带来意想不到的影响。诺斯在研究中特意在当地一家超市的货架上摆放了同等数量且价格、知名度、风味均处在同一档次的法国和德国葡萄酒。按照常理推想,顾客们必然会根据自己的偏爱和经验进行选购。但有趣的是,当超市大放法国风情音乐时,法国酒的销量就猛增到德国酒销量的5倍之多,相反当超市大放德国啤酒节音乐时,德国酒的销量又比法国酒销量大了1倍。如此看来,顾客们似乎倾向于购买那些与音乐相“协调一致”的酒。 另据在美国所作的类似研究,古典音乐会让一部分顾客明显增加购买欲,小夜曲会鼓励一部分男性在为恋人购买礼品时更舍得花钱,轻音乐会驱使一部分顾客倾向于购买便宜货,而摇滚乐则可能迫使一部分顾客在购物过程中出现优柔寡断心态,从而在一定程度上反倒抑制了他们的购物欲望。由此可见,悠扬适宜的背景音乐,不仅能够提高环境品质,而且能够营造宽松的购物气氛。音乐非常有益于促销,它是塑造店内气氛的重要手段,而且是最简易的方式;它是创造商场气氛的一项有效途径,同时也影响着消费者情绪和购物愿望。 以往的研究多集中与音乐类型对于顾客消费行为的影响,而很少考虑播放时间可能也会对消费行为产生影响,而且音乐类型可能会与不同的时间段产生交互作用从而影响顾客消费行为。本研究试图从音乐类型、播放时间以及两者的交互作用出发研究对顾客消费行为的影响。 二.文献综述 1.背景音乐 背景音乐是指与主体的意识行为无直接关系,是通过非音乐鉴赏环境这一媒介间接地作用于主体意识行为的音乐。它是那种既令人舒心而又不妨碍人们的主要意识活动的音乐。背景音乐必须使个体集中精力去做原来的工作,其发出的声响只是进入个体的潜意识层。

游戏音效和音乐设计

实验三游戏音效和音乐设计 一、实验目的 1、理解游戏音效和音乐的实现原理 2、掌握游戏音效的加载技术 3、掌握游戏音乐的加载技术 二、实验步骤 1.实验原理 (1)游戏中的音效和背景音乐都是通过音效和音乐文件加载到游戏中的。 (2)常见的音效文件格式有AIFF, AU 和W AV等,Java语言用于播放音效的类都包含在javax.sound.sampled包中。 (3)加载和播放音效文件的步骤为: a)为音效文件建立音频输入流对象,程序代码如下: file=new File(fileName); //fileName是存储文件名的字符串 AudioInputStream stream=AudioSystem.getAudioInputStream(file); b)获取音频文件的音频格式,程序代码如下: AudioFormat format=stream.getFormat(); c)使用上一部获取的音频格式设置音频行信息,程序代码如下: https://www.wendangku.net/doc/619416065.html, info=new https://www.wendangku.net/doc/619416065.html,(Clip.class,format); d)使用特定的音频信息建立用于播放音频输入流的音频行,程序代码如下: Clip clip=(Clip)AudioSystem.getLine(info); e)把要播放的音频输入流导入上一部创建的音频行,程序代码如下: clip.open(stream); f)使用音频行播放音频,程序代码如下: clip.start(); 2.本次实验的第一个任务是向游戏中加载角色碰撞和角色跳跃的音效。在游戏的碰撞检测过程中,一旦检测出游戏角色和障碍物发生碰撞,就播放碰撞音效;当游戏玩家按空格键指挥角色跳跃时,就播放跳跃音效文件。 关键代码: publicbooleancheckCollision() { for (inti = 0; i

怎么实现ppt背景音乐和图片循环播放

PPT中实现背景音乐和图片循环播放 “自定义动画”中简单设置一下,就可以轻松控制背景音乐在指定的部分或全部幻灯片播放了,具体做法如下: 1、把全部幻灯片做好,在需要插入声音的幻灯片中,单击“插入”菜单下的“影片和声音”→“文件中的声音”,选择所需的声音文件,在出现“是否需要在幻灯片放映时自动播放声音?”的对话框时选择“是”。 2、如果是在PowerPoint 2000中操作,右键单击新出现的声音图标“小喇叭”,选择“编辑声音对像”,勾选“循环播放,直到停止”选项,最后单击“确定”按钮。(为了不影响幻灯片的视觉效果,此时可以顺便把“小喇叭”拖到这张幻灯片的右下角。) 3、右键单击声音图标“小喇叭”,选择“自定义动画”,打开“自定义动画”窗口,单击“继续幻灯片放映”,这时其下面的“停止播放”项会由不可操作的灰色变成实色。接下来再单击“在哪张幻灯片后”项,然后在方框内填入需要停止播放的幻灯片的序号,最后单击“确定”。(这里还可以把“不播放时隐藏”勾选上,这样在播放幻灯片过程中就不会显示声音图标了。) 这样指定的背景音乐就可以在几张幻灯片中连续播放了。 如果是在Office PowerPoint 2003中操作,第2步有一个“显示选项”可供选择,我们可以勾选“幻灯片放映时隐藏声音图标”项,这样在播放幻灯片过程中就不会显示声音图标了。 而第3步的右键单击声音图标“小喇叭”,选择“自定义动画”,打开的“自定义动画”窗口也有所变化:这时我们可以左键双击“自定义动画”窗口中的“一剪梅.wma”或右键单击“一剪梅.wma”,再选择“效果选项”,会出现如下图的播放声音窗口。单击“在哪张幻灯片后”项,然后在方框内填入需要停止播放的幻灯片的序号,最后单击“确定”就完成设置了。

TL-2208智能音乐播放器说明书

背景音乐播放器使用说明 一:概述 ★微电脑控制,单键飞梭,图形化界面,多级菜单操作模式。 ★真彩色TFT3.0寸显示器,中文字幕,工作状态一目了然。 ★本机内置2GB内存,最大可以做到32G,用户可以随意擦录音乐文件。 ★用户可以任意添加音乐到本机2G内存或外置SD卡中。外置SD卡最大可达32G 容量 ★同时具有定时播放内置和外置节目,4路/8路音频定时输出,1路/2路定时电源输出口。 ★强大的音乐播放功能,支持MPEG 1/2 Layer 3 、WMA、WAV、OGG、APE、FLAC等音频。 ★HiFi级的音频解码性能,音质与专业CD相媲美。 ★支持高清录音功能。 ★内置高清晰FM收音机。 ★支持FM节目录制,你可以随意录制你喜欢的FM收音机节目。 ★个性化的定时播放程序,满足各种时间、各种场合的使用需要。 ★可编程,全自动电源、广播分区管理。 ★支持电脑联机编辑定时程序,设置定时简单易用。 ★时钟、定时精确到秒。 ★支持警报触发信号输入播放指定音乐文件(可选)。 ★支持短路信号输出控制外围设备(可选)。 二:操作界面使用说明(由于机型不同布局略有不同) 1.面板功能 ⑴电源开关 ⑵SD卡插槽和USB连接座 ⑶液晶显示 ⑷按键 ⑸旋钮.

2.按键功能 ⑴.AUTO 切换定时播放。 ⑵.MANUAL 切换手动播放。 ⑶.EXIT 退出当前菜单。 ⑷.ZONE 分区全开全关。 ⑸.MENU 弹出当前菜单。 ⑹.<< 向左移动光标。 ⑺.>> 向右移动光标。 ⑻.■停止播放。 3.旋钮 旋钮为调节音量大小或单项选择。中心按键为播放/暂停或功能确定。 4.后板说明(由于机型不同布局略有不同) ⑴.收音机天线接线柱 ⑵.无线遥控接口. ⑶.音频输入和输出接口

相关文档
相关文档 最新文档