SampleX

 
SampleX is an integrated developing environment aimed at simple audio synthesis, through a easy-to-understand high level language and a dedicated interpreter.
It can be divided into three functional blocks:
  • A parser/lexer, which builds an APT (Abstract Parse Tree) starting from the source code
  • A synthesis engine, which explores the APT and creates the audio data
  • A minima IDE, with code wizards and syntax highlighting, which can be used to easily create the source code
Below you will find the full grammar in standard BNF notation.


SampleX grammar (Backus Naur Form)
  1. Start ::= SampleBlock <EOF>
  2. SampleBlock ::= Init Sources
  3. Init ::= "Init" "{" InitParams "}"
  4. InitParams ::= FileName ( InitChannels )? ( InitSRate )?
  5. FileName ::= "Name" "=" <V_NAME> ";"
  6. InitChannels ::= "Channels" "=" <V_CHANNELS> ";"
  7. InitSRate ::= "Samplerate" "=" <V_NUMBER> ";"
  8. Sources ::= "Sources" "{" ( SourceDescriptor )+ "}"
  9. SourceDescriptor ::= Source | WavFile
  10. Source ::= "Source" <V_NAME> "[" ( OscillatorParamList )+ "]"
  11. OscillatorParamList ::= OscillatorSettings | OscillatorModifiers
  12. OscillatorSettings ::= Waveform | Volume
  13. OscillatorModifiers ::= Amplitude | Frequency | Pan | Loop
  14. Waveform ::= "Waveform" "=" <V_WAVEFORM> ";"
  15. Volume ::= "Volume" "=" <V_NUMBER> ";"
  16. Amplitude ::= "Amplitude" "(" AmplitudeParamList ")"
  17. Frequency ::= "Frequency" "(" FrequencyParamList ")"
  18. Pan ::= &ldquo;Pan&rdquo; "(" PanParams ")"
  19. Loop ::= &ldquo;Loop&rdquo; "(" LoopParams ")"
  20. AmplitudeParamList ::= ( AmplitudeParameter )+
  21. AmplitudeParameter ::= Delay | Attack | Decay | Sustain |
  22. Release | Amp | SusAmp | EnvType
  23. Delay ::= "Delay" "=" <V_NUMBER> ";"
  24. Attack ::= "Attack" "=" <V_NUMBER> ";"
  25. Decay ::= "Decay" "=" <V_NUMBER> ";"
  26. Sustain ::= "Sustain" "=" <V_NUMBER> ";"
  27. Release ::= "Release" "=" <V_NUMBER> ";"
  28. Amp ::= "Amp" "=" <V_NUMBER> ";"
  29. SusAmp ::= "SusAmp" "=" <V_NUMBER> ";"
  30. EnvType ::= "EnvType" "=" <V_NUMBER> ";"
  31. FrequencyParamList ::= ( FrequencyParameter )+
  32. FrequencyParameter ::= StartF | EndF | FreqEnvType
  33. StartFrequency ::= "StartFrequency" "=" FreqValue ";"
  34. EndFrequency ::= "EndFrequency" "=" FreqValue ";"
  35. FreqEnvType ::= &ldquo;EnvType&rdquo; "=" <V_ENVTYPE> ";"
  36. FreqValue ::= Note | <V_NUMBER>
  37. Note ::= "Note" "(" <V_NOTE> ")"
  38. LoopParams ::= ( LoopParameter )+
  39. LoopParameter ::= Times | Every | GlobalDelay
  40. Times ::= "Times" "=" <V_NUMBER> ";"
  41. Every ::= "Every" "=" <V_NUMBER> ";"
  42. GlobalDelay ::= "GlobalDelay" "=" <V_NUMBER> ";"
  43. PanParams ::= PanParameter
  44. PanParameter ::= PanPosition | PanLfoParamList
  45. PanPosition ::= &ldquo;Position&rdquo; "=" <V_NUMBER> ";"
  46. PanLfoParamList ::= ( PanLfoParameter )+
  47. PanLfoParameter ::= LfoFrequency | LfoWaveform
  48. LfoFrequency ::= "LfoFrequency" "="<V_NUMBER> ";"
  49. LfoWaveform ::= "Waveform" "=" <V_WAVEFORM> ";"
  50. WavFile ::= "WaveFile" <V_NAME> "[" ( WavFileParamList )+ "]"
  51. WavFileParamList ::= WavFileSettings | WavFileModifiers
  52. WavFileSettings ::= Path | Volume | Length | Offset | Delay
  53. WavFileModifiers ::= Pan | Loop
  54. Path ::= "Path" "=" <V_PATH> ";"
  55. Length ::= "Length" "=" <V_NUMBER> ";"
  56. Offset ::= "Offset" "=" <V_NUMBER> ";"