MusicMaster 0.0.1.20101110 → 1.0.0.20120307

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/AUTHORS +4 -1
  2. data/ChangeLog +28 -0
  3. data/LICENSE +1 -1
  4. data/README +2 -5
  5. data/ReleaseInfo +8 -8
  6. data/bin/Calibrate.rb +55 -0
  7. data/bin/Clean.rb +55 -0
  8. data/bin/DBConvert.rb +3 -1
  9. data/bin/Deliver.rb +73 -42
  10. data/bin/Mix.rb +39 -78
  11. data/bin/Process.rb +55 -0
  12. data/bin/Record.rb +63 -116
  13. data/bin/{Album.rb → old/Album.rb} +18 -18
  14. data/bin/{AnalyzeAlbum.rb → old/AnalyzeAlbum.rb} +11 -11
  15. data/bin/{DeliverAlbum.rb → old/DeliverAlbum.rb} +12 -12
  16. data/bin/{Fct2Wave.rb → old/Fct2Wave.rb} +11 -11
  17. data/{album.conf.rb.example → bin/old/album.conf.rb.example} +0 -0
  18. data/lib/MusicMaster/FilesNamer.rb +253 -0
  19. data/lib/MusicMaster/Formats/MP3.rb +50 -0
  20. data/lib/MusicMaster/Formats/Test.rb +44 -0
  21. data/lib/MusicMaster/Formats/Wave.rb +80 -0
  22. data/lib/MusicMaster/Hash.rb +20 -0
  23. data/lib/MusicMaster/Launcher.rb +241 -0
  24. data/lib/MusicMaster/Processes/ApplyVolumeFct.rb +4 -8
  25. data/lib/MusicMaster/Processes/Compressor.rb +50 -47
  26. data/lib/MusicMaster/Processes/Custom.rb +3 -3
  27. data/lib/MusicMaster/Processes/{AddSilence.rb → Cut.rb} +8 -4
  28. data/lib/MusicMaster/Processes/CutFirstSignal.rb +6 -3
  29. data/lib/MusicMaster/Processes/DCShifter.rb +30 -0
  30. data/lib/MusicMaster/Processes/GVerb.rb +3 -2
  31. data/lib/MusicMaster/Processes/Normalize.rb +7 -6
  32. data/lib/MusicMaster/Processes/SilenceInserter.rb +31 -0
  33. data/lib/MusicMaster/Processes/Test.rb +39 -0
  34. data/lib/MusicMaster/Processes/VolCorrection.rb +3 -3
  35. data/lib/MusicMaster/RakeProcesses.rb +1014 -0
  36. data/lib/MusicMaster/Symbol.rb +12 -0
  37. data/lib/MusicMaster/Task.rb +29 -0
  38. data/lib/MusicMaster/Utils.rb +467 -0
  39. data/lib/MusicMaster/old/Common.rb +101 -0
  40. data/musicmaster.conf.rb.example +42 -59
  41. data/record.conf.rb.example +374 -30
  42. metadata +91 -41
  43. data/TODO +0 -3
  44. data/bin/Master.rb +0 -60
  45. data/bin/PrepareMix.rb +0 -422
  46. data/lib/MusicMaster/Common.rb +0 -197
  47. data/lib/MusicMaster/ConfLoader.rb +0 -56
  48. data/lib/MusicMaster/musicmaster.conf.rb +0 -96
  49. data/master.conf.rb.example +0 -13
data/AUTHORS CHANGED
@@ -1 +1,4 @@
1
- = Muriel Salvan (murielsalvan@users.sourceforge.net)
1
+ = Muriel Salvan (muriel@x-aeon.com)
2
+
3
+ * 0.0.1.20101110
4
+ * 1.0.0.20120307
data/ChangeLog CHANGED
@@ -1,5 +1,33 @@
1
1
  = MusicMaster Release History
2
2
 
3
+ == 1.0.0.20120307 (Beta)
4
+
5
+ * No more global variable to store the configuration.
6
+ * Moved SSRC configuration parameter to Wave format section only.
7
+ * Removed obsolete configuration parameters.
8
+ * Harmonized configuration parameters.
9
+ * Added directories in MusicMaster configuration file.
10
+ * Corrected record.conf.rb.example.
11
+ * CutFirstSignal: Added the SilenceMin parameter.
12
+ * Major rewriting, using Rake's mechanism.
13
+ * Added complete regression testing.
14
+ * Adapted release info to last version of RubyPackager.
15
+ * Added tests in the release info.
16
+ * Updated release info to new binaries.
17
+ * Updated email address of Muriel Salvan.
18
+ * Adapted comments to match a better RDoc syntax.
19
+ * Adapted to new version of rUtilAnts.
20
+ * Moved obsolete executables and libraries in old/ directories (to be ported and deleted later).
21
+ * Don't apply volume corrections when useless.
22
+ * Implemented a way to specify which Wave files are to be mixed, with volume correction and offset (see https://sourceforge.net/tracker/?func=detail&aid=3411403&group_id=356734&atid=1489604).
23
+ * Temporary file names now use an MD5 hash to avoid conflicts with reused Wave files.
24
+ * Changed examples for Wave files.
25
+ * Migrated TODO list to Trackers.
26
+ * Updated copyright information.
27
+ * Migrated to GIT repository.
28
+ * Cut: Added cut processing.
29
+ * Bug correction: Compressor: Could not specify floating Ratios and Thresholds.
30
+
3
31
  == 0.0.1.20101110 (Alpha)
4
32
 
5
33
  * Initial public release.
data/LICENSE CHANGED
@@ -6,7 +6,7 @@ This list is found in the file named AUTHORS.
6
6
  The AUTHORS and LICENSE files have to be included in any release of software
7
7
  embedding source code of this package, or using it as a derivative software.
8
8
 
9
- Copyright (c) 2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
9
+ Copyright (c) 2010 - 2012 Muriel Salvan (muriel@x-aeon.com)
10
10
 
11
11
  Redistribution and use in source and binary forms, with or without
12
12
  modification, are permitted provided that the following conditions are met:
data/README CHANGED
@@ -1,6 +1,3 @@
1
- -- This file is best viewed when processed by rdoc.
2
- ++
3
-
4
1
  = Music Master
5
2
 
6
3
  Command-line utility handling Mixing, Mastering and Delivering processes of music projects.
@@ -11,8 +8,8 @@ Check the website at http://musicmaster.sourceforge.net
11
8
 
12
9
  == Who wrote it ?
13
10
 
14
- Check the AUTHORS[link:files/AUTHORS.html] file.
11
+ Check the AUTHORS[link:AUTHORS.html] file.
15
12
 
16
13
  == What is the license ?
17
14
 
18
- You can find out in the LICENSE[link:files/LICENSE.html] file.
15
+ You can find out in the LICENSE[link:LICENSE.html] file.
data/ReleaseInfo CHANGED
@@ -1,8 +1,8 @@
1
-
2
- # This file has been generated by RubyPackager during a delivery.
3
- # More info about RubyPackager: http://rubypackager.sourceforge.net
4
- {
5
- :Version => '0.0.1.20101110',
6
- :Tags => [ 'Alpha' ],
7
- :DevStatus => 'Alpha'
8
- }
1
+
2
+ # This file has been generated by RubyPackager during a delivery.
3
+ # More info about RubyPackager: http://rubypackager.sourceforge.net
4
+ {
5
+ :version => '1.0.0.20120307',
6
+ :tags => [ 'Beta' ],
7
+ :dev_status => 'Beta'
8
+ }
data/bin/Calibrate.rb ADDED
@@ -0,0 +1,55 @@
1
+ #!env ruby
2
+ #--
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
+ # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
+ #++
6
+
7
+ require 'MusicMaster/Launcher'
8
+
9
+ module MusicMaster
10
+
11
+ class Calibrate < Launcher
12
+
13
+ protected
14
+
15
+ # Give additional command line options banner
16
+ #
17
+ # Return::
18
+ # * _String_: Options banner
19
+ def getOptionsBanner
20
+ return ''
21
+ end
22
+
23
+ # Complete options with the specific ones of this binary
24
+ #
25
+ # Parameters::
26
+ # * *ioOptionParser* (_OptionParser_): The options parser to complete
27
+ def completeOptionParser(ioOptionParser)
28
+ end
29
+
30
+ # Check configuration.
31
+ #
32
+ # Parameters::
33
+ # * *iConf* (<em>map<Symbol,Object></em>): The configuration
34
+ # Return::
35
+ # * _Exception_: Error, or nil in case of success
36
+ def checkConf(iConf)
37
+ return nil
38
+ end
39
+
40
+ # Initialize Rake processes and return the task to be built
41
+ #
42
+ # Return::
43
+ # * _Symbol_: Rake target to execute
44
+ def getRakeTarget
45
+ initialize_RakeProcesses
46
+ generateRakeFor_CalibrateRecordings
47
+
48
+ return :CalibrateRecordings
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+
55
+ exit MusicMaster::Calibrate.new.execute(ARGV)
data/bin/Clean.rb ADDED
@@ -0,0 +1,55 @@
1
+ #!env ruby
2
+ #--
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
+ # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
+ #++
6
+
7
+ require 'MusicMaster/Launcher'
8
+
9
+ module MusicMaster
10
+
11
+ class Clean < Launcher
12
+
13
+ protected
14
+
15
+ # Give additional command line options banner
16
+ #
17
+ # Return::
18
+ # * _String_: Options banner
19
+ def getOptionsBanner
20
+ return ''
21
+ end
22
+
23
+ # Complete options with the specific ones of this binary
24
+ #
25
+ # Parameters::
26
+ # * *ioOptionParser* (_OptionParser_): The options parser to complete
27
+ def completeOptionParser(ioOptionParser)
28
+ end
29
+
30
+ # Check configuration.
31
+ #
32
+ # Parameters::
33
+ # * *iConf* (<em>map<Symbol,Object></em>): The configuration
34
+ # Return::
35
+ # * _Exception_: Error, or nil in case of success
36
+ def checkConf(iConf)
37
+ return nil
38
+ end
39
+
40
+ # Initialize Rake processes and return the task to be built
41
+ #
42
+ # Return::
43
+ # * _Symbol_: Rake target to execute
44
+ def getRakeTarget
45
+ initialize_RakeProcesses
46
+ generateRakeFor_CleanRecordings
47
+
48
+ return :CleanRecordings
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+
55
+ exit MusicMaster::Clean.new.execute(ARGV)
data/bin/DBConvert.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
+ # Convert a ratio value into a decibel value
7
8
  def val2db(iRatio)
8
9
  if (iRatio == 0)
9
10
  return -1.0/0
@@ -12,6 +13,7 @@ def val2db(iRatio)
12
13
  end
13
14
  end
14
15
 
16
+ # Convert a decibel value into a ratio value
15
17
  def db2val(iDB)
16
18
  return 2**(iDB/6)
17
19
  end
data/bin/Deliver.rb CHANGED
@@ -1,42 +1,73 @@
1
- #!env ruby
2
- #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
4
- # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
- #++
6
-
7
- require 'MusicMaster/Common'
8
- require 'rUtilAnts/Logging'
9
- RUtilAnts::Logging::initializeLogging('', '')
10
- require 'MusicMaster/ConfLoader'
11
-
12
- module MusicMaster
13
-
14
- # Execute the delivery
15
- #
16
- # Parameters:
17
- # * *iWaveFile* (_String_): Wave file to deliver
18
- def self.execute(iWaveFile)
19
- lRealBaseName = File.basename(iWaveFile)[0..-5]
20
- MusicMaster::src(iWaveFile, "#{$MusicMasterConf[:Deliver][:Dir]}/#{lRealBaseName}_96_24.wav", :SampleRate => 96000)
21
- MusicMaster::src(iWaveFile, "#{$MusicMasterConf[:Deliver][:Dir]}/#{lRealBaseName}_48_24.wav", :SampleRate => 48000)
22
- MusicMaster::src(iWaveFile, "#{$MusicMasterConf[:Deliver][:Dir]}/#{lRealBaseName}_44_16.wav", :SampleRate => 44100, :BitDepth => 16, :Dither => true)
23
- # TODO: Deliver MP3 files too
24
- end
25
-
26
- end
27
-
28
- rErrorCode = 0
29
- lWaveFile = ARGV[0]
30
- if (lWaveFile == nil)
31
- logErr 'Please specify the WAVE file.'
32
- rErrorCode = 1
33
- elsif (!File.exists?(lWaveFile))
34
- logErr "File #{lWaveFile} does not exist."
35
- rErrorCode = 2
36
- else
37
- FileUtils::mkdir_p($MusicMasterConf[:Deliver][:Dir])
38
- MusicMaster::execute(lWaveFile)
39
- logInfo "===== Delivery finished in #{$MusicMasterConf[:Deliver][:Dir]}"
40
- end
41
-
42
- exit rErrorCode
1
+ #!env ruby
2
+ #--
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
+ # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
+ #++
6
+
7
+ require 'MusicMaster/Launcher'
8
+
9
+ module MusicMaster
10
+
11
+ class Deliver < Launcher
12
+
13
+ protected
14
+
15
+ # Give additional command line options banner
16
+ #
17
+ # Return::
18
+ # * _String_: Options banner
19
+ def getOptionsBanner
20
+ return '[--name <DeliverableName>]*'
21
+ end
22
+
23
+ # Complete options with the specific ones of this binary
24
+ #
25
+ # Parameters::
26
+ # * *ioOptionParser* (_OptionParser_): The options parser to complete
27
+ def completeOptionParser(ioOptionParser)
28
+ @LstDeliverableNames = []
29
+ ioOptionParser.on( '--name <DeliverableName>', String,
30
+ 'Specify the name of the deliverable to produce. Can be used several times. If not specified, all deliverables will be produced.') do |iArg|
31
+ @LstDeliverableNames << iArg
32
+ end
33
+ end
34
+
35
+ # Check configuration.
36
+ #
37
+ # Parameters::
38
+ # * *iConf* (<em>map<Symbol,Object></em>): The configuration
39
+ # Return::
40
+ # * _Exception_: Error, or nil in case of success
41
+ def checkConf(iConf)
42
+ rError = nil
43
+
44
+ # Check that all formats referenced correspond to a given format
45
+ if ((iConf[:Deliver] != nil) and
46
+ (iConf[:Deliver][:Deliverables] != nil))
47
+ iConf[:Deliver][:Deliverables].each do |iDeliverableName, iDeliverableConf|
48
+ if (iDeliverableConf[:Format] != nil)
49
+ raise "Unknown format #{iDeliverableConf[:Format]} needed to deliver #{iDeliverableName}" if (iConf[:Deliver][:Formats][iDeliverableConf[:Format]] == nil)
50
+ end
51
+ raise "No mix specified for deliverable #{iDeliverableName}" if (iDeliverableConf[:Mix] == nil)
52
+ end
53
+ end
54
+
55
+ return rError
56
+ end
57
+
58
+ # Initialize Rake processes and return the task to be built
59
+ #
60
+ # Return::
61
+ # * _Symbol_: Rake target to execute
62
+ def getRakeTarget
63
+ initialize_RakeProcesses(:LstDeliverableNames => @LstDeliverableNames)
64
+ generateRakeFor_Deliver
65
+
66
+ return :Deliver
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+
73
+ exit MusicMaster::Deliver.new.execute(ARGV)
data/bin/Mix.rb CHANGED
@@ -1,99 +1,60 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
- require 'MusicMaster/Common'
8
- require 'rUtilAnts/Logging'
9
- RUtilAnts::Logging::initializeLogging('', '')
10
- require 'MusicMaster/ConfLoader'
7
+ require 'MusicMaster/Launcher'
11
8
 
12
9
  module MusicMaster
13
10
 
14
- # Execute the Mix
15
- #
16
- # Parameters:
17
- # * *iConfig* (<em>map<Symbol,Object></em>): The Mix configuration
18
- # Return:
19
- # * _String_: The resulting mix file
20
- def self.execute(iConfig)
21
- rPerformMixFile = nil
11
+ class Mix < Launcher
22
12
 
23
- lMixInputFile = nil
24
- lLstMixFiles = []
25
- lMissingFiles = []
26
- iConfig[:MixFiles].each do |iMixFileInfo|
27
- if (!File.exists?(iMixFileInfo[:FileName]))
28
- logErr "File #{iMixFileInfo[:FileName]} does not exist."
29
- lMissingFiles << iMixFileInfo[:FileName]
30
- else
31
- lResultFileName = executeOperations(iMixFileInfo[:FileName], iMixFileInfo[:Operations])
32
- if (lMixInputFile == nil)
33
- lMixInputFile = lResultFileName
34
- else
35
- lLstMixFiles << lResultFileName
36
- end
37
- end
13
+ protected
14
+
15
+ # Give additional command line options banner
16
+ #
17
+ # Return::
18
+ # * _String_: Options banner
19
+ def getOptionsBanner
20
+ return '[--name <MixName>]*'
38
21
  end
39
- if (!lMissingFiles.empty?)
40
- logErr "Mix will not be performed as some files were missing: #{lMissingFiles.join(', ')}"
41
- else
42
- if (lLstMixFiles.empty?)
43
- logInfo "Single perform file to mix: #{lMixInputFile}"
44
- rPerformMixFile = lMixInputFile
45
- else
46
- rPerformMixFile = "#{$MusicMasterConf[:Mix][:TempDir]}/Perform.Mix.wav"
47
- wsk(lMixInputFile, rPerformMixFile, 'Mix', "--files \"#{lLstMixFiles.join('|1|')}|1\" ")
22
+
23
+ # Complete options with the specific ones of this binary
24
+ #
25
+ # Parameters::
26
+ # * *ioOptionParser* (_OptionParser_): The options parser to complete
27
+ def completeOptionParser(ioOptionParser)
28
+ @LstMixNames = []
29
+ ioOptionParser.on( '--name <MixName>', String,
30
+ 'Specify the name of the mix to produce. Can be used several times. If not specified, all mixes will be produced.') do |iArg|
31
+ @LstMixNames << iArg
48
32
  end
49
- logInfo "Perform mix result in #{rPerformMixFile}"
50
33
  end
51
34
 
52
- return rPerformMixFile
53
- end
35
+ # Check configuration.
36
+ #
37
+ # Parameters::
38
+ # * *iConf* (<em>map<Symbol,Object></em>): The configuration
39
+ # Return::
40
+ # * _Exception_: Error, or nil in case of success
41
+ def checkConf(iConf)
42
+ return nil
43
+ end
54
44
 
55
- # Execute operations on a Wave file, then give back the resulting file
56
- #
57
- # Parameters:
58
- # * *iInputFile* (_String_): The input wave file
59
- # * *iOperations* (<em>list<[String,String]></em>): The list of operations to execute: [Action,Parameters].
60
- # Return:
61
- # * _String_: The resulting file name
62
- def self.executeOperations(iInputFile, iOperations)
63
- rResultFileName = iInputFile
45
+ # Initialize Rake processes and return the task to be built
46
+ #
47
+ # Return::
48
+ # * _Symbol_: Rake target to execute
49
+ def getRakeTarget
50
+ initialize_RakeProcesses(:LstMixNames => @LstMixNames)
51
+ generateRakeFor_Mix
64
52
 
65
- lBaseName = "#{$MusicMasterConf[:Mix][:TempDir]}/#{File.basename(iInputFile)[0..-5]}"
66
- iOperations.each_with_index do |iOperationInfo, iIdxOperation|
67
- iAction, iParameters = iOperationInfo
68
- lInputFileName = rResultFileName.clone
69
- rResultFileName = "#{lBaseName}.#{iIdxOperation}.#{iAction}.wav"
70
- # Call wsk if the file does not exist already
71
- if (!File.exists?(rResultFileName))
72
- wsk(lInputFileName, rResultFileName, iAction, iParameters)
73
- end
53
+ return :Mix
74
54
  end
75
55
 
76
- return rResultFileName
77
56
  end
78
57
 
79
58
  end
80
59
 
81
- rErrorCode = 0
82
- lConfigFile = ARGV[0]
83
- if (lConfigFile == nil)
84
- logErr 'Please specify the configuration file.'
85
- rErrorCode = 1
86
- elsif (!File.exists?(lConfigFile))
87
- logErr "File #{lConfigFile} does not exist."
88
- rErrorCode = 2
89
- else
90
- FileUtils::mkdir_p($MusicMasterConf[:Mix][:TempDir])
91
- lConfig = nil
92
- File.open(lConfigFile, 'r') do |iFile|
93
- lConfig = eval(iFile.read)
94
- end
95
- lMixFile = MusicMaster::execute(lConfig)
96
- logInfo "===== Mix saved in #{lMixFile}"
97
- end
98
-
99
- exit rErrorCode
60
+ exit MusicMaster::Mix.new.execute(ARGV)
data/bin/Process.rb ADDED
@@ -0,0 +1,55 @@
1
+ #!env ruby
2
+ #--
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
+ # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
+ #++
6
+
7
+ require 'MusicMaster/Launcher'
8
+
9
+ module MusicMaster
10
+
11
+ class Process < Launcher
12
+
13
+ protected
14
+
15
+ # Give additional command line options banner
16
+ #
17
+ # Return::
18
+ # * _String_: Options banner
19
+ def getOptionsBanner
20
+ return ''
21
+ end
22
+
23
+ # Complete options with the specific ones of this binary
24
+ #
25
+ # Parameters::
26
+ # * *ioOptionParser* (_OptionParser_): The options parser to complete
27
+ def completeOptionParser(ioOptionParser)
28
+ end
29
+
30
+ # Check configuration.
31
+ #
32
+ # Parameters::
33
+ # * *iConf* (<em>map<Symbol,Object></em>): The configuration
34
+ # Return::
35
+ # * _Exception_: Error, or nil in case of success
36
+ def checkConf(iConf)
37
+ return nil
38
+ end
39
+
40
+ # Initialize Rake processes and return the task to be built
41
+ #
42
+ # Return::
43
+ # * _Symbol_: Rake target to execute
44
+ def getRakeTarget
45
+ initialize_RakeProcesses
46
+ generateRakeFor_ProcessSourceFiles
47
+
48
+ return :ProcessSourceFiles
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+
55
+ exit MusicMaster::Process.new.execute(ARGV)