Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently April 16th, 2024, 4:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Scrolling
PostPosted: November 6th, 2011, 4:05 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Forum users who followed this topic before will know that I developed a programme with the help of this forum
for music display for musicians. (Particularly with help from Larry - thanks)

Finally put to the test on Thursday it was disastrous - Nothing to do with Opus by the way.

I used Logitech radio number pads (N305) to control selection etc.

1. They didn't always work
2. They didn't always start the programme.
3. They forgot my changed commands
4. The digits are too small to see on stage where colours/smoke machines etc are being used.

So I'm having a rethink about touch screens and digital pens - has anyone used them with Opus?

Finally, a useful addition would be the facility to alter the speed of scrolling whilst in operation.
e.g. pressing number pad + to increase scroll speed and number pad - to decrease scroll speed.

I can't figure out where to put the command in the excellent script forwarded by Larry.

IsKeyPressed() seems to be what I want.

Regards to everyone
:lol:

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 6th, 2011, 7:21 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Hey Mike,
Buy iPads for the band. There is an app available for musicians... for sheet music. (scrolling, maybe included).

Opus methods:
Quote:
Finally, a useful addition would be the facility to alter the speed of scrolling whilst in operation.
e.g. pressing number pad + to increase scroll speed and number pad - to decrease scroll speed. IsKeyPressed() seems to be what I want
The simplest way I think, and one which does not have to change the current script or complicate it is this. Attach the KeyPressed trigger to the Page (or a MasterPage... if you want to use this for all pages that use that MP (BTW, you can nest MPs... so some features or objects apply to certain pages. But that's another topic.) Then, for Actions you can increment or decrement your scroll-speed variable. I don't remember the actual script you are using, but as long as the scrolling part had some 'iteration' (e.g. looping), then the new speed would be used. Maybe you would have to insert or modify one line of code:
Code:
//Assume that the musician pressed NumPad -, and that you use a Pub variable or Page variable named newspeed.
//Assume that the Trigger and Action above increase or decrease the value of newspeed
//You need something like the following line of code (in your loop)
myscrollspeed = newspeed ;

There is one problem I see here. That page/pub var could get out of bounds for reasonable scroll speeds... or could become less than zero. So instead of simply using a standard Action that changes the variable, use a Script Action to do it. And set up something like the following code.

Code:
//a method to control scroll speed boundaries.  Let's assume valid scroll speeds are 0 to 10 (end values included)

//scripted action to increment variable    -- under the NumPad+  key trigger
if (newspeed >= 0 && newspeed <= 9)
{
newspeed +=1 ;
wait(0)
}

//scripted action to deccrement variable    -- under the NumPad-  key trigger
if (newspeed >= 1 && newspeed <= 10)
{
newspeed -=1 ;
wait(0)
}
You may not need both conditions in one IF statement, but I think it is safer to be explicit here.

Quote:
Logitech radio number pad
Wireless mice (and keyboards etc), bluetooth or otherwise, are less reliable than wired mice etc. A PC is constantly "listening" on the bus for signals and any changes (i.e. input). Sometimes I hate my wireless mouse... it seems the PC just ignores it. I think it is 2.4GHz interference (as I have several kinds of gadgets using that freq).

Quote:
4. The digits are too small to see on stage where colours/smoke machines etc are being used.
There are many different kinds of HID, input devices, you could possibly use (it depends if it looks like a mouse, keyboard, or joystick to Windows -- then Opus probably can trigger off of it). A Joystick may be an option for you?? A nudge here, a nudge there...

[Lar EDIT:] thinking joystick pad

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: November 6th, 2011, 10:54 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Hmm.
Tried to send a message - got a weird cgi notice. No idea what that is.
I'll try again.
Regards

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 6th, 2011, 11:00 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Quote:
Buy iPads for the band. There is an app available for musicians... for sheet music. (scrolling, maybe included).


Yeah! OK! About £1500 for three. And then they decide how I can use them.
No programming without their authority.
Nope! I ain't going down that route. :P

Quote:
I don't remember the actual script

Code:
//- - - - - - -   Script to control vertical scrolling of a Frame/Image, then advance to next frame in MultiFrame and scroll again - - - - - -
// note: within the comment lines themselves I often use 'single quotes' simply to highlight a label (and not imply a string value)
//here we set a speed factor for scrolling.  this should be very small for smooth scrolling
//set the rate for looping: 'loopBPS' (Beats per second) set at 1000 gives a wait state of  0.001 seconds
//  'loopBPS'  at 10,000  scrolls a long sheet in about 15 seconds;  to go slower... set at 1,000 seems to give 30 sec. ??
loopBPS = 260 ;
looprate =  1 / loopBPS ;
upper =  15000;         
//this will be used as the 'upper limit' for 'i' in the LOOP below   
//(high number makes for smooth action when combined with 'fractional percentage' scroll factor)
ifactor = upper/100;
PageFlipDelay =  7 ;    //number of seconds to 'wait' after reaching end of one page and before turning to next page (or rather 'sheet')
//'framecounter' variable is used to regulate how we view the frames in a multiframe (know which one is active or current)
framecounter = 1 ;

function DoScroll_or_Advance()
{
var MFchildren = MultiFrame_1.GetNumberChildren() ;
var theGoFrame =  MFchildren - framecounter ;
wait(5)
drumObject.Hide()
wait(25)
for (i=0;i < upper ; i++)
{
//start scrolling --- note 'looprate' set above is the PRIMARY means to control scroll rate,
//however 'upper' and 'ifactor' may be played with as well.
MultiFrame_1.GetChild(theGoFrame).SetScrollPosition( i/ifactor +0.3, -1 )                           
// the '+0.3' SHOULD WORK to avoid falling short, e.g. 99.843 percent scroll
wait(looprate)
   //next we monitor if we've reached 100 percent scroll position.
   //Actually, this is an IMPLIED test... we're assuming that 'upper' and 'ifactor' are properly set to get there,
   //then 'i' is a simple conditional test.
    if ( i == upper -1)
    {
    ////use the 'currscroll' and 'Debug' lines for testing purposes -- to verify that the loop control, 'i',
//and scroll amount that is set achieves 100 percent Scrolling.
    //currscroll = MultiFrame_1.GetChild(theGoFrame).GetScrollInfo()
    //Debug.trace( MultiFrame_1.GetChild(theGoFrame).GetName() + "   currscroll.vpos  is  "+  currscroll.vpos  +"\n")
    framecounter += 1 ;
      if ( framecounter <= MFchildren )
      {
            //Explanation of this next line for 'wait'. We need a little delay, PageFlipDelay,
            //after reaching 100 percent Scroll and before 'turning the page'
      PageTurning_Bar.Show()
      Vec_ProgressBar1.MoveX(200, PageFlipDelay, true )
      PageTurning_Bar.Hide()
      Vec_ProgressBar1.MoveX(-200, 0, false )
      //now Turn-the-Page  (not Opus page, but the 'sheet music')
      MultiFrame_1.Forward()
      wait(0.3)
      DoScroll_or_Advance()
      }
      else
      {
      
   
      //Do something to indicate "Choose the Another Song/Title in the Playlist"
      //Note:  the next line is simply a placeholder action (you need to decide how you want to handle reaching the end)
      NextObject.Show()

      }

    } //end if


} //end for

}
//end function



You might work where to add here in your effort.

Kind regards
Mike :wink:

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 7th, 2011, 3:11 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
You might work where to add here in your effort.
Apparently, code comments say:
//start scrolling --- note 'looprate' set above is the PRIMARY means to control scroll rate,
//however 'upper' and 'ifactor' may be played with as well.

so you might do something like: (insert the first part before wait(looprate) )
Code:
//  'loopBPS'  at 10,000  scrolls a long sheet in about 15 seconds;  to go slower... set at 1,000 seems to give 30 sec. ??
loopBPS = newspeed ;
looprate =  1 / loopBPS ;

//- - - - - - - - -
wait(looprate)

You just have to figure out your upper and lower boundaries that you want to use. In my previous reply I used a range of 0 to 10 inclusive. So you will have to adjust those IF statements to 'zero' (???) to 10,000 (???). The way the function is written, 10,000 is faster than 1,000. So check your increase/decrease logic accordingly.

While you are at it, you might as well add a ScrollSpeed indicator on screen. Choose what you like... a linear Bar, a percentage slider, etc. Easy to do with SetPosition() for example using a pointer-object. MoveY() also works of course. It may not help during an actual performance, but it may help acclimating.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: November 7th, 2011, 12:14 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Hi Larry

Thanks for the reply.

I've already set those numbers as you advised some time ago.
The problem comes with a different computer and a different processor.

The programme works fine on my designing PC - processor Intel i7-2600 3.40Ghz; 8 GB Ram; 64 bit
- spec below is previous machine

For the musicians I use laptops - Toshiba A10s - with less specification. I think it's 2.8GHz and 1 GB RAM
and I use three which probably have processors between 2.2GHz and 2.8GHz.

Long pieces are difficult to set on the main computer so they work in the laptops
and I have to sit and watch the Toshibas every time I add a new piece - after publication and
transfer - all rather tedious. :cry: The musicians don't have access to Opus to alter details.

I would like to include something so that the musicians can press a
key to scroll faster - if the music is not going up the screen fast enough
or slower if the music is disappearing off the top edge.

I thought an "IsKeyPressed()" could be added somewhere to the loop you designed
but I can't get it to alter anything.

Kind regards

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 7th, 2011, 1:59 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
I thought an "IsKeyPressed()" could be added somewhere to the loop you designed but I can't get it to alter anything.
???

Really?
I noticed a long delay in the code above, wait(25). That's not getting in the way is it?

Can you at least get the trigger working... just to do something?
Try first to get it working with the main keyboard, and using standard keys, e.g. left and right arrow keys. Once that works, you can change the trigger to your numpad. I tested on my keyboard numpad, and it works. The vector Move is just a visual confirmation. (pic attached -- std actions set-up).

If the problem is tying that (the incremented variable) into the script, let us know. I'll look at it again.


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: November 7th, 2011, 2:23 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
I thought an "IsKeyPressed()" could be added somewhere to the loop you designed
I just re-read this. What I am suggesting is to use the equivalent thing in standard Actions & Triggers.

You could use the script command, "IsKeyPressed()", but in this case... for what is going on in your script -- I think it would require setting up an Event Handler in script. Look-up RegisterEventHandler() and UnRegisterEventHandler() in the script-help-files. Think of it this way: "IsKeyPressed()" is simply a test condition that returns true or false. It is not a trigger itself. If you had a simple, fast loop -- you can use it in place of a "trigger" (...IF testcondition, do something). But if I held the key down a bit too long, that loop might increment the value +15 in a split-second. Better to use Is-Key-Released, but I think there is no Opusscript command for that.

So... I like standard actions here.

[Lar EDIT:] BTW, even the Std Actions in the above example will repeatedly decrement the variable... if/when the key is held down too long. In this case, the action for Moving the Vector has a time element of 1 second. If I change that to 0.1 sec, the variable decrements to zero very quickly. So again, a reason to consider (standard) KEY RELEASED Trigger instead.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: November 7th, 2011, 6:33 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Hi Larry

The first delay is necessary for the musicians to read instructions on the screen;
such as "4 drum beats" before the music starts which then disappears after a
few seconds.

The second delay is while the musician reads and plays the page before it starts
to scroll.

I'll have another play with your suggestions.

Kind regards,

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 17th, 2011, 12:37 am 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Yahoo! :lol:

Finally made progress inserting IsMousePressed()
and increasing the counter ("i") by 10 for left and decreasing the counter by -10 for right.

This has the effect of moving the music bmp up slightly or down slightly where
the music is not scrolled to a readable position. :wink:

That's great but the musicians will be using a digital touch arrangement now.
I've dropped the wireless number pad idea. :twisted:
I don't want to add mouses (??) to their activities. :cry:

How can I have the same effect by having say:

A + icon and a - icon drawn on the page where they touch the screen to do the same thing.

This would need to be included in the scrolling loop to alter the counter "i".

Perhaps I could create buttons with "+" and "-" then use GetState()

Regards

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 17th, 2011, 1:39 am 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Success! :lol:
Code:
function DoScroll_or_Advance()
{
var MFchildren = MultiFrame_1.GetNumberChildren() ;
var theGoFrame =  MFchildren - framecounter ;
var butStatus = Buttonplus
var butStatus1 = Buttonminus
wait(5)
            
for (i=0;i < upper ; i++)
{
//start scrolling --- note 'looprate' set above is the PRIMARY means to control scroll rate,
//however 'upper' and 'ifactor' may be played with as well.
MultiFrame_1.GetChild(theGoFrame).SetScrollPosition( i/ifactor +0.3, -1 )
            // Trying for mouse input
            
            {
            butStatus = Buttonplus.GetState()
            if (butStatus == true)
            {
            i = i+20
            }
            }
            
            {
            butStatus1 = Buttonminus.GetState()
            if (butStatus1 == true)
            {
            i=i-20
            }
            }
:roll:
Works fine :P
Regards

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 18th, 2011, 1:22 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Mike, congrats! you got it working. I think the mouse-press would physically be somewhat awkward for the musicians -- I'm sure they'll tell you anyway.

As for your script, specifically the loop, I would suggest inserting a wait(). I am imagining that as wriiten, the loop will run as fast as possible to keep checking for ButtonState(). You could ease the load on the CPU by using wait(0.05) (use your judgement to adjust plus/minus). Simply place that command at the end of the For Loop, before exiting it.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scrolling
PostPosted: November 18th, 2011, 1:10 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Hi Larry

Thanks for the comments.

They won't be using mouses(??) - obviously too difficult when holding an instrument
and what would they move it on? - have a look at the digital touch pen here:

http://www.midte.com/Products/Products1.html sorry - links now gone 16/11/2013.

I can hang this on a string (or similar) on the monitor.

I plan to buy touch screen monitors in the future which would only
take the musician the same time as turning a page on a music stand.

In testing I haven't found a problem with the click using the
script as written. If I hold the "mouse button" down it merely scrolls
faster continuously; one click and I get a jump of one stave.

I'll try your suggestion about the delay but I haven't seen any problems yet.
(No smoke coming from the processor! :lol: )

Kind regards

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Last edited by Kingell on November 16th, 2013, 11:33 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 16th, 2013, 11:31 pm 
Offline

Joined: February 11th, 2005, 1:03 am
Posts: 185
Location: Yorkshire UK
Opus: Pro 9.3
OS: Windows 7
Hi Larry :)

I see that Opus now appears to be capable of Android programming.
I suggested that to "the boss" some time ago. Have you tried it?
I haven't upgraded yet so I haven't got the latest OPUS. :cry:

I've bought a Dell Streak cheaply on EBay and I think a 10 1/2" Android would be readable and,
of course, they have touch screens. They are becoming cheaper and cheaper in the UK - about $35!!! -
with a capacitive touch screen. :wink:

So.......... I understand Android developed by Google uses a kind of Java which is not unlike
the scripting in Opus.

Various possibilities seem to exist there. I've given up with the touch pens - they don't always
work immediately so now we're carrying paper again. :evil:

I've also developed skills with DMX lighting which I synchronise to MIDI files. So our
stage presentation is quite spectacular although we're all a bit long in the teeth now. :oops:

Here's a demo page I'm working on. It seems my material didn't work on several of the
plethora of devices out there so I've now got two "sample" pages.

Try the first (Click on a title or number) and if it doesn't work click on the IPAD icon and select an item preceded by an asterisk.
Because they're big files you might have to wait a little while.

Here's the link:
http://www.mikelockey.com/music.html

Kind regards
Mike

_________________
I'd like to begin by saying, " It gives me great pleasure.....
Plato award winner 1999.
Several computers.
HP - Phenom Quad 2.3Ghz; RAM 4Gb, Windows 7 - 64 bit; 3Tb collective Hard disks; Nvidia Geforce 9600 GSO; Opus 9.3; Tascam2488


For this message Kingell has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scrolling
PostPosted: November 17th, 2013, 10:24 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Kingell wrote:
I've also developed skills with DMX lighting which I synchronise to MIDI files. So our
stage presentation is quite spectacular although we're all a bit long in the teeth now. :oops:
I did not know what that really meant all these years... until I became it.

I am out for a couple of days, so will check it out later.

'Yes', I just recently got the Opus.latest. But I have barely started to get into it. So many changes, where to start. You should check w/DW on an upgrade as they are quite reasonable there.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group