• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: best way to track note on/off in UI ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: best way to track note on/off in UI ?


  • Subject: Re: best way to track note on/off in UI ?
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Mon, 22 Feb 2010 14:08:11 -0600


On 22 Feb 2010, at 10:42, Scott Burgess wrote:

CoreAudio includes Audio Units, and we are all using Apple's AU base classes
for our UI, note handling, event handling, and so on, so it is a valid issue to
ask this list.


The base classes for synth units have a intricate setup for progressing notes
through attack, release, and note end cycles.


Questions include: Is it safe to call PropertyChanged from Attacked()? Is the
note state even set to attacked at this point? Or after Attacked() has exited?

I'd probably just put it in StartNote which is where I work out the MIDI key mapping for multiple part synths. Actually I was doing this with some drum pad triggers but I encountered problems with stuck notes etc and swiftly moved on to other things.



Are there side effects from setting property listener to have a 0.0 notification
interval (the examples use 0.05)? And so forth...

I don't know what setting it to 0.0 will do - presumably there is a minimum interval time. Keep lowering the value until you find a setting that works but 0.02 would be a practical lower limit I'd have thought (50Hz).


I do something similar for peak metering. Every 50ms or so I calculate the peak value for each part, store them in the AU and issue a PropertyChanged notification. The GUI listens to property changes (every 50ms or so but can be set independently), gets the new peak values and updates the meters. To keep everything in sync the AU then marks the property as 'read' so it doesn't overwrite data that the GUI hasn't seen.

Works well, except in Logic where I'm getting noticeably different refresh rates in the GUI when I have multiple instances of the same plugin open. The Cocoa GUI code is quite heavy on CPU too.

Stephen




Scott Burgess Bitnotic

On Feb 22, 2010, at 3:58 AM, Paul Davis wrote:

On Mon, Feb 22, 2010 at 1:15 AM, NickMtl <email@hidden> wrote:
Actually, I have a similar problem. I've implemented a virtual piano
like GarageBand but in the main view which is an NSOpenGLView. When
using the keyboard as input, passed a certain speed, I can no longer
match keyDown with keyUps, resulting in stuck midi notes.

If only there was a way to find the status of all keyboard keys at any
given time. Anyone know how to do this?

this is just a very basic program design issue. it doesn't have
anything to do with CoreAudio. you need to separate the idea of state
*tracking* from state *display*. tracking the note on/off events, as
noted, takes very little time, and should be done independently of any
screen updates. similarly, screen updating should be independent of
note on/off events, and merely uses the state that you maintain in
your tracking code. this is just fundamental model-view-controller
programming, or perhaps even just fundamental GUI event driven
programming, and is a design aspect needed by thousands or millions of
bits of software in many different niches.


--p
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >best way to track note on/off in UI ? (From: Scott Burgess <email@hidden>)
 >Re: best way to track note on/off in UI ? (From: Stephen Blinkhorn <email@hidden>)
 >Re: best way to track note on/off in UI ? (From: NickMtl <email@hidden>)
 >Re: best way to track note on/off in UI ? (From: Paul Davis <email@hidden>)
 >Re: best way to track note on/off in UI ? (From: Scott Burgess <email@hidden>)

  • Prev by Date: Re: best way to track note on/off in UI ?
  • Next by Date: Use Garageband instruments from MIDI?
  • Previous by thread: Re: best way to track note on/off in UI ?
  • Next by thread: Re: best way to track note on/off in UI ?
  • Index(es):
    • Date
    • Thread