Module: MusicMaster::FilesNamer

Included in:
Launcher
Defined in:
lib/MusicMaster/FilesNamer.rb

Instance Method Summary collapse

Instance Method Details

#getAnalyzedRecordedDirObject

Get the directory in which recorded files are analyzed

Return
  • String: Directory to store analysis results of recorded files to



32
33
34
# File 'lib/MusicMaster/FilesNamer.rb', line 32

def getAnalyzedRecordedDir
  return @MusicMasterConf[:Directories][:AnalyzeRecord]
end

#getCalibratedDirObject

Get the directory in which files are calibrated

Return
  • String: Directory to calibrate files to



48
49
50
# File 'lib/MusicMaster/FilesNamer.rb', line 48

def getCalibratedDir
  return @MusicMasterConf[:Directories][:Calibrate]
end

#getCalibratedFileName(iRecordedBaseName) ⇒ Object

Get the calibrated recorded file name

Parameters
  • iRecordedBaseName (String): Base name of the recorded track

Return
  • String: Name of the Wave file



130
131
132
# File 'lib/MusicMaster/FilesNamer.rb', line 130

def getCalibratedFileName(iRecordedBaseName)
  return "#{getCalibratedDir}/#{iRecordedBaseName}.Calibrated.wav"
end

#getCleanedDirObject

Get the directory in which files are cleaned

Return
  • String: Directory to clean files to



40
41
42
# File 'lib/MusicMaster/FilesNamer.rb', line 40

def getCleanedDir
  return @MusicMasterConf[:Directories][:Clean]
end

#getCutFileName(iBaseName, iCutInfo) ⇒ Object

Get the name of the file generated after applying a cut from it.

Parameters
  • iBaseName (String): Base name of the file

  • iCutInfo ([String,String]): The cut information, used to extract only a part of the file (begin and end markers, in seconds or samples)

Return
  • String: The generated file name



187
188
189
# File 'lib/MusicMaster/FilesNamer.rb', line 187

def getCutFileName(iBaseName, iCutInfo)
  return "#{getCleanedDir}/#{iBaseName}.02.Cut.#{iCutInfo.join('_')}.wav"
end

#getDCRemovedFileName(iBaseName) ⇒ Object

Get the name of the file generated after applying a DC remover from it.

Parameters
  • iBaseName (String): Base name of the file

Return
  • String: The generated file name



197
198
199
# File 'lib/MusicMaster/FilesNamer.rb', line 197

def getDCRemovedFileName(iBaseName)
  return "#{getCleanedDir}/#{iBaseName}.03.DCShifter.wav"
end

#getDeliverDirObject

Get the directory in which files are delivered

Return
  • String: Directory to deliver files to



88
89
90
# File 'lib/MusicMaster/FilesNamer.rb', line 88

def getDeliverDir
  return @MusicMasterConf[:Directories][:Deliver]
end

#getFinalMixDirObject

Get the directory in which final mix files are linked

Return
  • String: Directory storing links to final mix files



80
81
82
# File 'lib/MusicMaster/FilesNamer.rb', line 80

def getFinalMixDir
  return @MusicMasterConf[:Directories][:FinalMix]
end

#getFinalMixFileName(iMixName) ⇒ Object

Get the name of a final mix file (the symbolic link)

Parameters
  • iMixName (String): Name of the mix



247
248
249
# File 'lib/MusicMaster/FilesNamer.rb', line 247

def getFinalMixFileName(iMixName)
  return "#{getFinalMixDir}/#{iMixName}.wav"
end

#getMixDirObject

Get the directory in which mix files are processed

Return
  • String: Directory to mix files to



72
73
74
# File 'lib/MusicMaster/FilesNamer.rb', line 72

def getMixDir
  return @MusicMasterConf[:Directories][:Mix]
end

#getMixFileName(iDir, iMixName, iMixTracksConf) ⇒ Object

Get the name of a file to be mixed

Parameters
  • iDir (String): Directory where to store the mixed file

  • iMixName (String): Name of the mix

  • iMixTracksConf (map<Symbol,Object>): Mix tracks’ parameters



239
240
241
# File 'lib/MusicMaster/FilesNamer.rb', line 239

def getMixFileName(iDir, iMixName, iMixTracksConf)
  return "#{iDir}/#{iMixName}.#{iMixTracksConf.unique_id}.wav"
end

#getNoiseGateFileName(iBaseName) ⇒ Object

Get the name of the file generated after applying a noise gate from it.

Parameters
  • iBaseName (String): Base name of the file

Return
  • String: The generated file name



207
208
209
# File 'lib/MusicMaster/FilesNamer.rb', line 207

def getNoiseGateFileName(iBaseName)
  return "#{getCleanedDir}/#{iBaseName}.04.NoiseGate.wav"
end

#getProcessedFileName(iDir, iBaseName, iIdxProcess, iProcessName, iProcessParams) ⇒ Object

Get the name of a file to processed

Parameters
  • iDir (String): Directory where to store the processed file

  • iBaseName (String): Base name of the processed file source

  • iIdxProcess (Integer): Index of the process

  • iProcessName (String): Name of the process to apply

  • iProcessParams (map<Symbol,Object>): Process parameters



219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/MusicMaster/FilesNamer.rb', line 219

def getProcessedFileName(iDir, iBaseName, iIdxProcess, iProcessName, iProcessParams)
  # If the base name contains already an ID, integrate it in the new ID
  lMatch = iBaseName.match(/^(.*)\.([[:xdigit:]]{32,32})$/)
  if (lMatch == nil)
    return "#{iDir}/#{iBaseName}.#{iIdxProcess}.#{iProcessName}.#{iProcessParams.unique_id}.wav"
  else
    lNewBaseName = lMatch[1]
    lNewProcessParams = {
      :__InheritedID__ => lMatch[2]
    }.merge(iProcessParams)
    return "#{iDir}/#{lNewBaseName}.#{iIdxProcess}.#{iProcessName}.#{lNewProcessParams.unique_id}.wav"
  end
end

#getProcessesRecordDirObject

Get the directory in which recorded files are processed

Return
  • String: Directory to process files to



64
65
66
# File 'lib/MusicMaster/FilesNamer.rb', line 64

def getProcessesRecordDir
  return @MusicMasterConf[:Directories][:ProcessRecord]
end

#getProcessesWaveDirObject

Get the directory in which Wave files are processed

Return
  • String: Directory to process files to



56
57
58
# File 'lib/MusicMaster/FilesNamer.rb', line 56

def getProcessesWaveDir
  return @MusicMasterConf[:Directories][:ProcessWave]
end

#getRecordedAnalysisFileName(iBaseName) ⇒ Object

Get the name of an analysis file taken from a recorded file

Parameters
  • iBaseName (String): Base name of the recorded file (without extension)

Return
  • String: The analysis file name



156
157
158
# File 'lib/MusicMaster/FilesNamer.rb', line 156

def getRecordedAnalysisFileName(iBaseName)
  return "#{getAnalyzedRecordedDir}/#{iBaseName}.analyze"
end

#getRecordedCalibrationFileName(iEnvReference, iEnvRecording) ⇒ Object

Get the recorded calibration file name, recording from a recording environment in order to be compared later with a reference environment.

Parameters
  • iEnvReference (Symbol): The reference environment

  • iEnvRecording (Symbol): The recording environment

Return
  • String: Name of the Wave file



120
121
122
# File 'lib/MusicMaster/FilesNamer.rb', line 120

def getRecordedCalibrationFileName(iEnvReference, iEnvRecording)
  return "#{getRecordedDir}/Calibration.#{iEnvRecording}.#{iEnvReference}.wav"
end

#getRecordedDirObject

Get the directory in which files are recorded

Return
  • String: Directory to record files to



16
17
18
# File 'lib/MusicMaster/FilesNamer.rb', line 16

def getRecordedDir
  return @MusicMasterConf[:Directories][:Record]
end

#getRecordedFFTProfileFileName(iBaseName) ⇒ Object

Get the name of a FFT profike file taken from a recorded file

Parameters
  • iBaseName (String): Base name of the recorded file (without extension)

Return
  • String: The FFT profile file name



166
167
168
# File 'lib/MusicMaster/FilesNamer.rb', line 166

def getRecordedFFTProfileFileName(iBaseName)
  return "#{getAnalyzedRecordedDir}/#{iBaseName}.fftprofile"
end

#getRecordedFileName(iEnv, iLstTracks) ⇒ Object

Get the recorded file name of a given list of tracks on a given environment

Parameters
  • iEnv (Symbol): The environment

  • iLstTracks (list<Integer>): The list of tracks being recorded

Return
  • String: Name of the Wave file



99
100
101
# File 'lib/MusicMaster/FilesNamer.rb', line 99

def getRecordedFileName(iEnv, iLstTracks)
  return "#{getRecordedDir}/#{iEnv}.#{iLstTracks.sort.join('.')}.wav"
end

#getRecordedSilenceFileName(iEnv) ⇒ Object

Get the recorded silence file name on a given recording environment

Parameters
  • iEnv (Symbol): The environment

Return
  • String: Name of the Wave file



109
110
111
# File 'lib/MusicMaster/FilesNamer.rb', line 109

def getRecordedSilenceFileName(iEnv)
  return "#{getRecordedDir}/#{iEnv}.Silence.wav"
end

#getSilenceRemovedFileName(iBaseName) ⇒ Object

Get the name of the file generated after removing silences from it.

Parameters
  • iBaseName (String): Base name of the file

Return
  • String: The generated file name



176
177
178
# File 'lib/MusicMaster/FilesNamer.rb', line 176

def getSilenceRemovedFileName(iBaseName)
  return "#{getCleanedDir}/#{iBaseName}.01.SilenceRemover.wav"
end

#getWaveDirObject

Get the directory in which static audio files are stored

Return
  • String: Directory to store static audio files to



24
25
26
# File 'lib/MusicMaster/FilesNamer.rb', line 24

def getWaveDir
  return @MusicMasterConf[:Directories][:Wave]
end

#getWaveSourceFileName(iFileName) ⇒ Object

Get the name of a source wave file

Parameters
  • iFileName (String): Name of the Wave file used to generate this source wave file

Return
  • String: Name of the Wave file



140
141
142
143
144
145
146
147
148
# File 'lib/MusicMaster/FilesNamer.rb', line 140

def getWaveSourceFileName(iFileName)
  if (File.exists?(iFileName))
    # Use the original one
    return iFileName
  else
    # We will generate a new one
    return "#{getWaveDir}/#{File.basename(iFileName)}"
  end
end