generate continuously midi sound with changing note number - midi

I am generating and playing continuously midi sound. During this generating and playing I am changing pitch wheel. This changing is working wothout problems. But I need change note number too. If i use message Note on playing is stopping and starting. Is it possible to change note number without stopping playing sound?

There's no way of doing this this directly - if you get to the limit of the pitchbend range and you need to to beyond it the only way is to stop that note and start a new one. One option could be to redefine the pitchbend range to be much larger so that you can reach more notes before you need to re-trigger a note on. Another option is to use a sound with a longer attack and release so that the end of one note and the start of the next will cross-fade so that it'll sound continuous.

Related

Starting a Sound at a specified position with CocosDenshion?

It's possible to do stuff like:
Reproduce a sound at a specified starting position
Reproduce a sound for a certain ammount of time
Using CocosDenshion ?
If so, how ?.
If not...i have any alternatives, like a different sound engine or a certain class in the SDK that would allow me to do both things ?
You can play positional audio with CocosDenshion. See this tutorial for example.
Of course you can also loop sounds, if that's what you meant by question #2. You can always schedule a timer and stop or (better) fade out the sound after a specified amount of time. Programming the timer is of course up to you.
As for an alternative I can highly recommend ObjectAL. It does everything CocosDenshion does and a few things more, plus its well documented and comes with an excellent demo app with examples for playing positional audio, looping sounds, using stereo channels with panning and fading sounds.
If you don't want to fumble with including a static library in your project have a look at Kobold2D, it comes with ObjectAL (and Cocos2D) already setup and ready to use.

seek to time in AVQueuePlayer

Can any one help me to seek at particular time in AVQueuePlayer?
I have use this controller to play video in iPhone because i need to play two video at the same time.
But my problem is to navigate in video and jump to at particular time, I am not able to do that.
I Know the method the That is [controller seekToTime:(CMTime)] But it is not moving the video at exact position of the video.
Does any one know the solution?
This is stated in the documentation for seekToTime::
The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:.
So try using seekToTime:toleranceBefore:toleranceAfter: instead, specifying a low or zero tolerance. You may also want to specify true for AVURLAssetPreferPreciseDurationAndTimingKey when creating any AVURLAssets you may be using.
Update... I ended up doing hackery and not being especially pleased with the results--the snap-through-black between movies may or may not show, and because I was bad and didn't inquire as to the load status etc it's possible to get many things confused.
But for straight looping an AVQueuePlayer assetItem it works to set a boundaryTime observer and use that to rewind the assetItem. My stuff is only a few seconds long so the seekToTime is pretty seamless, I don't know what it'll do seeking on a longer asset. looping an assetItem in AVQueuePlayer

seamless dynamic audio loop on iPhone

Ok,
So I am trying to seamlessly loop together three sound files with the second file being looped against itself n times. Let's assume I can get them to loop seemlessly together in another program by butting them together. however when I use audioPlayerDidFinishPlaying delegate method of avaudioplayer there is a slight delay in the butting together (even with using the "prepareToPlay" method. The other bit of complexity is that the middle sound needs to continue looping n times AKA as long as the touchesDidEnd method has not been called, at which point the program would play the 3rd and final clip to end the sound "playlist."
As an example think an audience giving applause after a show. sound file A would contain the initial swell of applause, sound file 2 would contain a loopable sample of the crowd cheering at a continuous rate until the user lifts up on the button, at which time the program should kick into the 3rd sound file, which would be the applause of the crowd tailing off.
So my initial attempt using AVAudioPlayer seemed not quick enough to loop back to back without delay so I need another quicker way to do this, suggestions?
For the looping, check out the numberOfLoops property of AVAudioPlayer. Works better than trying to handle the loop logic yourself using the player's delegate.
As for fading smoothly from one looping sample to a 'tail' sample, that's going to be difficult to pull off with AVAudioPlayer. Probably your best bet is to start another player with the trailing sound file and use a timer to rapidly cross fade between the two using the volume property of each.
If that's not satisfactory (and I suspect it may not be) I don't think you'll have much choice but to drop down to the AudioQueue API to pull this off.

Looped Audio samples in the iPhone

I am trying to made a musical iPhone application and I am having some problems playing looped samples.
I have read this question:
audio-on-the-iphone
and several other posts and blogs in the web about the "RemoteIO"/AudioUnits framework but without success.
I have been able to do a sample application that plays a finite sound with a predefined duration (I am using a playbackCallback) but I need the sound to start playing with the user touches the screen and stop playing when the user lift the finger.
Any ideas?
Thanks in advance.
Assuming your code is correct, you're probably omitting one (or more) of these steps:
Stopping reading/writing at the wrong times (because you're likely writing 'a power of 2' samples per render call)
Not providing a fade in/fade out (start at 10 ms fade out and adjust as desired)
Not stopping write on a zero crossing
not resetting the read position to 0 when the user lifts their finger - resuming in the middle of the sample
Your samples are not properly trimmed to zero crossings at start, end, and/or loop positions
Not resetting internal effects, filters, or convertors
You will not need all of these to avoid clicks.

Playing quicktime files with pause points via Keynote (forward and backward)

I have a quicktime file (.mov) generated by Keynote. When played in quicktime, it pauses itself at dozens of pre-defined points waiting for user input. It is basically a slide show with transitions pre-rendered to video.
I want to wrap this in an iPhone app, but see no methods on an MPMoviePlayerController to do anything other than play, which does not pause at the pause points.
Also, I want to be able to play backwards to a prior stop point if the user taps elsewhere on the phone.
Is there a better library for this than MPMoviePlayerController or (deprecated?) UIMoviePlayerController? Or am I overlooking methods that would allow this?
If you think about what you're trying to do, this is actually a fairly complex task. What you're really asking for is the ability to hook up an arbitrary movie playing UI tied to unique gestures, based on the specifics of your movie. I don't think either of the classes in question is going to get you there.
The easiest solution here might be content-based: generate one quicktime movie per "group" of Keynote slides, where each group ends at a pause point, and then it should be pretty easy to interpret gestures to either advance to the next movie (or load it automatically when you reach the end of the last one), or return to the start of the currently playing movie.