Class: String

Inherits:
Object show all
Defined in:
lib/musa-dsl/neumas/string-to-neumas.rb,
lib/musa-dsl/neumas/string-to-neumas.rb,
lib/musa-dsl/neumas/string-to-neumas.rb,
lib/musa-dsl/neumas/string-to-neumas.rb,
lib/musa-dsl/neumas/string-to-neumas.rb,
lib/musa-dsl/neumas/string-to-neumas.rb

Instance Method Summary collapse

Instance Method Details

#n(decode_with: nil, debug: nil) ⇒ Object

Note:

This method is added to String via refinement. Requires using Musa::Extension::Neumas.

Short alias for to_neumas.

See Also:

API:

  • public



226
# File 'lib/musa-dsl/neumas/string-to-neumas.rb', line 226

class ::String; end

#neumas(decode_with: nil, debug: nil) ⇒ Object

Note:

This method is added to String via refinement. Requires using Musa::Extension::Neumas.

Alias for to_neumas.

See Also:

API:

  • public



216
# File 'lib/musa-dsl/neumas/string-to-neumas.rb', line 216

class ::String; end

#nn(decode_with: nil, debug: nil) ⇒ Object

Note:

This method is added to String via refinement. Requires using Musa::Extension::Neumas.

Short alias for to_neumas_to_node.

See Also:

API:

  • public



236
# File 'lib/musa-dsl/neumas/string-to-neumas.rb', line 236

class ::String; end

#to_neumas(decode_with: nil, debug: nil) ⇒ Serie, Array

Note:

This method is added to String via refinement. Requires using Musa::Extension::Neumas.

Parses neuma notation string to structured neumas.

Uses Neumalang parser to convert text notation into GDVD (differential) neuma objects that can be decoded to GDV events.

Examples:

Parse simple melody

using Musa::Extension::Neumas
neumas = "0 +2 +2 -1 0".to_neumas

Parse with immediate decoding

using Musa::Extension::Neumas
# Create a simple decoder
decoder = Musa::Neumas::Decoders::NeumaDifferentialDecoder.new
result = "0 +2 +2 -1 0".to_neumas(decode_with: decoder)

Parse with debug

using Musa::Extension::Neumas
neumas = "0 +2 +2".to_neumas(debug: true)

API:

  • public



161
# File 'lib/musa-dsl/neumas/string-to-neumas.rb', line 161

class ::String; end

#to_neumas_to_node(decode_with: nil, debug: nil) ⇒ Node

Note:

This method is added to String via refinement. Requires using Musa::Extension::Neumas.

Parses neuma notation and converts to generative node.

Combines parsing with node conversion for use in generative grammars.

Examples:

Convert to node for generative grammar

using Musa::Extension::Neumas
node = "0 +2 +2 -1 0".to_neumas_to_node

See Also:

  • Musa::Generative

API:

  • public



182
# File 'lib/musa-dsl/neumas/string-to-neumas.rb', line 182

class ::String; end

#|(other) ⇒ Hash

Note:

This method is added to String via refinement. Requires using Musa::Extension::Neumas.

Creates parallel neuma structure.

Combines two neuma strings into parallel (polyphonic) structure. Both voices are parsed and wrapped in parallel container.

Examples:

Two-voice harmony

using Musa::Extension::Neumas

melody = "0 +2 +4 +5"
bass = "-7 -5 -3 -1"
harmony = melody | bass

Raises:

  • if other is not a String

API:

  • public



206
# File 'lib/musa-dsl/neumas/string-to-neumas.rb', line 206

class ::String; end