Questions about spatium, layout

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about spatium, layout

lasconic
Administrator
I'm playing with the musicXML import (again).
My first concern is about the page size, margins etc ...
If you load a musicXML with custom height / width such as http://www.recordare.com/xml/samples/BrahWiMeSample.xml
and go to page settings you will see that the page size and margin are not good.

Looking for an answer, I take a look to the code in page.cpp in the function : PageFormat::read(QDomElement e)
Here some computation are made

double val = ee.text().toDouble() * 0.5 / PPI;


I wonder what the 0.5 constant is ?? (20 / 4) according to a commented line. I thought that 20 was a font size so I tried with 18. So it gives me 0.45.
For musicXML it appears that 0.45 works better but I don't know why ! This function seems to be used as well for musescore native format. So I wonder if I should correct this. Maybe there are implications I'm not aware of.
Any thoughts ?

Lasconic


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Questions about spatium, layout

wschweer
Administrator
MScore internally stores page size and margin in inch units (25.4mm).
I once thought it was a good idea to use the
same scheme as musicXML in saving this values in external file to allow
for some code sharing.
I think the transformation between mscore/musicXML values is wrong.
If you change PageFormat::read() all mscore scores will have wrong
page sizes and margins, so it would be best to make a clone of the read
method and modify it for musicXML.

Werner

On Monday 05 January 2009 13:38:29 Lasconic wrote:

> I'm playing with the musicXML import (again).
> My first concern is about the page size, margins etc ...
> If you load a musicXML with custom height / width such as
> http://www.recordare.com/xml/samples/BrahWiMeSample.xml
> and go to page settings you will see that the page size and margin are not
> good.
>
> Looking for an answer, I take a look to the code in page.cpp in the
> function
>
> : PageFormat::read(QDomElement e)
>
> Here some computation are made
>
> double val = ee.text().toDouble() * 0.5 / PPI;
>
>
> I wonder what the 0.5 constant is ?? (20 / 4) according to a commented
> line. I thought that 20 was a font size so I tried with 18. So it gives me
> 0.45. For musicXML it appears that 0.45 works better but I don't know why !
> This function seems to be used as well for musescore native format. So I
> wonder if I should correct this. Maybe there are implications I'm not aware
> of. Any thoughts ?
>
> Lasconic


------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Questions about spatium, layout

lasconic
Administrator
Thanks for the info, I will do that. And create a readPageFormat in musicXML.
Still what is 0.5 for ? I encounter it several times more in the layouting. I guess that if I want to take a look to dynamics position or slurs positions I may encounter it again. Can you give more info about it ?

Thanks
Lasconic

2009/1/5 Werner Schweer <[hidden email]>
MScore internally stores page size and margin in inch units (25.4mm).
I once thought it was a good idea to use the
same scheme as musicXML in saving this values in external file to allow
for some code sharing.
I think the transformation between mscore/musicXML values is wrong.
If you change PageFormat::read() all mscore scores will have wrong
page sizes and margins, so it would be best to make a clone of the read
method and modify it for musicXML.

Werner

On Monday 05 January 2009 13:38:29 Lasconic wrote:
> I'm playing with the musicXML import (again).
> My first concern is about the page size, margins etc ...
> If you load a musicXML with custom height / width such as
> http://www.recordare.com/xml/samples/BrahWiMeSample.xml
> and go to page settings you will see that the page size and margin are not
> good.
>
> Looking for an answer, I take a look to the code in page.cpp in the
> function
>
> : PageFormat::read(QDomElement e)
>
> Here some computation are made
>
> double val = ee.text().toDouble() * 0.5 / PPI;
>
>
> I wonder what the 0.5 constant is ?? (20 / 4) according to a commented
> line. I thought that 20 was a font size so I tried with 18. So it gives me
> 0.45. For musicXML it appears that 0.45 works better but I don't know why !
> This function seems to be used as well for musescore native format. So I
> wonder if I should correct this. Maybe there are implications I'm not aware
> of. Any thoughts ?
>
> Lasconic


------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Questions about spatium, layout

wschweer
Administrator
Look at the comment in PageFormat::write(). If font size is 20 (height of a
staff), then a spatium (distance of two staff lines) is 20/4 = 5 in a five
line staff. MusciXML units are 1/10 of a staff line distance which gives 0.5.

In reality the font is scaled and maybe the global "_spatium" value should be
used to convert musicXml values.

Werner
 
On Monday 05 January 2009 15:29:47 Lasconic wrote:

> Thanks for the info, I will do that. And create a readPageFormat in
> musicXML.
> Still what is 0.5 for ? I encounter it several times more in the layouting.
> I guess that if I want to take a look to dynamics position or slurs
> positions I may encounter it again. Can you give more info about it ?
>
> Thanks
> Lasconic
>
> 2009/1/5 Werner Schweer <[hidden email]>
>
> > MScore internally stores page size and margin in inch units (25.4mm).
> > I once thought it was a good idea to use the
> > same scheme as musicXML in saving this values in external file to allow
> > for some code sharing.
> > I think the transformation between mscore/musicXML values is wrong.
> > If you change PageFormat::read() all mscore scores will have wrong
> > page sizes and margins, so it would be best to make a clone of the read
> > method and modify it for musicXML.
> >
> > Werner
> >
> > On Monday 05 January 2009 13:38:29 Lasconic wrote:
> > > I'm playing with the musicXML import (again).
> > > My first concern is about the page size, margins etc ...
> > > If you load a musicXML with custom height / width such as
> > > http://www.recordare.com/xml/samples/BrahWiMeSample.xml
> > > and go to page settings you will see that the page size and margin are
> >
> > not
> >
> > > good.
> > >
> > > Looking for an answer, I take a look to the code in page.cpp in the
> > > function
> > >
> > > : PageFormat::read(QDomElement e)
> > >
> > > Here some computation are made
> > >
> > > double val = ee.text().toDouble() * 0.5 / PPI;
> > >
> > >
> > > I wonder what the 0.5 constant is ?? (20 / 4) according to a commented
> > > line. I thought that 20 was a font size so I tried with 18. So it gives
> >
> > me
> >
> > > 0.45. For musicXML it appears that 0.45 works better but I don't know
> > > why
> >
> > !
> >
> > > This function seems to be used as well for musescore native format. So
> > > I wonder if I should correct this. Maybe there are implications I'm not
> >
> > aware
> >
> > > of. Any thoughts ?
> > >
> > > Lasconic
> >
> > -------------------------------------------------------------------------
> >----- _______________________________________________
> > Mscore-developer mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Questions about spatium, layout

lasconic
Administrator

Ok using spatium for musicXML is a good way, I think. Doing value * spatium / INCH.
I wonder if we can use the same for msc because spatium is stored in msc.
What do you think ? it is format-destructive ?

Lasconic


2009/1/5 Werner Schweer <[hidden email]>
Look at the comment in PageFormat::write(). If font size is 20 (height of a
staff), then a spatium (distance of two staff lines) is 20/4 = 5 in a five
line staff. MusciXML units are 1/10 of a staff line distance which gives 0.5.

In reality the font is scaled and maybe the global "_spatium" value should be
used to convert musicXml values.

Werner

On Monday 05 January 2009 15:29:47 Lasconic wrote:
> Thanks for the info, I will do that. And create a readPageFormat in
> musicXML.
> Still what is 0.5 for ? I encounter it several times more in the layouting.
> I guess that if I want to take a look to dynamics position or slurs
> positions I may encounter it again. Can you give more info about it ?
>
> Thanks
> Lasconic
>
> 2009/1/5 Werner Schweer <[hidden email]>
>
> > MScore internally stores page size and margin in inch units (25.4mm).
> > I once thought it was a good idea to use the
> > same scheme as musicXML in saving this values in external file to allow
> > for some code sharing.
> > I think the transformation between mscore/musicXML values is wrong.
> > If you change PageFormat::read() all mscore scores will have wrong
> > page sizes and margins, so it would be best to make a clone of the read
> > method and modify it for musicXML.
> >
> > Werner
> >
> > On Monday 05 January 2009 13:38:29 Lasconic wrote:
> > > I'm playing with the musicXML import (again).
> > > My first concern is about the page size, margins etc ...
> > > If you load a musicXML with custom height / width such as
> > > http://www.recordare.com/xml/samples/BrahWiMeSample.xml
> > > and go to page settings you will see that the page size and margin are
> >
> > not
> >
> > > good.
> > >
> > > Looking for an answer, I take a look to the code in page.cpp in the
> > > function
> > >
> > > : PageFormat::read(QDomElement e)
> > >
> > > Here some computation are made
> > >
> > > double val = ee.text().toDouble() * 0.5 / PPI;
> > >
> > >
> > > I wonder what the 0.5 constant is ?? (20 / 4) according to a commented
> > > line. I thought that 20 was a font size so I tried with 18. So it gives
> >
> > me
> >
> > > 0.45. For musicXML it appears that 0.45 works better but I don't know
> > > why
> >
> > !
> >
> > > This function seems to be used as well for musescore native format. So
> > > I wonder if I should correct this. Maybe there are implications I'm not
> >
> > aware
> >
> > > of. Any thoughts ?
> > >
> > > Lasconic
> >
> > -------------------------------------------------------------------------
> >----- _______________________________________________
> > Mscore-developer mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Questions about spatium, layout

lasconic
Administrator
I didn't find a way to access correctly _spatium in page.cpp to apply * (spatium/DPMM) / INCH.
So I commit the solution with 0.45. I wonder how it will behave on other computers. I added a readMusicXML function page.h.
I also change part-name handling and added lyricist support. It's in r1415. 

2009/1/5 Lasconic <[hidden email]>

Ok using spatium for musicXML is a good way, I think. Doing value * spatium / INCH.
I wonder if we can use the same for msc because spatium is stored in msc.
What do you think ? it is format-destructive ?

Lasconic


2009/1/5 Werner Schweer <[hidden email]>
Look at the comment in PageFormat::write(). If font size is 20 (height of a
staff), then a spatium (distance of two staff lines) is 20/4 = 5 in a five
line staff. MusciXML units are 1/10 of a staff line distance which gives 0.5.

In reality the font is scaled and maybe the global "_spatium" value should be
used to convert musicXml values.

Werner

On Monday 05 January 2009 15:29:47 Lasconic wrote:
> Thanks for the info, I will do that. And create a readPageFormat in
> musicXML.
> Still what is 0.5 for ? I encounter it several times more in the layouting.
> I guess that if I want to take a look to dynamics position or slurs
> positions I may encounter it again. Can you give more info about it ?
>
> Thanks
> Lasconic
>
> 2009/1/5 Werner Schweer <[hidden email]>
>
> > MScore internally stores page size and margin in inch units (25.4mm).
> > I once thought it was a good idea to use the
> > same scheme as musicXML in saving this values in external file to allow
> > for some code sharing.
> > I think the transformation between mscore/musicXML values is wrong.
> > If you change PageFormat::read() all mscore scores will have wrong
> > page sizes and margins, so it would be best to make a clone of the read
> > method and modify it for musicXML.
> >
> > Werner
> >
> > On Monday 05 January 2009 13:38:29 Lasconic wrote:
> > > I'm playing with the musicXML import (again).
> > > My first concern is about the page size, margins etc ...
> > > If you load a musicXML with custom height / width such as
> > > http://www.recordare.com/xml/samples/BrahWiMeSample.xml
> > > and go to page settings you will see that the page size and margin are
> >
> > not
> >
> > > good.
> > >
> > > Looking for an answer, I take a look to the code in page.cpp in the
> > > function
> > >
> > > : PageFormat::read(QDomElement e)
> > >
> > > Here some computation are made
> > >
> > > double val = ee.text().toDouble() * 0.5 / PPI;
> > >
> > >
> > > I wonder what the 0.5 constant is ?? (20 / 4) according to a commented
> > > line. I thought that 20 was a font size so I tried with 18. So it gives
> >
> > me
> >
> > > 0.45. For musicXML it appears that 0.45 works better but I don't know
> > > why
> >
> > !
> >
> > > This function seems to be used as well for musescore native format. So
> > > I wonder if I should correct this. Maybe there are implications I'm not
> >
> > aware
> >
> > > of. Any thoughts ?
> > >
> > > Lasconic
> >
> > -------------------------------------------------------------------------
> >----- _______________________________________________
> > Mscore-developer mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer



------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer