Go Audio Lesson Tool

For discussing go computing, software announcements, etc.
User avatar
Harleqin
Lives in sente
Posts: 921
Joined: Sat Mar 06, 2010 10:31 am
Rank: German 2 dan
GD Posts: 0
Has thanked: 401 times
Been thanked: 164 times

Re: Go Audio Lesson Tool

Post by Harleqin »

ethanb wrote:
Harleqin wrote:That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.


I was talking about the conceptual level. Yes, it is possible to do it with time stamps mangled into the SGF file, but it has to be compared to the alternative, which is much easier to parse and write (example syntax):

Code: Select all

(00:00:00 sgf 0 (;GM[1]...
  ))
(00:00:10 next-node)
(00:00:12 next-node)
(00:00:14 next-node)
(00:00:18 next-node)
(00:00:30 jump-to-node 58)
(00:01:03 mark-circle c i)
(00:03:54 move black c j)
.
.
.
(00:24:27 sgf 1 (;GM[1]...
  ))
(00:25:43 jump-to-node 34)
(00:27:05 jump-to-sgf 0)
.
.
.


This format describes what is actually supposed to happen, and seems much more flexible to me. Anyway, what I am aiming at is that the teacher's actions are orthogonal to the SGF tree. You might be successful in trying to press them into the tree itself, but I think that the way I show above is much easier to understand and implement. Still in other words: the SGF file is contained in the lesson, not the other way around (there may even be more than one SGF file in a lesson, as shown above).

Li Kao seems to use a similar approach.
A good system naturally covers all corner cases without further effort.
ethanb
Lives in gote
Posts: 355
Joined: Sat Apr 24, 2010 10:15 am
Rank: AGA 2d
GD Posts: 0
IGS: ethanb
Has thanked: 52 times
Been thanked: 43 times

Re: Go Audio Lesson Tool

Post by ethanb »

Harleqin wrote:
ethanb wrote:
Harleqin wrote:That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.


I was talking about the conceptual level. Yes, it is possible to do it with time stamps mangled into the SGF file, but it has to be compared to the alternative, which is much easier to parse and write (example syntax):

Code: Select all

(00:00:00 sgf 0 (;GM[1]...
  ))
(00:00:10 next-node)
(00:00:12 next-node)
(00:00:14 next-node)
(00:00:18 next-node)
(00:00:30 jump-to-node 58)
(00:01:03 mark-circle c i)
(00:03:54 move black c j)
.
.
.
(00:24:27 sgf 1 (;GM[1]...
  ))
(00:25:43 jump-to-node 34)
(00:27:05 jump-to-sgf 0)
.
.
.


This format describes what is actually supposed to happen, and seems much more flexible to me. Anyway, what I am aiming at is that the teacher's actions are orthogonal to the SGF tree. You might be successful in trying to press them into the tree itself, but I think that the way I show above is much easier to understand and implement. Still in other words: the SGF file is contained in the lesson, not the other way around (there may even be more than one SGF file in a lesson, as shown above).

Li Kao seems to use a similar approach.


It's more flexible in terms of what you can do with it, for sure - I was just saying he could get SGF import and export "for free" this way and if his file structure on disk is in a similar format (of course the memory structures should be as you describe when loaded from disk, which is also what I said in my earlier post with the example) then his entire file-processing function set becomes pretty clean. I like reusable code. :)
User avatar
Harleqin
Lives in sente
Posts: 921
Joined: Sat Mar 06, 2010 10:31 am
Rank: German 2 dan
GD Posts: 0
Has thanked: 401 times
Been thanked: 164 times

Re: Go Audio Lesson Tool

Post by Harleqin »

ethanb wrote:It's more flexible in terms of what you can do with it, for sure - I was just saying he could get SGF import and export "for free" this way and if his file structure on disk is in a similar format (of course the memory structures should be as you describe when loaded from disk, which is also what I said in my earlier post with the example) then his entire file-processing function set becomes pretty clean. I like reusable code. :)


What is clean about sprinkling the actions (which are linear in time and orthogonal to the game tree) into the game tree? Your file parsing would have to collect the actions together and sort them, and your file writing would have to distribute them into the different nodes.

I guess that you want to put this mangling code before the SGF writing, so that you can reuse the SGF writing code. I want the SGF writing before the lesson file writing code, so I get to reuse, too.
:ugeek:
A good system naturally covers all corner cases without further effort.
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Go Audio Lesson Tool

Post by Li Kao »

I now have image recognition which creates screenshots of a kgs window and recognizes the stones and markers(Triangle,Circle,Square) in them.
And I have basic sgf loading support.
So I have to figure out how to combine the scanned data with a sgf-file of the game and the audio to create an actual replay of a KGS (teaching) game.
Sanity is for the weak.
FrankdeGroot
Dies in gote
Posts: 32
Joined: Mon Jun 28, 2010 3:43 am
GD Posts: 68
Been thanked: 4 times

Re: Go Audio Lesson Tool

Post by FrankdeGroot »

Moyo Go Studio has the ability to record audio (using speex). The advantage is that the audio is included as standard SGF. Moyo Go can be freely downloaded.
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Go Audio Lesson Tool

Post by Li Kao »

FrankdeGroot wrote:Moyo Go Studio has the ability to record audio (using speex). The advantage is that the audio is included as standard SGF. Moyo Go can be freely downloaded.

Adding an audio comment to individual nodes and recording a whole teaching game with jumps in the sgf and continuous audio is a pretty different use-case. So I don't think these functions can replace each other.
Sanity is for the weak.
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Go Audio Lesson Tool

Post by Li Kao »

Sourcecode is available at github:
http://github.com/CodeInChaos
Sanity is for the weak.
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Go Audio Lesson Tool

Post by Li Kao »

New Release:
Download Alpha 1

New Features:
* Can use image recognition to record games from other programs
* Basic SGF-Importer
* Support for multiple board-sizes
Sanity is for the weak.
User avatar
topazg
Tengen
Posts: 4511
Joined: Wed Apr 21, 2010 3:08 am
Rank: Nebulous
GD Posts: 918
KGS: topazg
Location: Chatteris, UK
Has thanked: 1579 times
Been thanked: 650 times
Contact:

Re: Go Audio Lesson Tool

Post by topazg »

Does anyone have a game they'd like me to review to test this? I'm keen to give it a go ...
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Go Audio Lesson Tool

Post by Li Kao »

I'm not sure if it's stable enough to risk a full game review. The current versions are mainly for technical testing and bug searching.
Sanity is for the weak.
User avatar
topazg
Tengen
Posts: 4511
Joined: Wed Apr 21, 2010 3:08 am
Rank: Nebulous
GD Posts: 918
KGS: topazg
Location: Chatteris, UK
Has thanked: 1579 times
Been thanked: 650 times
Contact:

Re: Go Audio Lesson Tool

Post by topazg »

When I try to import an .sgf file I get the following:

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Model.GraphicalGameTree.PositionOfNode(Int32 node)
   at GoClient.GameForm.RenderField()
   at GoClient.GameForm.timer1_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3607 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GoClient
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/GoClient.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
CommonGui
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/CommonGui.DLL
----------------------------------------
Model
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/Model.DLL
----------------------------------------
ChaosUtil
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/ChaosUtil.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Go Audio Lesson Tool

Post by Li Kao »

Added a few bugfixes
Download Alpha 2
Fixed the exception in the sgf importer and a few more bugs.
Sanity is for the weak.
User avatar
wms
Lives in gote
Posts: 450
Joined: Tue Apr 20, 2010 4:23 pm
GD Posts: 0
KGS: wms
Location: Portland, OR USA
Has thanked: 257 times
Been thanked: 287 times
Contact:

Re: Go Audio Lesson Tool

Post by wms »

For the KGS lectures and Guo Juan's teaching site, I used an XML format that embeds changes to an SGF file. Something like this:

<addproperty nodeid="10" sgf="W[ae]"/>
<pause time="63943">
<addnode parentid="10" nodeid="11"/>
<addproperty nodeid="11" sgf="B[cj]TR[cj]"/>
<speex>98g74293p40231940923490 (imagine that this is a chunk of base64 data) oqeuth233dtoe</speex>

etc...the "speex" tags delimit base64 encoded speex data. Then I take the whole big XML file and zip it up. The sizes end up pretty tolerable, because zip gets rid of most of the overhead from XML and speex is very low bit rate.

But of course for a new project, do whatever seems best. :)
User avatar
fwiffo
Gosei
Posts: 1435
Joined: Tue Apr 20, 2010 6:22 am
Rank: Out of practice
GD Posts: 1104
KGS: fwiffo
Location: California
Has thanked: 49 times
Been thanked: 168 times

Re: Go Audio Lesson Tool

Post by fwiffo »

I thought about writing a programming blog named <xml verbosity="verbosity">XML Verbosity</xml>. :-)
User avatar
CarlJung
Lives in gote
Posts: 429
Joined: Wed Apr 21, 2010 1:10 pm
Rank: SDK
GD Posts: 0
KGS: CarlJung
Location: Sweden
Has thanked: 101 times
Been thanked: 73 times

Re: Go Audio Lesson Tool

Post by CarlJung »

wms wrote:For the KGS lectures and Guo Juan's teaching site, I used an XML format that embeds changes to an SGF file. Something like this:

<addproperty nodeid="10" sgf="W[ae]"/>
<pause time="63943">
<addnode parentid="10" nodeid="11"/>
<addproperty nodeid="11" sgf="B[cj]TR[cj]"/>
<speex>98g74293p40231940923490 (imagine that this is a chunk of base64 data) oqeuth233dtoe</speex>

etc...the "speex" tags delimit base64 encoded speex data. Then I take the whole big XML file and zip it up. The sizes end up pretty tolerable, because zip gets rid of most of the overhead from XML and speex is very low bit rate.

But of course for a new project, do whatever seems best. :)


Simple and elegant. You use xml in all it's glory and reuse your sgf parser from kgs. Now if we only could get rid of sgf completely...
Post Reply