| Author |
Message |
Keith
Joined: Jun 1, 2008 Posts: 24
|
Posted: Jun 5, 2008 5:30 AM Post subject: Putting a delay, a timeout, and an alarm in \"Source\" |
|
This is a real newbie question, and I am not looking for a play-by-play recipe, but hopefully somebody can get me looking in the right direction.
I want to make some alterations to the \"source\" design which is in the examples folder. Source is a great tool for taking raw data and sending it to the EDFF writer, but I am trying to tweak it in three ways that will help me out when i am doing reading on myself.
First, I want to set a 10 second delay which will serve as a countdown so that I have time to settle in after hitting record. This is no big deal, but it eliminates some of the artifacts (junk) form the fiist few seconds.
Second, I want to put a timer option so that I can set it to record for, say, three minutes and then stop.
Third, I want to add an alarm tone to signal that the session is over. When recording I like to do three minutes with eyes open and three with eyes closed. But if I am having to peek every now and again, I am going to get artifacts!
I know I could set a stop watch or find some other way of alerting myself that time has expired, but where is the \"art\" in that? Like I said, I am not expecting anyone to walk me through this, but some ideas of what elements I need to look at, or if there is a snippet I might want to explore, would help tons.
Thanks! Keith |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1075
|
Posted: Jun 5, 2008 3:34 PM Post subject: |
|
Keith,
one option to measure time is to use TimeSource and Threshold. The output of TimeSource shows how many seconds passed since the start of the design, the Threshold can then be used to activate certain function after desired number e.g. 10 or 600 (= 3 minutes).
So those two could be put between current Record button (in the design) and following elements, to add 10s delay.
Those two together with SystemInteractor (which can be used to automatically stop the design) will do in the second (3min) case. You can also connect it it to play a sound or video when the threshold is met, see in the examples how to play those.
Jarek
|
|
 |
Keith
Joined: Jun 1, 2008 Posts: 24
|
Posted: Jun 5, 2008 3:39 PM Post subject: |
|
Very cool!
Thanks for getting back so fast! I'll post my results for my fellow noobs!
Keith |
|
 |
Keith
Joined: Jun 1, 2008 Posts: 24
|
Posted: Jun 21, 2008 7:29 PM Post subject: |
|
Just a follow-up regarding how this worked for me.
I inserted the TimeSource and Threshold between record and the file writer, but to no avail. Basically, it waited fifteen seconds then recorded the entire sample anyway! I am assuming the first ten seconds buffered, then when the threhold was satisfied it sent it through.
But I did find a solution!
I used the TimeSource and Threshold as advised, but ran a pipe from the Threshold On/Off to the Tap on a Valve element. I then ran a pipe from the source to the Valve's \"In\", and then from the valve to the FileWriter. Result: The ten second delay between pressing record and the actual beginning of the recording!
As a test I sent the same data to a file writer with the valve and to a file writer without, then ran both files to individual oscillators. Sure enough, the valve clipped the first 10 seconds off of the archived data. Very handy when you are doing reading on yourself for purposes of analysis. That first ten seconds as you settle in after hitting record can be pretty sloppy and throws all your averages off.
-Keith Payne |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1075
|
Posted: Jun 22, 2008 2:00 AM Post subject: |
|
Keith,
I think there is yet another way, maybe easier maybe not. By setting \"not-start\" option in the FileWriter (can be set in Advanced Properties), and then use ElementInteractor to Start the FileWriter (along with the time delay).
Your method looks perfectly sound, so this is just another idea.
Jarek |
|
 |
Keith
Joined: Jun 1, 2008 Posts: 24
|
Posted: Jun 22, 2008 3:22 AM Post subject: |
|
Very good. Its always better to have multiple ways to achieve a goal. I'll have to try your way a little later on.
-Keith
|
|