Convert Parent object to a child object.
I have the singing demo and have tried many ways to convert it to a child object. I had a previous post on this earlier. I seem to be lost on the conversion of this object to a callable object. Are there objects that don't lend themselves to being called this way? Is this one of them? I have added the PUB method Start and Stop to this program and commented out things that didn't matter, at least they seem that they didn't when I ran Singing as a standalone object. I just need some help on calling this as an object and passing one parameter that has 16 values to it. My file is Singingdemo2 and Chip's ( the working one) is singingdemo.
SingingDemo2.spinSingingDemo.spin
SingingDemo2.spinSingingDemo.spin
spin

21K
Comments
It's true that some objects don't make good child objects. The SingingDemo object does one thing: sing a certain 4-part song. If you turn it into a child object, you'll have a child object that does one thing: sing a certain 4-part song. To make it behave otherwise requires a lot of work. I don't know exactly what you're trying to accomplish, but it doesn't appear to involve singing a certain 4-part song.
Also, not every child object requires start and stop methods. Objects are not cogs. Some objects don't start any cogs, some start many.
I gather from your other thread (grrrr) that you just want to sing one note. Perhaps you should look into using the VocalTract object that SingingDemo uses, rather than trying to use SingingDemo itself.
Onto the problem, I am experiencing. I need to run a conveyor belt that passes RFID tags along. These tags get read and then I wanted my main program to call Chip's singing demo to sing one note in two of the four voices available. It appears you can change the number of voices quite easily. Also Chip's method has done all the figuring on that routine that makes it sound like voices harmonizing. I don't have that knowledge base (yet) and the ability to implement other's IP is certainly attractive and helpful. What I am doing is that I need a single cog always running to be checking the two switches that control the conveyor belt. I could launch that cog by adding that object call from the singing demo. But I also wanted to use the RFID PASM routine to read the RFID tags and report back which tag was read, have that go to a lookup table and call out one of 8 notes from C3 to C4 for example. Once it plays the note, it can shut down the cogs that it starts. I could also launch that routine from Singing, but I would still have the same basic issue of not really understanding converting a parent to a child. At least I don't seem to understand how to modify either of these two objects built by someone else. Last night I burned the midnight oil and used the simple tone generator published in the aftermarket propeller manual. I then converted this into two objects, called left and right and called them as new cogs from a main program called tonecaller. I can stop and start the cogs correctly from this routine. So I think I really understand the concepts, what I am bogged down with is that I don't seem to be able to apply this concept to this Singing demo. I want to call it, pass it one note to play, have it start two voices, play them for about a whole note duration and then shut down the cogs that were opened.
Thanks for your help.
Dave
Toneright2.spinToneleft.spinTonecaller.spin